]> xenbits.xensource.com Git - osstest.git/commitdiff
power: ssh: Wait for the target to appear to go down
authorIan Jackson <ian.jackson@eu.citrix.com>
Fri, 25 Jan 2019 12:04:21 +0000 (12:04 +0000)
committerIan Jackson <ian.jackson@eu.citrix.com>
Fri, 25 Jan 2019 17:30:12 +0000 (17:30 +0000)
When we `power on' with the ssh method, we actually run ssh reboot.

On some systems (notably, FreeBSD) the kernel does not simply reboot
immediately even with the runes we provide here, ie for FreeBSD
  reboot -nq
Eg, I have seen reboots with several messages like this:
  Jan 25 14:17:59.100044 Waiting (max 60 seconds) for system thread `bufspacedaemon-2' to stop... done

This can result in the ssh method failing spuriously, because the
`power on' appears to complete while the host is still up in the
previous environment.  In one of my test runs I saw an ssh to the host
succeed, and print the uptime (of the existing environment), between
the reboot command being issued and the host actually rebooting.

So, wait (up to just over a minute) until the host does not respond to
ping.  (target_await_down runs ping -c 5.)

Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Osstest/PDU/ssh.pm

index 16410937154f92b62489d0af84aca21aad97976c..d68d3880564e19be1a1dff47bebcfae9f0bbf627 100644 (file)
@@ -62,7 +62,7 @@ sub pdu_power_state {
  )&
 END
 
-    sleep($delay);
+    target_await_down($mo->{Host}, $delay + 70);
 }
 
 sub instantaneous {