From bc2b6b0e55ba05b714c5ea38a7965719ac4f6c24 Mon Sep 17 00:00:00 2001 From: Jo Zzsi Date: Fri, 10 Jan 2025 21:04:59 -0500 Subject: [PATCH] test: graceful poweroff for systemd based tests This PR makes the test case more life-like and prepares for testing dracut-shutdown. --- test/modules.d/80test-root/test-init.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/modules.d/80test-root/test-init.sh b/test/modules.d/80test-root/test-init.sh index c7ab6f63a..ad472959a 100755 --- a/test/modules.d/80test-root/test-init.sh +++ b/test/modules.d/80test-root/test-init.sh @@ -29,4 +29,11 @@ fi echo "made it to the rootfs!" echo "Powering down." -poweroff -f + +if [ -f /usr/lib/systemctl ]; then + # graceful poweroff + systemctl poweroff +else + # force immediate poweroff + poweroff -f +fi -- 2.47.3