Add support for redfish power policy

Changes:
    - Added redfish power policy to get and set.
    - Added redfish support check for policy in boot path.

Change-Id: I8e4249f82b2169c00a3e02d85f591389e6966730
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/utils.robot b/lib/utils.robot
index 9f6c948..95fdf9e 100755
--- a/lib/utils.robot
+++ b/lib/utils.robot
@@ -353,6 +353,13 @@
     [Return]  ${currentPolicy}
 
 
+Redfish Get Power Restore Policy
+    [Documentation]  Returns the BMC power restore policy.
+
+    ${power_restore_policy}=  Redfish.Get Attribute  /redfish/v1/Systems/system  PowerRestorePolicy
+    [Return]  ${power_restore_policy}
+
+
 Get Auto Reboot
     [Documentation]  Returns auto reboot setting.
     ${setting}=  Read Attribute  ${CONTROL_HOST_URI}/auto_reboot  AutoReboot
@@ -658,6 +665,17 @@
     Write Attribute    ${HOST_SETTING}    power_policy   data=${valueDict}
 
 
+Redfish Set Power Restore Policy
+    [Documentation]   Set the BMC power restore policy.
+    [Arguments]   ${power_restore_policy}
+
+    # Description of argument(s):
+    # power_restore_policy    Power restore policy (e.g. "AlwaysOff", "AlwaysOn", "LastState").
+
+    Redfish.Patch  /redfish/v1/Systems/system  body={"PowerRestorePolicy": "${power_restore_policy}"}
+    ...  valid_status_codes=[${HTTP_OK}, ${HTTP_NO_CONTENT}]
+
+
 Set Auto Reboot
     [Documentation]  Set the given auto reboot setting.
     [Arguments]  ${setting}