]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
test: tell systemd to reboot on fatal errors
authorLubomir Rintel <lkundrak@v3.sk>
Wed, 26 Jun 2019 09:47:21 +0000 (11:47 +0200)
committerHarald Hoyer <harald@hoyer.xyz>
Fri, 19 Jul 2019 14:10:54 +0000 (16:10 +0200)
Otherwise systemd would freeze execution, causing the test to time out
instead of failing fast.

18 files changed:
test/TEST-01-BASIC/test.sh
test/TEST-02-SYSTEMD/test.sh
test/TEST-03-USR-MOUNT/test.sh
test/TEST-04-FULL-SYSTEMD/test.sh
test/TEST-10-RAID/test.sh
test/TEST-11-LVM/test.sh
test/TEST-12-RAID-DEG/test.sh
test/TEST-13-ENC-RAID-LVM/test.sh
test/TEST-14-IMSM/test.sh
test/TEST-15-BTRFSRAID/test.sh
test/TEST-16-DMSQUASH/test.sh
test/TEST-17-LVM-THIN/test.sh
test/TEST-20-NFS/test.sh
test/TEST-30-ISCSI/test.sh
test/TEST-31-ISCSI-MULTI/test.sh
test/TEST-40-NBD/test.sh
test/TEST-50-MULTINIC/test.sh
test/TEST-70-BONDBRIDGETEAMVLAN/test.sh

index ed2ae5dedbf61b6617feee56bd17346743b46d1b..ca4a8288f9d18b654998035b4d94387373436dcd 100755 (executable)
@@ -15,7 +15,7 @@ test_run() {
        -net none \
        -watchdog i6300esb -watchdog-action poweroff \
         -no-reboot \
-       -append "panic=1 root=LABEL=dracut rw systemd.log_level=debug systemd.log_target=console rd.retry=3 rd.debug console=ttyS0,115200n81 rd.shell=0 $DEBUGFAIL" \
+       -append "panic=1 systemd.crash_reboot root=LABEL=dracut rw systemd.log_level=debug systemd.log_target=console rd.retry=3 rd.debug console=ttyS0,115200n81 rd.shell=0 $DEBUGFAIL" \
        -initrd $TESTDIR/initramfs.testing || return 1
     grep -F -m 1 -q dracut-root-block-success $TESTDIR/result || return 1
 }
index 8c5eb168bc977a25d21ee98a3a5fe08a79e124f8..848021e586284d004edf3b32b1c826c2ab0bf7f1 100755 (executable)
@@ -11,7 +11,7 @@ test_run() {
         -m 512M  -smp 2 -nographic \
         -net none \
         -no-reboot \
-        -append "panic=1 root=LABEL=dracut rw loglevel=77 systemd.log_level=debug systemd.log_target=console rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 init=/sbin/init rd.shell=0 $DEBUGFAIL" \
+        -append "panic=1 systemd.crash_reboot root=LABEL=dracut rw loglevel=77 systemd.log_level=debug systemd.log_target=console rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 init=/sbin/init rd.shell=0 $DEBUGFAIL" \
         -initrd $TESTDIR/initramfs.testing
     grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext3 || return 1
 }
index 42c0da65e5b948659ae6a51c4a7c8feff5418a6d..5d5ec8f83cb24a78c49a45b6381b1481082da718 100755 (executable)
@@ -22,7 +22,7 @@ client_run() {
        -net none \
        -watchdog i6300esb -watchdog-action poweroff \
         -no-reboot \
-       -append "panic=1 root=LABEL=dracut $client_opts quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL" \
+       -append "panic=1 systemd.crash_reboot root=LABEL=dracut $client_opts quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL" \
        -initrd $TESTDIR/initramfs.testing
 
     if (($? != 0)); then
index 97528e4fb42109d899e8485f74c643d13c872fdc..f65f30f24401edb3daeb480e5f5160391d6efea2 100755 (executable)
@@ -23,7 +23,7 @@ client_run() {
        -m 512M  -smp 2 -nographic \
        -net none \
         -no-reboot \
-       -append "panic=1 root=LABEL=dracut $client_opts rd.retry=3 console=ttyS0,115200n81 selinux=0 $DEBUGOUT rd.shell=0 $DEBUGFAIL" \
+       -append "panic=1 systemd.crash_reboot root=LABEL=dracut $client_opts rd.retry=3 console=ttyS0,115200n81 selinux=0 $DEBUGOUT rd.shell=0 $DEBUGFAIL" \
        -initrd $TESTDIR/initramfs.testing
 
     if (($? != 0)); then
index 444126b289f6f4dea70c9fc7e9551dd84fdd1469..0beb26c3a4face793575debfc9258aea2d16e0bc 100755 (executable)
@@ -13,7 +13,7 @@ test_run() {
        -m 512M  -smp 2 -nographic \
        -net none \
         -no-reboot \
-       -append "panic=1 root=/dev/dracut/root rd.auto rw rd.retry=10 console=ttyS0,115200n81 selinux=0 rd.shell=0 $DEBUGFAIL" \
+       -append "panic=1 systemd.crash_reboot root=/dev/dracut/root rd.auto rw rd.retry=10 console=ttyS0,115200n81 selinux=0 rd.shell=0 $DEBUGFAIL" \
        -initrd $TESTDIR/initramfs.testing
     grep -F -m 1 -q dracut-root-block-success $DISKIMAGE || return 1
 }
index 5c105e0121039567f1993f3c1e69f0046cbcf26f..a907c4b1197828c694cef1ead0413eccf0c66500 100755 (executable)
@@ -12,7 +12,7 @@ test_run() {
        -m 512M  -smp 2 -nographic \
        -net none \
         -no-reboot \
-       -append "panic=1 root=/dev/dracut/root rw rd.auto=1 quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL" \
+       -append "panic=1 systemd.crash_reboot root=/dev/dracut/root rw rd.auto=1 quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL" \
        -initrd $TESTDIR/initramfs.testing
     grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext2 || return 1
 }
index 4e381d844226d5e0e3400cd2584812db05429c59..c82cde1ea0d9d47bb7be7a7090001afa384493d9 100755 (executable)
@@ -20,7 +20,7 @@ client_run() {
         -drive format=raw,index=3,media=disk,file=$TESTDIR/disk3.img.new \
         -net none \
         -no-reboot \
-        -append "panic=1 $* systemd.log_target=kmsg loglevel=7 root=LABEL=root rw rd.retry=20 rd.info console=ttyS0,115200n81 log_buf_len=2M selinux=0 rd.debug rd.shell=0 $DEBUGFAIL " \
+        -append "panic=1 systemd.crash_reboot $* systemd.log_target=kmsg loglevel=7 root=LABEL=root rw rd.retry=20 rd.info console=ttyS0,115200n81 log_buf_len=2M selinux=0 rd.debug rd.shell=0 $DEBUGFAIL " \
         -initrd $TESTDIR/initramfs.testing
     if ! grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext2; then
         echo "CLIENT TEST END: $@ [FAIL]"
index 76ec36b3750804400faa61b2fad617f8b4660407..99324ce98fe500da4d794d66ad376242b4773d1d 100755 (executable)
@@ -20,7 +20,7 @@ test_run() {
        -m 512M  -smp 2 -nographic \
        -net none \
         -no-reboot \
-       -append "panic=1 root=/dev/dracut/root rw rd.auto rd.retry=20 console=ttyS0,115200n81 selinux=0 rd.debug rootwait $LUKSARGS rd.shell=0 $DEBUGFAIL" \
+       -append "panic=1 systemd.crash_reboot root=/dev/dracut/root rw rd.auto rd.retry=20 console=ttyS0,115200n81 selinux=0 rd.debug rootwait $LUKSARGS rd.shell=0 $DEBUGFAIL" \
        -initrd $TESTDIR/initramfs.testing
     grep -F -m 1 -q dracut-root-block-success $TESTDIR/check-success.img || return 1
     echo "CLIENT TEST END: [OK]"
@@ -34,7 +34,7 @@ test_run() {
        -m 512M  -smp 2 -nographic \
        -net none \
         -no-reboot \
-       -append "panic=1 root=/dev/dracut/root rw quiet rd.auto rd.retry=20 rd.info console=ttyS0,115200n81 selinux=0 rd.debug  $DEBUGFAIL" \
+       -append "panic=1 systemd.crash_reboot root=/dev/dracut/root rw quiet rd.auto rd.retry=20 rd.info console=ttyS0,115200n81 selinux=0 rd.debug  $DEBUGFAIL" \
        -initrd $TESTDIR/initramfs.testing
     grep -F -m 1 -q dracut-root-block-success $TESTDIR/check-success.img || return 1
     echo "CLIENT TEST END: [OK]"
@@ -48,7 +48,7 @@ test_run() {
        -m 512M  -smp 2 -nographic \
        -net none \
         -no-reboot \
-       -append "panic=1 root=/dev/dracut/root rw quiet rd.auto rd.retry=10 rd.info console=ttyS0,115200n81 selinux=0 rd.debug  $DEBUGFAIL rd.luks.uuid=failme" \
+       -append "panic=1 systemd.crash_reboot root=/dev/dracut/root rw quiet rd.auto rd.retry=10 rd.info console=ttyS0,115200n81 selinux=0 rd.debug  $DEBUGFAIL rd.luks.uuid=failme" \
        -initrd $TESTDIR/initramfs.testing
     grep -F -m 1 -q dracut-root-block-success $TESTDIR/check-success.img && return 1
     echo "CLIENT TEST END: [OK]"
index 8ebc285a47f57ce73c7c51d8a1595fe7c26a0ac7..ed60f052bc87fdb555e3d81c7df45271f90f14f8 100755 (executable)
@@ -16,7 +16,7 @@ client_run() {
        -m 512M  -smp 2 -nographic \
        -net none \
         -no-reboot \
-       -append "panic=1 $* root=LABEL=root rw debug rd.retry=5 rd.debug console=ttyS0,115200n81 selinux=0 rd.info rd.shell=0 $DEBUGFAIL" \
+       -append "panic=1 systemd.crash_reboot $* root=LABEL=root rw debug rd.retry=5 rd.debug console=ttyS0,115200n81 selinux=0 rd.info rd.shell=0 $DEBUGFAIL" \
        -initrd $TESTDIR/initramfs.testing
     if ! grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext2; then
        echo "CLIENT TEST END: $@ [FAIL]"
index 02cb49765b2006457728525ca9cbe5279e36bc01..dda766725f08db1f49ed2619b38c35ec1b658918 100755 (executable)
@@ -15,7 +15,7 @@ test_run() {
        -m 512M -smp 2 -nographic \
        -net none \
         -no-reboot \
-       -append "panic=1 root=LABEL=root rw rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.shell=0 $DEBUGFAIL" \
+       -append "panic=1 systemd.crash_reboot root=LABEL=root rw rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.shell=0 $DEBUGFAIL" \
        -initrd $TESTDIR/initramfs.testing
     grep -F -m 1 -q dracut-root-block-success $MARKER_DISKIMAGE || return 1
 }
index 45d8c4c05534561e847fcf8d48f0d6ff417f40b0..65d5bdbb842e5258e50f37778774f65a18eb2ea6 100755 (executable)
@@ -23,7 +23,7 @@ test_run() {
         -nographic \
         -net none \
         -no-reboot \
-        -append "panic=1 root=live:CDLABEL=LiveCD live rw quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.shell=0 $DEBUGFAIL" \
+        -append "panic=1 systemd.crash_reboot root=live:CDLABEL=LiveCD live rw quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.shell=0 $DEBUGFAIL" \
         -initrd "$TESTDIR"/initramfs.testing
 
     # mediacheck test with qemu GUI
index 1b36a216d08a47c5e60799334141ee082d66a168..c13e90636d8f68ef4e0b33ed5051d7d3279a8ad1 100755 (executable)
@@ -12,7 +12,7 @@ test_run() {
        -m 512M  -smp 2 -nographic \
        -net none \
         -no-reboot \
-       -append "panic=1 root=/dev/dracut/root rw rd.auto=1 quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL" \
+       -append "panic=1 systemd.crash_reboot root=/dev/dracut/root rw rd.auto=1 quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL" \
        -initrd $TESTDIR/initramfs.testing
     grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext2 || return 1
 }
index e942745ab56f43e15c067dbcf3b13acdad747b9e..4ad7fd77078cf39814690f02e20eae1b772efbfa 100755 (executable)
@@ -22,7 +22,7 @@ run_server() {
         ${SERIAL:--serial file:"$TESTDIR"/server.log} \
         -watchdog i6300esb -watchdog-action poweroff \
         -no-reboot \
-        -append "panic=1 rd.debug loglevel=77 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0" \
+        -append "panic=1 systemd.crash_reboot rd.debug loglevel=77 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0" \
         -initrd $TESTDIR/initramfs.server \
         -pidfile $TESTDIR/server.pid -daemonize || return 1
     sudo chmod 644 $TESTDIR/server.pid || return 1
@@ -57,7 +57,7 @@ client_test() {
         -net socket,connect=127.0.0.1:12320 \
         -watchdog i6300esb -watchdog-action poweroff \
         -no-reboot \
-        -append "panic=1 rd.shell=0 $cmdline $DEBUGFAIL rd.debug rd.retry=10 rd.info quiet  ro console=ttyS0,115200n81 selinux=0" \
+        -append "panic=1 systemd.crash_reboot rd.shell=0 $cmdline $DEBUGFAIL rd.debug rd.retry=10 rd.info quiet  ro console=ttyS0,115200n81 selinux=0" \
         -initrd $TESTDIR/initramfs.testing
 
     if [[ $? -ne 0 ]] || ! grep -F -m 1 -q nfs-OK $TESTDIR/client.img; then
index f6cc56d5f78296558e6a3e6bf71f2f1fd8d9b561..d5a6ba58b36699bc8b7e7e4264276ff7634a7462 100755 (executable)
@@ -26,7 +26,7 @@ run_server() {
         -net nic,macaddr=52:54:00:12:34:57,model=e1000 \
         -net socket,listen=127.0.0.1:12330 \
         -no-reboot \
-        -append "panic=1 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0 $SERVER_DEBUG" \
+        -append "panic=1 systemd.crash_reboot root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0 $SERVER_DEBUG" \
         -initrd $TESTDIR/initramfs.server \
         -pidfile $TESTDIR/server.pid -daemonize || return 1
     sudo chmod 644 $TESTDIR/server.pid || return 1
@@ -51,7 +51,7 @@ run_client() {
         -net nic,macaddr=52:54:00:12:34:01,model=e1000 \
         -net socket,connect=127.0.0.1:12330 \
         -no-reboot \
-        -append "panic=1 rw rd.auto rd.retry=50 console=ttyS0,115200n81 selinux=0 rd.debug=0 rd.shell=0 $DEBUGFAIL $*" \
+        -append "panic=1 systemd.crash_reboot rw rd.auto rd.retry=50 console=ttyS0,115200n81 selinux=0 rd.debug=0 rd.shell=0 $DEBUGFAIL $*" \
         -initrd $TESTDIR/initramfs.testing
     if ! grep -F -m 1 -q iscsi-OK $TESTDIR/client.img; then
        echo "CLIENT TEST END: $test_name [FAILED - BAD EXIT]"
index 5c38249c419248d3f6dac97a264c1aa591476358..20db2451896d33f2a63f2e99b7985467b6a996a4 100755 (executable)
@@ -26,7 +26,7 @@ run_server() {
         -net nic,macaddr=52:54:00:12:34:57,model=e1000 \
         -net socket,listen=127.0.0.1:12331 \
         -no-reboot \
-        -append "panic=1 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0 $SERVER_DEBUG" \
+        -append "panic=1 systemd.crash_reboot root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0 $SERVER_DEBUG" \
         -initrd $TESTDIR/initramfs.server \
         -pidfile $TESTDIR/server.pid -daemonize || return 1
     sudo chmod 644 $TESTDIR/server.pid || return 1
@@ -51,7 +51,7 @@ run_client() {
         -net nic,macaddr=52:54:00:12:34:01,model=e1000 \
         -net socket,connect=127.0.0.1:12331 \
         -no-reboot \
-        -append "panic=1 rw rd.auto rd.retry=50 console=ttyS0,115200n81 selinux=0 rd.debug=0 rd.shell=0 $DEBUGFAIL $*" \
+        -append "panic=1 systemd.crash_reboot rw rd.auto rd.retry=50 console=ttyS0,115200n81 selinux=0 rd.debug=0 rd.shell=0 $DEBUGFAIL $*" \
         -initrd $TESTDIR/initramfs.testing
     if ! grep -F -m 1 -q iscsi-OK $TESTDIR/client.img; then
        echo "CLIENT TEST END: $test_name [FAILED - BAD EXIT]"
index 12736a15b3a855e0c62df2f261dd6f6877883cec..19ec5b0eded88fed94ae98163d9983a215d477b7 100755 (executable)
@@ -28,7 +28,7 @@ run_server() {
         ${SERIAL:+-serial "$SERIAL"} \
         ${SERIAL:--serial file:"$TESTDIR"/server.log} \
         -no-reboot \
-        -append "panic=1 root=/dev/sda rootfstype=ext2 rw quiet console=ttyS0,115200n81 selinux=0" \
+        -append "panic=1 systemd.crash_reboot root=/dev/sda rootfstype=ext2 rw quiet console=ttyS0,115200n81 selinux=0" \
         -initrd $TESTDIR/initramfs.server -pidfile $TESTDIR/server.pid -daemonize || return 1
     sudo chmod 644 $TESTDIR/server.pid || return 1
 
@@ -65,7 +65,7 @@ client_test() {
         -net nic,macaddr=$mac,model=e1000 \
         -net socket,connect=127.0.0.1:12340 \
         -no-reboot \
-        -append "panic=1 rd.shell=0 $cmdline $DEBUGFAIL rd.auto rd.info rd.retry=10 ro console=ttyS0,115200n81  selinux=0  " \
+        -append "panic=1 systemd.crash_reboot rd.shell=0 $cmdline $DEBUGFAIL rd.auto rd.info rd.retry=10 ro console=ttyS0,115200n81  selinux=0  " \
         -initrd $TESTDIR/initramfs.testing
 
     if [[ $? -ne 0 ]] || ! grep -F -m 1 -q nbd-OK $TESTDIR/flag.img; then
index 495a66f2be7ad35ef3ab10b173448c6e7fb806df..ff2961dc9d73c9338fe77828a742d62db469f426 100755 (executable)
@@ -23,7 +23,7 @@ run_server() {
         ${SERIAL:--serial file:"$TESTDIR"/server.log} \
         -watchdog i6300esb -watchdog-action poweroff \
         -no-reboot \
-        -append "panic=1 loglevel=7 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0" \
+        -append "panic=1 systemd.crash_reboot loglevel=7 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0" \
         -initrd "$TESTDIR"/initramfs.server \
         -pidfile "$TESTDIR"/server.pid -daemonize || return 1
 
@@ -63,7 +63,7 @@ client_test() {
                       -device e1000,netdev=n2,mac=52:54:00:12:34:99 \
                       -watchdog i6300esb -watchdog-action poweroff \
                       -no-reboot \
-                      -append "panic=1 rd.shell=0 $cmdline $DEBUGFAIL rd.retry=5 ro console=ttyS0,115200n81 selinux=0 init=/sbin/init rd.debug systemd.log_target=console loglevel=7" \
+                      -append "panic=1 systemd.crash_reboot rd.shell=0 $cmdline $DEBUGFAIL rd.retry=5 ro console=ttyS0,115200n81 selinux=0 init=/sbin/init rd.debug systemd.log_target=console loglevel=7" \
                       -initrd "$TESTDIR"/initramfs.testing
 
     { read OK; read IFACES; } < "$TESTDIR"/client.img
index 8c11a7d392d39023625ab63fb900793e5660f731..5618baee3c2b15f111a215623e9177c0639fef1e 100755 (executable)
@@ -31,7 +31,7 @@ run_server() {
         ${SERIAL:--serial file:"$TESTDIR"/server.log} \
         -watchdog i6300esb -watchdog-action poweroff \
         -no-reboot \
-        -append "panic=1 loglevel=7 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0 rd.debug" \
+        -append "panic=1 systemd.crash_reboot loglevel=7 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0 rd.debug" \
         -initrd "$TESTDIR"/initramfs.server \
         -pidfile "$TESTDIR"/server.pid -daemonize || return 1
     chmod 644 -- "$TESTDIR"/server.pid || return 1
@@ -79,7 +79,7 @@ client_test() {
             $nic3 -device e1000,mac=52:54:00:12:34:05,netdev=n3 \
             -watchdog i6300esb -watchdog-action poweroff \
             -no-reboot \
-            -append "panic=1 $cmdline rd.debug $DEBUGFAIL rd.retry=5 rw console=ttyS0,115200n81 selinux=0 init=/sbin/init" \
+            -append "panic=1 systemd.crash_reboot $cmdline rd.debug $DEBUGFAIL rd.retry=5 rw console=ttyS0,115200n81 selinux=0 init=/sbin/init" \
             -initrd "$TESTDIR"/initramfs.testing
     else
         $testdir/run-qemu \
@@ -95,7 +95,7 @@ client_test() {
             -net nic,vlan=3,macaddr=52:54:00:12:34:05,model=e1000 \
             -watchdog i6300esb -watchdog-action poweroff \
             -no-reboot \
-            -append "panic=1 $cmdline rd.debug $DEBUGFAIL rd.retry=5 rw console=ttyS0,115200n81 selinux=0 init=/sbin/init" \
+            -append "panic=1 systemd.crash_reboot $cmdline rd.debug $DEBUGFAIL rd.retry=5 rw console=ttyS0,115200n81 selinux=0 init=/sbin/init" \
             -initrd "$TESTDIR"/initramfs.testing
     fi