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>
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);
}
}