]> xenbits.xensource.com Git - osstest.git/commitdiff
power: Try rebooting hosts with ssh first
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 22 Jan 2019 14:44:57 +0000 (14:44 +0000)
committerIan Jackson <ian.jackson@eu.citrix.com>
Thu, 24 Jan 2019 18:35:42 +0000 (18:35 +0000)
Before we try anything with IPMI (if provided) or the PDU, try
rebooting with ssh.

I think this will dramatically reduce the rate at which we power cycle
our test hosts.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Osstest/TestSupport.pm

index c3b2fb7ba18f825f61672e05ba9dae7c873f781c..8101b739389bd4bb0527526fc155d94e576f2256 100644 (file)
@@ -992,8 +992,12 @@ sub power_reboot_attempts ($$$) {
     # to work.  $setup and $await should tolerate this situation; in
     # particular $await must only succeed if the host really did reboot
     # into the boot environment that $await expects.
-    foreach my $approach (@{ $ho->{PowerApproaches} }) {
-       logm("power: rebooting $ho->{Name} (using $approach->{Name})");
+    my $ssh = {
+       Name => 'SSH',
+       MethObjs => power_cycle_parse_method($ho, 'ssh'),
+    };
+    foreach my $approach ($ssh, @{ $ho->{PowerApproaches} }) {
+       logm("power: trying to reboot $ho->{Name} (using $approach->{Name})");
        if (eval {
            power_approach_invoke($ho, $approach, 0);
            $setup->();