Add wait state for OCC disabled

Change-Id: I60dd2dc90a7b7290504fe7cb44d8c41fa2c3ae1e
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/open_power_utils.robot b/lib/open_power_utils.robot
index 7a59b82..2a097e0 100644
--- a/lib/open_power_utils.robot
+++ b/lib/open_power_utils.robot
@@ -286,10 +286,20 @@
 
     ${cmd_output}  ${stderr}  ${rc} =  BMC Execute Command  ${cmd}  print_out=1  print_err=1
 
-    Sleep  5s
+    Log To Console  OCC wait check for disabled state.
+    Wait Until Keyword Succeeds  30 sec  5 sec  Verify OCC Target State  ${occ_target}
+
+
+Verify OCC Target State
+    [Documentation]  Verify that the user given state matches th current OCC state.
+    [Arguments]  ${occ_target}=${0}  ${expected_state}=${0}
+
+    # Description of Argument(s):
+    # occ_target       Target a valid given OCC number 0,1, etc.
+    # expected_state   For OCC either 0 or 1. Default is 0.
 
     ${occ_active}=  Get OCC Active State  ${occ_target}
-    Should Be Equal  ${occ_active}  ${0}
+    Should Be Equal  ${occ_active}  ${expected_state}
     Log To Console  Target OCC ${occ_target} state is ${occ_active}.