blob: 6d3c0fdcee87925aa1630c05dceefccef13cbf7f [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${pflash_cmd} /usr/sbin/pflash -r /dev/stdout -P VERSION
27
Jay Azurine4c52eb2016-08-16 20:51:10 -050028*** Test Cases ***
29
Prachi Gupta52843282017-04-21 10:05:47 -050030Host BIOS Update
Michael Walshabbe68c2017-04-12 16:41:56 -050031 [Documentation] Update PNOR image and verify.
Prachi Gupta52843282017-04-21 10:05:47 -050032 [Tags] Host_BIOS_Update open-power
George Keishing42e023a2017-01-06 08:13:03 -060033
34 Validate Parameters
35 Prepare BMC For Update
Jay Azurine4c52eb2016-08-16 20:51:10 -050036 Update PNOR Image
George Keishinga0a13122017-05-18 12:51:09 -050037 Verify PNOR Update
Jay Azurine4c52eb2016-08-16 20:51:10 -050038
Prachi Gupta52843282017-04-21 10:05:47 -050039Host BIOS Power On
40 [Documentation] Power On the system and wait for OS
41 [Tags] Host_BIOS_Power_On open-power
42
43 Run Keyword If '${PREV_TEST_STATUS}' == 'PASS' Validate Power On
44
Jay Azurine4c52eb2016-08-16 20:51:10 -050045*** Keywords ***
46
George Keishinga0a13122017-05-18 12:51:09 -050047Verify PNOR Update
48 [Documentation] Verify that the PNOR is not corrupted.
49 # Example:
50 # FFS: Flash header not found. Code: 100
51 # Error 100 opening ffs !
52
53 Open Connection And Log In
54 ${pnor_info}= Execute Command On BMC ${pflash_cmd}
55 Should Not Contain Any ${pnor_info} Flash header not found Error
56
George Keishing42e023a2017-01-06 08:13:03 -060057Prepare BMC For Update
58 [Documentation] Prepare system for PNOR update.
59
Michael Walshabbe68c2017-04-12 16:41:56 -050060 # Call 'OBMC Boot Test' to do a 'REST Power Off', if needed.
61 Run Key U OBMC Boot Test \ REST Power Off
George Keishing81ae14c2017-06-05 14:02:15 -050062 Run Key Delete Error logs
George Keishing42e023a2017-01-06 08:13:03 -060063
Jay Azurine4c52eb2016-08-16 20:51:10 -050064Update PNOR Image
65 [Documentation] Copy the PNOR image to the BMC /tmp dir and flash it.
George Keishing42e023a2017-01-06 08:13:03 -060066
Michael Walshabbe68c2017-04-12 16:41:56 -050067 Run Key Copy PNOR to BMC
68 ${pnor_path} ${pnor_basename}= Split Path ${PNOR_IMAGE_PATH}
69 Run Key Flash PNOR \ /tmp/${pnor_basename}
70 Run Key Wait Until Keyword Succeeds \ 7 min \ 10 sec \ Is PNOR Flash Done
Jay Azurine4c52eb2016-08-16 20:51:10 -050071
Prachi Gupta52843282017-04-21 10:05:47 -050072Validate Power On
73 [Documentation] Power the host on, and validate that the sytem booted.
74 [Teardown] Validate Power On Teardown
George Keishing42e023a2017-01-06 08:13:03 -060075
Prachi Gupta52843282017-04-21 10:05:47 -050076 # Have to start SOL logging here. Starting SOL in test setup closes the
77 # connection when bmc reboots.
78 Run Key Start SOL Console Logging
79 Run Key U OBMC Boot Test \ REST Power On
George Keishing42e023a2017-01-06 08:13:03 -060080
Prachi Gupta52843282017-04-21 10:05:47 -050081Validate Power On Teardown
82 [Documentation] Teardown after Validate Power On.
Jay Azurine4c52eb2016-08-16 20:51:10 -050083
Prachi Gupta52843282017-04-21 10:05:47 -050084 ${keyword_buf}= Catenate Stop SOL Console Logging
85 ... \ targ_file_path=${EXECDIR}${/}logs${/}SOL.log
86 Run Key ${keyword_buf}
Jay Azurine4c52eb2016-08-16 20:51:10 -050087
Prachi Gupta52843282017-04-21 10:05:47 -050088Test Bios Teardown
89 [Documentation] Log FFDC if test suite fails and collect SOL log for
90 ... debugging purposes.
91
92 Printn
93 Run Key FFDC On Test Case Fail
George Keishing42e023a2017-01-06 08:13:03 -060094
95Validate Parameters
96 [Documentation] Validate parameter and file existence.
97 Should Not Be Empty
98 ... ${PNOR_IMAGE_PATH} msg=PNOR image path not set
99
100 OperatingSystem.File Should Exist ${PNOR_IMAGE_PATH}
101 ... msg=${PNOR_IMAGE_PATH} File not found
102