summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2022-08-09 10:07:44 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2022-08-09 10:07:44 +0200
commitd5e4a18cb686a387ddb683102b89697eaaad809b (patch)
tree1b4f8215358c5241e749fe58d56f98b28cefddfb
parent93ce539bc6946b9090cc7bf8430f9bdfa0d20fbc (diff)
downloadalpine-conf-d5e4a18cb686a387ddb683102b89697eaaad809b.zip
tests: verify that mdevd/udev is started and mdev stopped
-rwxr-xr-xtests/setup_devd_test30
1 files changed, 27 insertions, 3 deletions
diff --git a/tests/setup_devd_test b/tests/setup_devd_test
index c7ce246..3e006ee 100755
--- a/tests/setup_devd_test
+++ b/tests/setup_devd_test
@@ -11,9 +11,16 @@ setup_devd_usage_body() {
test_usage setup-devd
}
+init_mdev() {
+ # make sure `rc-service --exist mdev` returns true
+ mkdir -p etc/init.d
+ touch etc/init.d/mdev
+ rc-service mdev start
+}
+
setup_devd_mdev_body() {
init_env
- rc-service mdev start
+ init_mdev
atf_check -s exit:0 \
-o empty \
-e empty \
@@ -22,17 +29,26 @@ setup_devd_mdev_body() {
setup_devd_mdevd_body() {
init_env
- rc-service mdev start
+ init_mdev
+
atf_check -s exit:0 \
-o match:"apk add.*mdevd" \
-o match:"Starting mdevd" \
-e empty \
setup-devd mdevd
+
+ atf_check \
+ -o match:"started" \
+ rc-service mdevd status
+
+ atf_check -s exit:3 \
+ -o match:"stopped" \
+ rc-service mdev status
}
setup_devd_udev_body() {
init_env
- rc-service mdev start
+ init_mdev
atf_check -s exit:0 \
-o match:"apk add.*eudev" \
-o match:"Starting udev" \
@@ -41,4 +57,12 @@ setup_devd_udev_body() {
-o match:"Starting udev-postmount" \
-e empty \
setup-devd udev
+
+ atf_check \
+ -o match:"started" \
+ rc-service udev status
+
+ atf_check -s exit:3 \
+ -o match:"stopped" \
+ rc-service mdev status
}