]> xenbits.xensource.com Git - people/royger/osstest.git/commitdiff
PDU::pause: Better pause time configuration
authorIan Jackson <ian.jackson@eu.citrix.com>
Mon, 2 Jul 2018 15:39:47 +0000 (15:39 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Wed, 4 Jul 2018 15:42:46 +0000 (16:42 +0100)
If no time is specified, use 120 (or the PowerOnTime host property
value) when powering on, or 10 when powering off.

This is all intended to be used like this:
  HostProp_rimava0_PowerMethod nest; msw --apc6 pdu2 19; pause; ipmi rimava0m

This means:
  * For power on, first turn on the APC PDU pdu2 port 19
  * Wait 120s (or HostProp_rimava0_PowerOnTime)
  * Then ipmi to the host name rimava0m with ADMIN/ADMIN
    (or HostProp_rimava0_IpmiUser/HostProp_rimava0_IpmiPassword)
  * For power off, do that in reverse, only with a 10s pause.

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

index b1160c08813529438c6c7420bf28dc707dae5d0e..9e839c6e97eee0b6aa24ff75cacb6b24ee4f8fc7 100644 (file)
@@ -36,6 +36,11 @@ BEGIN {
 
 sub new {
     my ($class, $ho, $methname, $on, $off) = @_;
+    if (!defined $on) {
+        $on = get_host_property($ho, 'PowerOnTime', 120);
+        $off = 10;
+    }
+    $off //= $on;
     return bless [ $off, $on ], $class;
 }
 
index 004e6448f5ad72262651bf611cdc56357b0ca3a4..ea546011c63db0ad6bde62dfdc51be8521cd8f2c 100644 (file)
@@ -924,7 +924,7 @@ sub power_cycle_host_setup ($) {
             push @$methobjs, $meth;
         } elsif ($meth =~ m{^(\d+)(?:/(\d+))$}) {
             require Osstest::PDU::pause;
-            push @$methobjs, new Osstest::PDU::pause $ho, 'pause', $1, $2//$1;
+            push @$methobjs, new Osstest::PDU::pause $ho, 'pause', $1, $2;
         } else {
             push @$methobjs, get_host_method_object($ho,'PDU',$meth);
         }