Add wait option to keywords from lib/state_manager.robot.
Change-Id: Icf3eae68448c1b0f139a3cff0427295914f7cf81
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>
diff --git a/lib/state_manager.robot b/lib/state_manager.robot
index 979c82e..d18c9ea 100755
--- a/lib/state_manager.robot
+++ b/lib/state_manager.robot
@@ -15,20 +15,36 @@
Initiate Host Boot
[Documentation] Initiate host power on.
+ [Arguments] ${wait}=${1}
+
+ # Description of arguments:
+ # wait Indicates that this keyword should wait for host running state.
+
${args}= Create Dictionary data=${HOST_POWERON_TRANS}
Write Attribute
... ${HOST_STATE_URI} RequestedHostTransition data=${args}
+ # Does caller want to wait for status?
+ Run Keyword If '${wait}' == '${0}' Return From Keyword
+
Wait Until Keyword Succeeds
... 10 min 10 sec Is Host Running
Initiate Host PowerOff
[Documentation] Initiate host power off.
+ [Arguments] ${wait}=${1}
+
+ # Description of arguments:
+ # wait Indicates that this keyword should wait for host off state.
+
${args}= Create Dictionary data=${HOST_POWEROFF_TRANS}
Write Attribute
... ${HOST_STATE_URI} RequestedHostTransition data=${args}
+ # Does caller want to wait for status?
+ Run Keyword If '${wait}' == '${0}' Return From Keyword
+
Wait Until Keyword Succeeds
... 3 min 10 sec Is Host Off