Power Cycle stress loop test

This is to test where the network service become unavailable during
AC-Cycle stress test. This has been reported earlier from customer
as well.

Resolves openbmc/openbmc-test-automation#167

Change-Id: Ie8ce5a9455e6ee7c7f9478f1a066319352a3a8a3
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/extended/test_powercycle_loop.robot b/extended/test_powercycle_loop.robot
new file mode 100644
index 0000000..786f9c1
--- /dev/null
+++ b/extended/test_powercycle_loop.robot
@@ -0,0 +1,51 @@
+*** Settings ***
+Documentation   Power cycle loop. This is to test where network service
+...             becomes unavailable during AC-Cycle stress test.
+
+Resource        ../lib/rest_client.robot
+Resource        ../lib/pdu/pdu.robot
+Resource        ../lib/utils.robot
+Resource        ../lib/openbmc_ffdc.robot
+
+Test Setup      Validate Parameters
+Test Teardown   Test Exit Logs
+
+*** Variables ***
+${LOOP_COUNT}    ${50}
+
+*** Test Cases ***
+
+Test Power Cycle
+    [Documentation]   By default run test for 50 loops, else user
+    ...               input iteration. Fails immediately if any
+    ...               of the execution rounds fail and checks if
+    ...               BMC is still pinging and FFDC is collected.
+
+    Repeat Keyword    ${LOOP_COUNT} times   BMC Power cycle
+
+
+*** Keywords ***
+
+BMC Power cycle
+    [Documentation]    Power cycle and wait for BMC to come
+    ...                online to BMC_READY state.
+    Log   "Doing power cycle"
+    PDU Power Cycle
+    Check If BMC is Up   5 min    10 sec
+
+    Wait Until Keyword Succeeds
+    ...    10 min   10 sec   Verify BMC State   BMC_READY
+
+
+Test Exit Logs
+    Ping Host  ${OPENBMC_HOST}
+    Log FFDC
+
+
+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}
+