Power on test fix

Fixes:
   - Add new keyword "Is OS Off"
   - User can pass the number of cycles to run. By default
     2 cycle for CI/CT
   - Add host boot progress check

Resolves openbmc/openbmc-test-automation#414

Change-Id: I9abcc873acf7afd3ed92067deb53d4058bd9b2b1
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/tests/test_basic_poweron.robot b/tests/test_basic_poweron.robot
index b87f1c0..039decb 100644
--- a/tests/test_basic_poweron.robot
+++ b/tests/test_basic_poweron.robot
@@ -10,14 +10,19 @@
 
 Force Tags  chassisboot
 
+*** Variables ***
+
+# User may pass LOOP_COUNT.
+# By default 2 cycle for CI/CT.
+${LOOP_COUNT}  ${2}
+
 *** Test Cases ***
 
 Power On Test
     [Documentation]  Power off and on.
     [Tags]  Power_On_Test
 
-    Initiate Host PowerOff
-    Initiate Host Boot
+    Repeat Keyword  ${LOOP_COUNT} times  Host Off And On
 
 *** Keywords ***
 
@@ -26,3 +31,12 @@
     FFDC On Test Case Fail
     ${sol_log}=    Stop SOL Console Logging
     Log   ${sol_log}
+
+Host Off And On
+    [Documentation]  Verify power off and on.
+
+    Initiate Host PowerOff
+    Wait Until Keyword Succeeds  5 min  10 sec  Is OS Off
+
+    Initiate Host Boot
+    Wait Until Keyword Succeeds  10 min  10 sec  Is OS Starting