From: Jo Zzsi Date: Sat, 11 Jan 2025 02:04:59 +0000 (-0500) Subject: test: graceful poweroff for systemd based tests X-Git-Tag: 106~71 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc2b6b0;p=thirdparty%2Fdracut-ng.git test: graceful poweroff for systemd based tests This PR makes the test case more life-like and prepares for testing dracut-shutdown. --- 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