Update power policy from RESTORE_LAST_STATE to ALWAYS_POWER_OFF

ALWAYS_POWER_OFF is the current default policy.

Resolves  openbmc/openbmc-test-automation#1162

Change-Id: I7978afd38c46fb365d7c90cd6d276249cb576cc7
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/extended/code_update/update_bmc.robot b/extended/code_update/update_bmc.robot
index dbdd7d1..b3b05c1 100644
--- a/extended/code_update/update_bmc.robot
+++ b/extended/code_update/update_bmc.robot
@@ -8,7 +8,7 @@
 ...               Update work flow sequence:
 ...                 - User input BMC File existence check
 ...                 - Ping Test and REST authentication
-...                 - Set Host Power host setting Policy to RESTORE_LAST_STATE
+...                 - Set Host Power host setting Policy to ALWAYS_POWER_OFF
 ...                   On reboot this policy would ensure the BMC comes
 ...                   online and stays at HOST_POWERED_OFF state.
 ...                 - Issue poweroff
@@ -82,7 +82,7 @@
     Check Boot Count And Time
     Prune Journal Log
     Power Off Request
-    Set BMC Power Policy  RESTORE_LAST_STATE
+    Set BMC Power Policy  ALWAYS_POWER_OFF
 
     Prepare For Update
     Check If BMC is Up  20 min  10 sec
diff --git a/extended/standby_bmc.robot b/extended/standby_bmc.robot
index 988b6d9..9a5bdb9 100644
--- a/extended/standby_bmc.robot
+++ b/extended/standby_bmc.robot
@@ -7,7 +7,7 @@
 ...                  - Power state is 0 (off)
 ...                  - BMC state is "Ready"
 ...                  - HOST state is "Off"
-...                  - Boot policy is "RESTORE_LAST_STATE"
+...                  - Boot policy is "ALWAYS_POWER_OFF"
 ...               Power cycle system via PDU if specified
 ...               Prune archived journal logs
 
@@ -53,7 +53,7 @@
 
     Prune Journal Log
 
-    Run Keyword And Ignore Error  Set BMC Power Policy  ${RESTORE_LAST_STATE}
+    Run Keyword And Ignore Error  Set BMC Power Policy  ${ALWAYS_POWER_OFF}
 
     # TODO: Enable MAC AES check latter.
     # Reference : openbmc/openbmc-test-automation#998
diff --git a/lib/obmc_boot_test.py b/lib/obmc_boot_test.py
index 35aa86b..0c81a0b 100755
--- a/lib/obmc_boot_test.py
+++ b/lib/obmc_boot_test.py
@@ -350,7 +350,7 @@
 
     grp.rqprint_pgm_header()
 
-    grk.run_key("Set BMC Power Policy  RESTORE_LAST_STATE")
+    grk.run_key("Set BMC Power Policy  ALWAYS_POWER_OFF")
 
     initial_plug_in_setup()
 
diff --git a/lib/state_map.py b/lib/state_map.py
index 0b16d1d..191de65 100644
--- a/lib/state_map.py
+++ b/lib/state_map.py
@@ -32,7 +32,8 @@
         ('ALWAYS_POWER_ON', 'Ready', 'On', 'Off'),
         ('RESTORE_LAST_STATE', 'Ready', 'On', 'Running'),
         ('RESTORE_LAST_STATE', 'Ready', 'On', 'Off'),
-        ('RESTORE_LAST_STATE', 'Ready', 'Off', 'Off'),
+        ('ALWAYS_POWER_OFF', 'Ready', 'On', 'Running'),
+        ('ALWAYS_POWER_OFF', 'Ready', 'Off', 'Off'),
     },
 }
 
diff --git a/lib/utils.py b/lib/utils.py
index bd918c7..df0043b 100644
--- a/lib/utils.py
+++ b/lib/utils.py
@@ -82,7 +82,7 @@
     Using old style functions, callers might call like this with a hard-
     code value for policy:
 
-    Set BMC Power Policy  RESTORE_LAST_STATE
+    Set BMC Power Policy  ALWAYS_POWER_OFF
 
     This function will get the value of the corresponding global variable (if
     it exists) and return it.
diff --git a/lib/utils.robot b/lib/utils.robot
index f25c82c..056e87a 100755
--- a/lib/utils.robot
+++ b/lib/utils.robot
@@ -877,7 +877,7 @@
     [Arguments]   ${policy}
 
     # Description of argument(s):
-    # policy    Power restore policy (e.g. ${RESTORE_LAST_STATE}).
+    # policy    Power restore policy (e.g. ${ALWAYS_POWER_OFF}).
 
     ${valueDict}=  Create Dictionary  data=${policy}
     Write Attribute
@@ -888,7 +888,7 @@
     [Arguments]   ${policy}
 
     # Description of argument(s):
-    # policy    Power restore policy (e.g. "RESTORE_LAST_STATE").
+    # policy    Power restore policy (e.g. "ALWAYS_POWER_OFF").
 
     ${valueDict}=     create dictionary  data=${policy}
     Write Attribute    ${HOST_SETTING}    power_policy   data=${valueDict}
diff --git a/tests/ipmi/test_chassis.robot b/tests/ipmi/test_chassis.robot
index a3736ed..f129078 100755
--- a/tests/ipmi/test_chassis.robot
+++ b/tests/ipmi/test_chassis.robot
@@ -84,6 +84,6 @@
 Test Exit Logs
     [Documentation]    Log FFDC if test failed.
 
-    Set BMC Power Policy  ${RESTORE_LAST_STATE}
+    Set BMC Power Policy  ${ALWAYS_POWER_OFF}
 
     FFDC On Test Case Fail
diff --git a/tests/test_power_restore.robot b/tests/test_power_restore.robot
index 54efb51..ed14153 100644
--- a/tests/test_power_restore.robot
+++ b/tests/test_power_restore.robot
@@ -171,5 +171,5 @@
     [Documentation]  Do the post suite teardown.
     # 1. Set policy to default.
 
-    Run Keyword And Ignore Error  Set BMC Power Policy  ${RESTORE_LAST_STATE}
+    Run Keyword And Ignore Error  Set BMC Power Policy  ${ALWAYS_POWER_OFF}