From d5e4a18cb686a387ddb683102b89697eaaad809b Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Tue, 9 Aug 2022 10:07:44 +0200 Subject: tests: verify that mdevd/udev is started and mdev stopped --- tests/setup_devd_test | 30 +++++++++++++++++++++++++++--- 1 file 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 } -- cgit v1.2.3