Add PDU support for BMC to standby

This support is envisioned for AES and for CI where we would want
to force PDU powercycle as a generic process if specified else a
no-op.

Change-Id: Id9193cee7666876b08967af5b4b5739b33819bfb
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/extended/standby_bmc.robot b/extended/standby_bmc.robot
index 57a9f32..3e17fc0 100644
--- a/extended/standby_bmc.robot
+++ b/extended/standby_bmc.robot
@@ -7,9 +7,11 @@
 ...                  - Power state is 0 (off)
 ...                  - BMC state is "BMC_READY" or "HOST_POWERED_OFF"
 ...                  - Boot policy is "RESTORE_LAST_STATE"
+...               Power cycle system via PDU if specified
 
 Resource          ../lib/boot/boot_resource_master.robot
 Resource          ../lib/utils.robot
+Resource          ../lib/pdu/pdu.robot
 
 *** Variables ***
 ${HOST_SETTING}      /org/openbmc/settings/host0
@@ -18,6 +20,7 @@
 
 Get to Stable State
     [Documentation]    BMC cleanup drive to stable state
+    ...                1. PDU powercycle if specified
     ...                1. Ping Test
     ...                2. SSH Connection session Test
     ...                3. REST Connection session Test
@@ -28,6 +31,8 @@
     ...                7. Update restore policy
     [Tags]  Get to Stable State
 
+    Run Keyword And Ignore Error   Powercycle System Via PDU
+
     Wait For Host To Ping  ${OPENBMC_HOST}  1 mins
     Open Connection And Log In   host=${OPENBMC_HOST}
 
@@ -101,3 +106,19 @@
     Open Connection And Log In
 
     Start Command   /sbin/reboot
+
+
+Powercycle System Via PDU
+    [Documentation]   AC cycle the system via PDU
+
+    Validate Parameters
+    PDU Power Cycle
+    Check If BMC is Up   5 min    10 sec
+
+
+Validate Parameters
+    Should Not Be Empty   ${PDU_IP}
+    Should Not Be Empty   ${PDU_TYPE}
+    Should Not Be Empty   ${PDU_SLOT_NO}
+    Should Not Be Empty   ${PDU_USERNAME}
+    Should Not Be Empty   ${PDU_PASSWORD}