Made performance improvements to test_bios_update.robot.

- Added code to call obmc_boot_test with 'REST Power Off' in skip
  mode.  This means that it will only perform the boot if the machine
  is not already at powered off state.
- Added FORCE_UPDATE option to allow caller to skip prep steps such
  as 'Trigger Warm Reset'.

Change-Id: I2808ebd9cf15d079b5956f157c09ffa2f23dac30
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>
diff --git a/extended/test_bios_update.robot b/extended/test_bios_update.robot
index 887f48a..e51cae5 100644
--- a/extended/test_bios_update.robot
+++ b/extended/test_bios_update.robot
@@ -1,23 +1,32 @@
 *** Settings ***
-Documentation     Update the PNOR image on the host for
-...               hostboot CI purposes.
+Documentation  Update the PNOR image on the host for hostboot CI purposes.
 
-Library           OperatingSystem
-Resource          ../lib/utils.robot
-Resource          ../lib/connection_client.robot
-Resource          ../lib/openbmc_ffdc.robot
-Resource          ../lib/state_manager.robot
+Library                 OperatingSystem
+Library                 ../lib/gen_robot_keyword.py
 
-Test Teardown     FFDC On Test Case Fail
+Resource                ../extended/obmc_boot_test_resource.robot
+Resource                ../lib/utils.robot
+Resource                ../lib/connection_client.robot
+Resource                ../lib/openbmc_ffdc.robot
+Resource                ../lib/state_manager.robot
+
+Test Teardown           Run Key  FFDC On Test Case Fail
 
 *** Variables ***
 
+${QUIET}                ${1}
+# OBMC Boot Test failures are not acceptable so we set the threshold to 0.
+${boot_fail_threshold}  ${0}
+# "skip" indicates to OBMC Boot Test that it should only process boot stack
+# items that would change the machine state, i.e. only if the action is
+# needed.
+${stack_mode}           skip
+
 *** Test Cases ***
 
 Host BIOS Update And Boot
-    [Tags]    open-power
-    [Documentation]   Update PNOR image and verify that
-    ...               host boots normally.
+    [Documentation]  Update PNOR image and verify.
+    [Tags]  Host_BIOS_Update_And_Boot  open-power
 
     Validate Parameters
     Prepare BMC For Update
@@ -28,25 +37,18 @@
 Prepare BMC For Update
     [Documentation]  Prepare system for PNOR update.
 
-    Initiate Power Off
+    # Call 'OBMC Boot Test' to do a 'REST Power Off', if needed.
+    Run Key U  OBMC Boot Test \ REST Power Off
 
-    Trigger Warm Reset
-    Check If BMC is Up  20 min  10 sec
-
-    Wait For BMC Ready
-
-    Clear BMC Record Log
-
+    Run Key  Clear BMC Record Log
 
 Update PNOR Image
     [Documentation]  Copy the PNOR image to the BMC /tmp dir and flash it.
 
-    Copy PNOR to BMC
-    ${pnor_path}  ${pnor_basename}=   Split Path    ${PNOR_IMAGE_PATH}
-    Flash PNOR   /tmp/${pnor_basename}
-    Wait Until Keyword Succeeds
-    ...  7 min    10 sec    Is PNOR Flash Done
-
+    Run Key  Copy PNOR to BMC
+    ${pnor_path}  ${pnor_basename}=  Split Path  ${PNOR_IMAGE_PATH}
+    Run Key  Flash PNOR \ /tmp/${pnor_basename}
+    Run Key  Wait Until Keyword Succeeds \ 7 min \ 10 sec \ Is PNOR Flash Done
 
 Validate IPL
     [Documentation]  Power the host on, and validate the IPL.