Redfish v1 boot state mapping update for boot table JSON

Changes:
      - Update boot table to redfish mapping state
      - Added GET current active session info for reference

Change-Id: I3f59919485cddbf2f272845d652443133da1efce
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/utils.robot b/lib/utils.robot
index 61497fc..c9e6065 100755
--- a/lib/utils.robot
+++ b/lib/utils.robot
@@ -691,12 +691,10 @@
     ...                    1=RetryAttempts
     ...                    0=Disabled
 
-    Run Keyword If  ${REDFISH_SUPPORTED} == ${FALSE}
-    ...    Set Auto Reboot  ${value}
-    ...  ELSE IF  ${REDFISH_REST_SUPPORTED} == ${TRUE}
-    ...    Set Auto Reboot  ${value}
-    ...  ELSE
+    Run Keyword If  ${REDFISH_SUPPORT_TRANS_STATE} == ${1}
     ...    Redfish Set Auto Reboot  ${rest_redfish_dict["${value}"]}
+    ...  ELSE
+    ...    Set Auto Reboot  ${value}
 
 Set Auto Reboot
     [Documentation]  Set the given auto reboot setting.
@@ -822,3 +820,71 @@
     ${resp}=  Redfish.Get Attribute  /redfish/v1/Systems/system  Boot
     Should Be Equal As Strings  ${resp["BootSourceOverrideEnabled"]}  ${override_enabled}
     Should Be Equal As Strings  ${resp["BootSourceOverrideTarget"]}  ${override_target}
+
+
+# Redfish state keywords.
+
+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"]}
+
+
+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
+
+    ${session_info}=  Redfish.Get Session Info
+    Log  ${session_info}
+
+    ${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}