]> xenbits.xensource.com Git - people/dariof/osstest.git/commitdiff
TestSupport: replace power_cycle_timeout with power_cycle_sleep
authorIan Campbell <ian.campbell@citrix.com>
Thu, 22 Jan 2015 11:05:06 +0000 (11:05 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Mon, 26 Jan 2015 11:01:25 +0000 (11:01 +0000)
Which does the actual sleep and logs that it is doing so.

Otherwise on a machine which has a longish PowerCycleTime I keep
wondering why osstest has hung...

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Osstest/TestSupport.pm
ts-host-install

index 5ac66e5ffe982f6e90eb5f48b0cd1fd7916b8f10..8d070ab457c02d229dea545be67bfe91c8f9ac4d 100644 (file)
@@ -66,7 +66,7 @@ BEGIN {
 
                       selecthost get_hostflags get_host_property
                       get_host_native_linux_console
-                      power_state power_cycle power_cycle_time
+                      power_state power_cycle power_cycle_sleep
                       serial_fetch_logs
                       propname_massage
          
@@ -712,9 +712,11 @@ sub power_cycle_host_setup ($) {
     $ho->{PowerMethobjs} = $methobjs;
 }
 
-sub power_cycle_time ($) {
+sub power_cycle_sleep ($) {
     my ($ho) = @_;
-    return get_host_property($ho, 'power-cycle-time', 5);
+    my $to = get_host_property($ho, 'power-cycle-time', 5);
+    logm("power-cycle: waiting ${to}s");
+    sleep($to);
 }
 
 sub power_cycle ($) {
@@ -724,7 +726,7 @@ sub power_cycle ($) {
        " possibly shared with other jobs\n"
        if $ho->{SharedMaybeOthers};
     power_state($ho, 0);
-    sleep(power_cycle_time($ho));
+    power_cycle_sleep($ho);
     power_state($ho, 1);
 }
 
index 30f64658ff20ad579e4d177666dabcd329843d75..ae1d228ae644be0f1841eafa3a12727571a1366a 100755 (executable)
@@ -63,7 +63,7 @@ d-i netcfg/get_ipaddress string $ho->{Ip}
 END
 
     setup_pxeboot_firstboot($ps_url);
-    sleep(power_cycle_time($ho));
+    power_cycle_sleep($ho);
 
     my $logtailer= Osstest::Logtailer->new($c{WebspaceLog});
     power_state($ho, 1);