blob: 1b4305cd516fe64a39a3c25f0d07ed11f2b6d333 [file] [log] [blame]
Jay Azurine4c52eb2016-08-16 20:51:10 -05001*** Settings ***
Michael Walshabbe68c2017-04-12 16:41:56 -05002Documentation Update the PNOR image on the host for hostboot CI purposes.
Jay Azurine4c52eb2016-08-16 20:51:10 -05003
Michael Walshabbe68c2017-04-12 16:41:56 -05004Library OperatingSystem
5Library ../lib/gen_robot_keyword.py
George Keishing42e023a2017-01-06 08:13:03 -06006
Michael Walshabbe68c2017-04-12 16:41:56 -05007Resource ../extended/obmc_boot_test_resource.robot
8Resource ../lib/utils.robot
9Resource ../lib/connection_client.robot
10Resource ../lib/openbmc_ffdc.robot
11Resource ../lib/state_manager.robot
12
Prachi Gupta52843282017-04-21 10:05:47 -050013Test Teardown Test Bios Teardown
Jay Azurine4c52eb2016-08-16 20:51:10 -050014
Sweta Potthurib2c50f12017-06-28 03:53:30 -050015Force Tags BIOS_Code_Update
Sweta Potthuri5db43e42017-06-15 05:36:44 -050016
Jay Azurine4c52eb2016-08-16 20:51:10 -050017*** Variables ***
18
Michael Walshabbe68c2017-04-12 16:41:56 -050019${QUIET} ${1}
20# OBMC Boot Test failures are not acceptable so we set the threshold to 0.
21${boot_fail_threshold} ${0}
22# "skip" indicates to OBMC Boot Test that it should only process boot stack
23# items that would change the machine state, i.e. only if the action is
24# needed.
25${stack_mode} skip
Prachi Gupta52843282017-04-21 10:05:47 -050026${update_status} True
Michael Walshabbe68c2017-04-12 16:41:56 -050027
George Keishinga0a13122017-05-18 12:51:09 -050028
Jay Azurine4c52eb2016-08-16 20:51:10 -050029*** Test Cases ***
30
Prachi Gupta52843282017-04-21 10:05:47 -050031Host BIOS Update
Michael Walshabbe68c2017-04-12 16:41:56 -050032 [Documentation] Update PNOR image and verify.
Prachi Gupta52843282017-04-21 10:05:47 -050033 [Tags] Host_BIOS_Update open-power
George Keishing42e023a2017-01-06 08:13:03 -060034
35 Validate Parameters
36 Prepare BMC For Update
Jay Azurine4c52eb2016-08-16 20:51:10 -050037 Update PNOR Image
George Keishinga0a13122017-05-18 12:51:09 -050038 Verify PNOR Update
Jay Azurine4c52eb2016-08-16 20:51:10 -050039
Prachi Gupta52843282017-04-21 10:05:47 -050040Host BIOS Power On
41 [Documentation] Power On the system and wait for OS
42 [Tags] Host_BIOS_Power_On open-power
43
44 Run Keyword If '${PREV_TEST_STATUS}' == 'PASS' Validate Power On
45
Jay Azurine4c52eb2016-08-16 20:51:10 -050046*** Keywords ***
47
George Keishing42e023a2017-01-06 08:13:03 -060048Prepare BMC For Update
49 [Documentation] Prepare system for PNOR update.
50
Michael Walshabbe68c2017-04-12 16:41:56 -050051 # Call 'OBMC Boot Test' to do a 'REST Power Off', if needed.
52 Run Key U OBMC Boot Test \ REST Power Off
George Keishing81ae14c2017-06-05 14:02:15 -050053 Run Key Delete Error logs
George Keishing42e023a2017-01-06 08:13:03 -060054
Jay Azurine4c52eb2016-08-16 20:51:10 -050055Update PNOR Image
56 [Documentation] Copy the PNOR image to the BMC /tmp dir and flash it.
George Keishing42e023a2017-01-06 08:13:03 -060057
Michael Walshabbe68c2017-04-12 16:41:56 -050058 Run Key Copy PNOR to BMC
59 ${pnor_path} ${pnor_basename}= Split Path ${PNOR_IMAGE_PATH}
60 Run Key Flash PNOR \ /tmp/${pnor_basename}
61 Run Key Wait Until Keyword Succeeds \ 7 min \ 10 sec \ Is PNOR Flash Done
Jay Azurine4c52eb2016-08-16 20:51:10 -050062
Prachi Gupta52843282017-04-21 10:05:47 -050063Validate Power On
64 [Documentation] Power the host on, and validate that the sytem booted.
65 [Teardown] Validate Power On Teardown
George Keishing42e023a2017-01-06 08:13:03 -060066
Prachi Gupta52843282017-04-21 10:05:47 -050067 # Have to start SOL logging here. Starting SOL in test setup closes the
68 # connection when bmc reboots.
69 Run Key Start SOL Console Logging
70 Run Key U OBMC Boot Test \ REST Power On
George Keishing42e023a2017-01-06 08:13:03 -060071
Prachi Gupta52843282017-04-21 10:05:47 -050072Validate Power On Teardown
73 [Documentation] Teardown after Validate Power On.
Jay Azurine4c52eb2016-08-16 20:51:10 -050074
Prachi Gupta52843282017-04-21 10:05:47 -050075 ${keyword_buf}= Catenate Stop SOL Console Logging
76 ... \ targ_file_path=${EXECDIR}${/}logs${/}SOL.log
77 Run Key ${keyword_buf}
Jay Azurine4c52eb2016-08-16 20:51:10 -050078
Prachi Gupta52843282017-04-21 10:05:47 -050079Test Bios Teardown
80 [Documentation] Log FFDC if test suite fails and collect SOL log for
81 ... debugging purposes.
82
83 Printn
84 Run Key FFDC On Test Case Fail
George Keishing42e023a2017-01-06 08:13:03 -060085
86Validate Parameters
87 [Documentation] Validate parameter and file existence.
88 Should Not Be Empty
89 ... ${PNOR_IMAGE_PATH} msg=PNOR image path not set
90
91 OperatingSystem.File Should Exist ${PNOR_IMAGE_PATH}
92 ... msg=${PNOR_IMAGE_PATH} File not found
93