Support new redfish BMC and host state keywords
Changes:
- Keyword to return BMC current state.
- Keyword to return host states (power and boot progress state).
Change-Id: I2efc47bf4b5659c391478097d923430ea050591c
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/state_manager.robot b/lib/state_manager.robot
index e50f1b0..be65195 100755
--- a/lib/state_manager.robot
+++ b/lib/state_manager.robot
@@ -313,3 +313,36 @@
Wait For BMC Ready
[Documentation] Check BMC state and wait for BMC Ready.
Wait Until Keyword Succeeds 10 min 10 sec Is BMC Ready
+
+
+Redfish Get BMC State
+ [Documentation] Return BMC health state.
+
+ # "Enabled" -> BMC Ready, "Starting" -> BMC NotReady
+
+ # Example:
+ # "Status": {
+ # "Health": "OK",
+ # "HealthRollup": "OK",
+ # "State": "Enabled"
+ # },
+
+ ${status}= Redfish.Get Attribute /redfish/v1/Managers/bmc Status
+ [Return] ${status["State"]}
+
+
+Redfish Get Host State
+ [Documentation] Return host power and health state.
+
+ # Refer: http://redfish.dmtf.org/schemas/v1/Resource.json#/definitions/Status
+
+ # Example:
+ # "PowerState": "Off",
+ # "Status": {
+ # "Health": "OK",
+ # "HealthRollup": "OK",
+ # "State": "StandbyOffline"
+ # },
+
+ ${chassis}= Redfish.Get Properties /redfish/v1/Chassis/chassis
+ [Return] ${chassis["PowerState"]} ${chassis["Status"]["State"]}