]> xenbits.xensource.com Git - osstest.git/commitdiff
PDU/IPMI: Be less aggressive with IPMI commands
authorAnthony PERARD <anthony.perard@citrix.com>
Fri, 10 Mar 2023 17:07:21 +0000 (17:07 +0000)
committerAnthony PERARD <anthony.perard@citrix.com>
Wed, 15 Mar 2023 17:49:54 +0000 (17:49 +0000)
The machine rimava0 doesn't power off or power on when we keep doing
"power status" then "power off" ipmi command without waiting.

Currently, osstest does:
    loop
ipmitool power status
ipmitool power off
sleep 1

This loop goes on forever, the machine never change power state.
Adding some wait in between both command works.

While here, test for timeout just after a status check instead of
sending the `power off` command again which we would never check the
result of.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Osstest/PDU/ipmi.pm

index 21c94d98f036d9e585ea6f3dbf0d8490690d1c7e..ce498cb7a0df900437160524e32d3d87f78318b2 100644 (file)
@@ -69,10 +69,10 @@ sub pdu_power_state {
     my $count = 60;
     for (;;) {
         last if $getstatus->() eq $onoff;
+        die "did not power $onoff" unless --$count > 0;
+        sleep(1);
 
        system_checked((@cmd, qw(power), $onoff));
-
-        die "did not power $onoff" unless --$count > 0;
         sleep(1);
     }
 }