Added test cases for IPMI SOL testing.
This change includes:
- Added test case to verify SOL during boot.
- Added test case to verify deactivate non existing SOL.
- Added keyword to get host state via IPMI.
- Added an argument to indicate if we need to wait
for host state.
Resolves openbmc/openbmc-test-automation#602
Change-Id: Ia5e8f98e53e6b1ac3188f554b99bd9a5562cf7a2
Signed-off-by: Rahul Maheshwari <rahulmaheshwari@in.ibm.com>
diff --git a/lib/ipmi_client.robot b/lib/ipmi_client.robot
index 5d61eb8..424f67e 100755
--- a/lib/ipmi_client.robot
+++ b/lib/ipmi_client.robot
@@ -240,14 +240,33 @@
Initiate Host Boot Via External IPMI
[Documentation] Initiate host power on using external IPMI.
+ [Arguments] ${wait}=${1}
+ # Description of argument(s):
+ # wait Indicates that this keyword should wait for host running state.
+
${output}= Run External IPMI Standard Command chassis power on
Should Not Contain ${output} Error
- Wait Until Keyword Succeeds
- ... 10 min 10 sec Is Host Running
+
+ Run Keyword If '${wait}' == '${0}' Return From Keyword
+ Wait Until Keyword Succeeds 10 min 10 sec Is Host Running
Initiate Host PowerOff Via External IPMI
[Documentation] Initiate host power off using external IPMI.
+ [Arguments] ${wait}=${1}
+ # Description of argument(s):
+ # wait Indicates that this keyword should wait for host off state.
+
${output}= Run External IPMI Standard Command chassis power off
Should Not Contain ${output} Error
- Wait Until Keyword Succeeds
- ... 3 min 10 sec Is Host Off
+
+ Run Keyword If '${wait}' == '${0}' Return From Keyword
+ Wait Until Keyword Succeeds 3 min 10 sec Is Host Off
+
+Get Host State Via External IPMI
+ [Documentation] Returns host state using external IPMI.
+
+ ${output}= Run External IPMI Standard Command chassis power status
+ Should Not Contain ${output} Error
+ ${output}= Fetch From Right ${output} ${SPACE}
+
+ [Return] ${output}