]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
test: explicitly check if systemctl is available for systemd tests
authorLaszlo Gombos <laszlo.gombos@gmail.com>
Sun, 13 Nov 2022 15:16:22 +0000 (15:16 +0000)
committerJóhann B. Guðmundsson <johannbg@gmail.com>
Fri, 18 Nov 2022 10:19:50 +0000 (10:19 +0000)
Dracut tests already do similar checks for test 40, 62, 63 and 98.

This is useful when the full testsuite is run and systemd is not
available.

test/TEST-02-SYSTEMD/test.sh
test/TEST-04-FULL-SYSTEMD/test.sh

index 64b135ba410bf492c3160a0fcf1627678e75c51e..948817d1751ed18cfbc88f412af2adaba5c39c90 100755 (executable)
@@ -2,6 +2,10 @@
 # shellcheck disable=SC2034
 TEST_DESCRIPTION="root filesystem on a ext3 filesystem"
 
+test_check() {
+    command -v systemctl &> /dev/null
+}
+
 KVERSION="${KVERSION-$(uname -r)}"
 
 # Uncomment this to debug failures
index 78725c851a3e9a5ba8a2cb7406039d4e074fd044..b4d627853645ad0b4d3178be0817484134c3099e 100755 (executable)
@@ -3,6 +3,10 @@
 # shellcheck disable=SC2034
 TEST_DESCRIPTION="Full systemd serialization/deserialization test with /usr mount"
 
+test_check() {
+    command -v systemctl &> /dev/null
+}
+
 export KVERSION=${KVERSION-$(uname -r)}
 
 # Uncomment this to debug failures