blob: d8805b7f2ac9005940f842f7d6b14854f025dd28 [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
Jay Azurine4c52eb2016-08-16 20:51:10 -050026*** Test Cases ***
27
Prachi Gupta52843282017-04-21 10:05:47 -050028Host BIOS Update
Michael Walshabbe68c2017-04-12 16:41:56 -050029 [Documentation] Update PNOR image and verify.
Prachi Gupta52843282017-04-21 10:05:47 -050030 [Tags] Host_BIOS_Update open-power
George Keishing42e023a2017-01-06 08:13:03 -060031
32 Validate Parameters
33 Prepare BMC For Update
Jay Azurine4c52eb2016-08-16 20:51:10 -050034 Update PNOR Image
Jay Azurine4c52eb2016-08-16 20:51:10 -050035
Prachi Gupta52843282017-04-21 10:05:47 -050036Host BIOS Power On
37 [Documentation] Power On the system and wait for OS
38 [Tags] Host_BIOS_Power_On open-power
39
40 Run Keyword If '${PREV_TEST_STATUS}' == 'PASS' Validate Power On
41
Jay Azurine4c52eb2016-08-16 20:51:10 -050042*** Keywords ***
43
George Keishing42e023a2017-01-06 08:13:03 -060044Prepare BMC For Update
45 [Documentation] Prepare system for PNOR update.
46
Michael Walshabbe68c2017-04-12 16:41:56 -050047 # Call 'OBMC Boot Test' to do a 'REST Power Off', if needed.
48 Run Key U OBMC Boot Test \ REST Power Off
Michael Walshabbe68c2017-04-12 16:41:56 -050049 Run Key Clear BMC Record Log
George Keishing42e023a2017-01-06 08:13:03 -060050
Jay Azurine4c52eb2016-08-16 20:51:10 -050051Update PNOR Image
52 [Documentation] Copy the PNOR image to the BMC /tmp dir and flash it.
George Keishing42e023a2017-01-06 08:13:03 -060053
Michael Walshabbe68c2017-04-12 16:41:56 -050054 Run Key Copy PNOR to BMC
55 ${pnor_path} ${pnor_basename}= Split Path ${PNOR_IMAGE_PATH}
56 Run Key Flash PNOR \ /tmp/${pnor_basename}
57 Run Key Wait Until Keyword Succeeds \ 7 min \ 10 sec \ Is PNOR Flash Done
Jay Azurine4c52eb2016-08-16 20:51:10 -050058
Prachi Gupta52843282017-04-21 10:05:47 -050059Validate Power On
60 [Documentation] Power the host on, and validate that the sytem booted.
61 [Teardown] Validate Power On Teardown
George Keishing42e023a2017-01-06 08:13:03 -060062
Prachi Gupta52843282017-04-21 10:05:47 -050063 # Have to start SOL logging here. Starting SOL in test setup closes the
64 # connection when bmc reboots.
65 Run Key Start SOL Console Logging
66 Run Key U OBMC Boot Test \ REST Power On
George Keishing42e023a2017-01-06 08:13:03 -060067
Prachi Gupta52843282017-04-21 10:05:47 -050068Validate Power On Teardown
69 [Documentation] Teardown after Validate Power On.
Jay Azurine4c52eb2016-08-16 20:51:10 -050070
Prachi Gupta52843282017-04-21 10:05:47 -050071 ${keyword_buf}= Catenate Stop SOL Console Logging
72 ... \ targ_file_path=${EXECDIR}${/}logs${/}SOL.log
73 Run Key ${keyword_buf}
Jay Azurine4c52eb2016-08-16 20:51:10 -050074
Prachi Gupta52843282017-04-21 10:05:47 -050075Test Bios Teardown
76 [Documentation] Log FFDC if test suite fails and collect SOL log for
77 ... debugging purposes.
78
79 Printn
80 Run Key FFDC On Test Case Fail
George Keishing42e023a2017-01-06 08:13:03 -060081
82Validate Parameters
83 [Documentation] Validate parameter and file existence.
84 Should Not Be Empty
85 ... ${PNOR_IMAGE_PATH} msg=PNOR image path not set
86
87 OperatingSystem.File Should Exist ${PNOR_IMAGE_PATH}
88 ... msg=${PNOR_IMAGE_PATH} File not found
89