]> git.itanic.dy.fi Git - linux-stable/commitdiff
ktest: Add timeout for ssh sync testing
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Mon, 9 Mar 2020 20:00:11 +0000 (16:00 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Mar 2020 06:19:10 +0000 (07:19 +0100)
commit 4d00fc477a2ce8b6d2b09fb34ef9fe9918e7d434 upstream.

Before rebooting the box, a "ssh sync" is called to the test machine to see
if it is alive or not. But if the test machine is in a partial state, that
ssh may never actually finish, and the ktest test hangs.

Add a 10 second timeout to the sync test, which will fail after 10 seconds
and then cause the test to reboot the test machine.

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 (VMware) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/testing/ktest/ktest.pl

index 220d04f958a628948d62409afc2c3c2ce35d874b..42b6cd41d2ea49345d1fce2a887e6c03fd722b32 100755 (executable)
@@ -1383,7 +1383,7 @@ sub reboot {
 
     } else {
        # Make sure everything has been written to disk
-       run_ssh("sync");
+       run_ssh("sync", 10);
 
        if (defined($time)) {
            start_monitor;