blob: ecb9751660ddbb17fdaa16bf8a814c1fd29dbb75 [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
15*** Variables ***
16
Michael Walshabbe68c2017-04-12 16:41:56 -050017${QUIET} ${1}
18# OBMC Boot Test failures are not acceptable so we set the threshold to 0.
19${boot_fail_threshold} ${0}
20# "skip" indicates to OBMC Boot Test that it should only process boot stack
21# items that would change the machine state, i.e. only if the action is
22# needed.
23${stack_mode} skip
Prachi Gupta52843282017-04-21 10:05:47 -050024${update_status} True
Michael Walshabbe68c2017-04-12 16:41:56 -050025
George Keishinga0a13122017-05-18 12:51:09 -050026
Jay Azurine4c52eb2016-08-16 20:51:10 -050027*** Test Cases ***
28
Prachi Gupta52843282017-04-21 10:05:47 -050029Host BIOS Update
Michael Walshabbe68c2017-04-12 16:41:56 -050030 [Documentation] Update PNOR image and verify.
Prachi Gupta52843282017-04-21 10:05:47 -050031 [Tags] Host_BIOS_Update open-power
George Keishing42e023a2017-01-06 08:13:03 -060032
33 Validate Parameters
34 Prepare BMC For Update
Jay Azurine4c52eb2016-08-16 20:51:10 -050035 Update PNOR Image
George Keishinga0a13122017-05-18 12:51:09 -050036 Verify PNOR Update
Jay Azurine4c52eb2016-08-16 20:51:10 -050037
Prachi Gupta52843282017-04-21 10:05:47 -050038Host BIOS Power On
39 [Documentation] Power On the system and wait for OS
40 [Tags] Host_BIOS_Power_On open-power
41
42 Run Keyword If '${PREV_TEST_STATUS}' == 'PASS' Validate Power On
43
Jay Azurine4c52eb2016-08-16 20:51:10 -050044*** Keywords ***
45
George Keishing42e023a2017-01-06 08:13:03 -060046Prepare BMC For Update
47 [Documentation] Prepare system for PNOR update.
48
Michael Walshabbe68c2017-04-12 16:41:56 -050049 # Call 'OBMC Boot Test' to do a 'REST Power Off', if needed.
50 Run Key U OBMC Boot Test \ REST Power Off
George Keishing81ae14c2017-06-05 14:02:15 -050051 Run Key Delete Error logs
George Keishing42e023a2017-01-06 08:13:03 -060052
Jay Azurine4c52eb2016-08-16 20:51:10 -050053Update PNOR Image
54 [Documentation] Copy the PNOR image to the BMC /tmp dir and flash it.
George Keishing42e023a2017-01-06 08:13:03 -060055
Michael Walshabbe68c2017-04-12 16:41:56 -050056 Run Key Copy PNOR to BMC
57 ${pnor_path} ${pnor_basename}= Split Path ${PNOR_IMAGE_PATH}
58 Run Key Flash PNOR \ /tmp/${pnor_basename}
59 Run Key Wait Until Keyword Succeeds \ 7 min \ 10 sec \ Is PNOR Flash Done
Jay Azurine4c52eb2016-08-16 20:51:10 -050060
Prachi Gupta52843282017-04-21 10:05:47 -050061Validate Power On
62 [Documentation] Power the host on, and validate that the sytem booted.
63 [Teardown] Validate Power On Teardown
George Keishing42e023a2017-01-06 08:13:03 -060064
Prachi Gupta52843282017-04-21 10:05:47 -050065 # Have to start SOL logging here. Starting SOL in test setup closes the
66 # connection when bmc reboots.
67 Run Key Start SOL Console Logging
68 Run Key U OBMC Boot Test \ REST Power On
George Keishing42e023a2017-01-06 08:13:03 -060069
Prachi Gupta52843282017-04-21 10:05:47 -050070Validate Power On Teardown
71 [Documentation] Teardown after Validate Power On.
Jay Azurine4c52eb2016-08-16 20:51:10 -050072
Prachi Gupta52843282017-04-21 10:05:47 -050073 ${keyword_buf}= Catenate Stop SOL Console Logging
74 ... \ targ_file_path=${EXECDIR}${/}logs${/}SOL.log
75 Run Key ${keyword_buf}
Jay Azurine4c52eb2016-08-16 20:51:10 -050076
Prachi Gupta52843282017-04-21 10:05:47 -050077Test Bios Teardown
78 [Documentation] Log FFDC if test suite fails and collect SOL log for
79 ... debugging purposes.
80
81 Printn
82 Run Key FFDC On Test Case Fail
George Keishing42e023a2017-01-06 08:13:03 -060083
84Validate Parameters
85 [Documentation] Validate parameter and file existence.
86 Should Not Be Empty
87 ... ${PNOR_IMAGE_PATH} msg=PNOR image path not set
88
89 OperatingSystem.File Should Exist ${PNOR_IMAGE_PATH}
90 ... msg=${PNOR_IMAGE_PATH} File not found
91