ktest.pl: Fix missing "end_monitor" when machine check fails
authorSteven Rostedt <rostedt@goodmis.org>
Wed, 18 Jan 2023 16:31:25 +0000 (11:31 -0500)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Mon, 20 Feb 2023 16:52:27 +0000 (11:52 -0500)
In the "reboot" command, it does a check of the machine to see if it is
still alive with a simple "ssh echo" command. If it fails, it will assume
that a normal "ssh reboot" is not possible and force a power cycle.

In this case, the "start_monitor" is executed, but the "end_monitor" is
not, and this causes the screen will not be given back to the console. That
is, after the test, a "reset" command needs to be performed, as "echo" is
turned off.

Cc: stable@vger.kernel.org
Fixes: 6474ace999edd ("ktest.pl: Powercycle the box on reboot if no connection can be made")
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
tools/testing/ktest/ktest.pl

index ac59999ed3ded81131f1f1c0911cf0acce7c989c..62823a4232abb584b87f710bf5c765829982179e 100755 (executable)
@@ -1495,7 +1495,8 @@ sub reboot {
 
        # Still need to wait for the reboot to finish
        wait_for_monitor($time, $reboot_success_line);
-
+    }
+    if ($powercycle || $time) {
        end_monitor;
     }
 }