torture: Make kvm-test-1-run-qemu.sh check for reboot loops
authorPaul E. McKenney <paulmck@kernel.org>
Sat, 10 Jul 2021 00:13:34 +0000 (17:13 -0700)
committerPaul E. McKenney <paulmck@kernel.org>
Tue, 27 Jul 2021 18:41:33 +0000 (11:41 -0700)
It turns out that certain types of early boot bugs can result in reboot
loops, even within a guest OS running under qemu/KVM.  This commit
therefore upgrades the kvm-test-1-run-qemu.sh script's hang-detection
heuristics to detect such situations and to terminate the run when
they occur.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
tools/testing/selftests/rcutorture/bin/kvm-test-1-run-qemu.sh

index b412520..4428058 100755 (executable)
@@ -159,9 +159,13 @@ then
                then
                        last_ts=0
                fi
-               if test "$newline" != "$oldline" && test "$last_ts" -lt $((seconds + $TORTURE_SHUTDOWN_GRACE))
+               if test "$newline" != "$oldline" && test "$last_ts" -lt $((seconds + $TORTURE_SHUTDOWN_GRACE)) && test "$last_ts" -gt "$TORTURE_SHUTDOWN_GRACE"
                then
                        must_continue=yes
+                       if test $kruntime -ge $((seconds + $TORTURE_SHUTDOWN_GRACE))
+                       then
+                               echo Continuing at console.log time $last_ts \"`tail -n 1 $resdir/console.log`\" `date`
+                       fi
                fi
                if test $must_continue = no && test $kruntime -ge $((seconds + $TORTURE_SHUTDOWN_GRACE))
                then