Attempt a fix for the race condition in shutdown. When we ssh to
the box to tell it to shutdown, it can kill our ssh process before
we have time to exit. Kick it into the background with a sleep
first to allow us time to skidaddle.
Signed-off-by: Martin Bligh <mbligh@google.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@893 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/server/hosts/ssh_host.py b/server/hosts/ssh_host.py
index 2662220..e5c3dbc 100644
--- a/server/hosts/ssh_host.py
+++ b/server/hosts/ssh_host.py
@@ -350,7 +350,7 @@
self.bootloader.add_args(label, kernel_args)
print "Reboot: initiating reboot"
sys.stderr.write("REBOOT\n")
- self.run('reboot')
+ self.run('(sleep 5; reboot) >/dev/null 2>&1 &')
if wait:
self._wait_for_restart(timeout)
self.__load_netconsole_module() # if the builtin fails
@@ -618,3 +618,7 @@
fpingcmd = "%s -q %s" % ('/usr/bin/fping', self.hostname)
rc = utils.system(fpingcmd, ignore_status = 1)
return (rc == 0)
+
+
+ def ssh_ping(self):
+ self.run('ls', timeout=30)