summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--setup-devd.in4
-rwxr-xr-xtests/setup_devd_test36
2 files changed, 37 insertions, 3 deletions
diff --git a/setup-devd.in b/setup-devd.in
index 218ed8c..7225463 100644
--- a/setup-devd.in
+++ b/setup-devd.in
@@ -50,7 +50,7 @@ disable_mdevd () {
}
enable_mdevd () {
- apk add --quiet mdevd mdevd-openrc
+ $MOCK apk add --quiet mdevd mdevd-openrc
rc-update add --quiet mdevd sysinit
rc-update add --quiet mdevd-init sysinit
rc-service --ifstopped mdevd start
@@ -71,7 +71,7 @@ disable_udev () {
}
enable_udev () {
- apk add --quiet eudev udev-init-scripts udev-init-scripts-openrc
+ $MOCK apk add --quiet eudev udev-init-scripts udev-init-scripts-openrc
rc-update add --quiet udev sysinit
rc-update add --quiet udev-trigger sysinit
rc-update add --quiet udev-settle sysinit
diff --git a/tests/setup_devd_test b/tests/setup_devd_test
index 60e84b3..c7ce246 100755
--- a/tests/setup_devd_test
+++ b/tests/setup_devd_test
@@ -2,9 +2,43 @@
. $(atf_get_srcdir)/test_env.sh
init_tests \
- setup_devd_usage
+ setup_devd_usage \
+ setup_devd_mdev \
+ setup_devd_mdevd \
+ setup_devd_udev
setup_devd_usage_body() {
test_usage setup-devd
}
+setup_devd_mdev_body() {
+ init_env
+ rc-service mdev start
+ atf_check -s exit:0 \
+ -o empty \
+ -e empty \
+ setup-devd mdev
+}
+
+setup_devd_mdevd_body() {
+ init_env
+ rc-service mdev start
+ atf_check -s exit:0 \
+ -o match:"apk add.*mdevd" \
+ -o match:"Starting mdevd" \
+ -e empty \
+ setup-devd mdevd
+}
+
+setup_devd_udev_body() {
+ init_env
+ rc-service mdev start
+ atf_check -s exit:0 \
+ -o match:"apk add.*eudev" \
+ -o match:"Starting udev" \
+ -o match:"Starting udev-trigger" \
+ -o match:"Starting udev-settle" \
+ -o match:"Starting udev-postmount" \
+ -e empty \
+ setup-devd udev
+}