Keyword to read the redfish boot progress state
Changes:
- New keyword to GET and return the boot progress state.
- Add new keyword to return all the system states.
boot state example:
{
'bmc': 'Enabled',
'chassis': 'Off',
'host': 'Disabled',
'boot_progress': 'None'
}
{
'bmc': 'Enabled',
'chassis': 'On',
'host': 'Enabled',
'boot_progress': 'SystemHardwareInitializationComplete'
}
{
'bmc': 'Enabled',
'chassis': 'On',
'host': 'Enabled',
'boot_progress': 'OSRunning'
}
Change-Id: Ibca7d81eb96933ce338d451858ec5aba417d1906
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/state_manager.robot b/lib/state_manager.robot
index be65195..0e5efdd 100755
--- a/lib/state_manager.robot
+++ b/lib/state_manager.robot
@@ -346,3 +346,33 @@
${chassis}= Redfish.Get Properties /redfish/v1/Chassis/chassis
[Return] ${chassis["PowerState"]} ${chassis["Status"]["State"]}
+
+
+Redfish Get Boot Progress
+ [Documentation] Return boot progress state.
+
+ # Example: /redfish/v1/Systems/system/
+ # "BootProgress": {
+ # "LastState": "OSRunning"
+ # },
+
+ ${boot_progress}= Redfish.Get Properties /redfish/v1/Systems/system/
+ [Return] ${boot_progress["BootProgress"]["LastState"]} ${boot_progress["Status"]["State"]}
+
+
+Redfish Get States
+ [Documentation] Return all the BMC and host states in dictionary.
+
+ # Refer: openbmc/docs/designs/boot-progress.md
+
+ ${bmc_state}= Redfish Get BMC State
+ ${chassis_state} ${chassis_status}= Redfish Get Host State
+ ${boot_progress} ${host_state}= Redfish Get Boot Progress
+
+ ${states}= Create Dictionary
+ ... bmc=${bmc_state}
+ ... chassis=${chassis_state}
+ ... host=${host_state}
+ ... boot_progress=${boot_progress}
+
+ [Return] ${states}