Jay Azurin | e4c52eb | 2016-08-16 20:51:10 -0500 | [diff] [blame] | 1 | *** Settings *** |
Michael Walsh | abbe68c | 2017-04-12 16:41:56 -0500 | [diff] [blame] | 2 | Documentation Update the PNOR image on the host for hostboot CI purposes. |
Jay Azurin | e4c52eb | 2016-08-16 20:51:10 -0500 | [diff] [blame] | 3 | |
Michael Walsh | abbe68c | 2017-04-12 16:41:56 -0500 | [diff] [blame] | 4 | Library OperatingSystem |
| 5 | Library ../lib/gen_robot_keyword.py |
George Keishing | 42e023a | 2017-01-06 08:13:03 -0600 | [diff] [blame] | 6 | |
Michael Walsh | abbe68c | 2017-04-12 16:41:56 -0500 | [diff] [blame] | 7 | Resource ../extended/obmc_boot_test_resource.robot |
| 8 | Resource ../lib/utils.robot |
| 9 | Resource ../lib/connection_client.robot |
| 10 | Resource ../lib/openbmc_ffdc.robot |
| 11 | Resource ../lib/state_manager.robot |
| 12 | |
Prachi Gupta | 5284328 | 2017-04-21 10:05:47 -0500 | [diff] [blame] | 13 | Test Teardown Test Bios Teardown |
Jay Azurin | e4c52eb | 2016-08-16 20:51:10 -0500 | [diff] [blame] | 14 | |
| 15 | *** Variables *** |
| 16 | |
Michael Walsh | abbe68c | 2017-04-12 16:41:56 -0500 | [diff] [blame] | 17 | ${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 Gupta | 5284328 | 2017-04-21 10:05:47 -0500 | [diff] [blame] | 24 | ${update_status} True |
Michael Walsh | abbe68c | 2017-04-12 16:41:56 -0500 | [diff] [blame] | 25 | |
Jay Azurin | e4c52eb | 2016-08-16 20:51:10 -0500 | [diff] [blame] | 26 | *** Test Cases *** |
| 27 | |
Prachi Gupta | 5284328 | 2017-04-21 10:05:47 -0500 | [diff] [blame] | 28 | Host BIOS Update |
Michael Walsh | abbe68c | 2017-04-12 16:41:56 -0500 | [diff] [blame] | 29 | [Documentation] Update PNOR image and verify. |
Prachi Gupta | 5284328 | 2017-04-21 10:05:47 -0500 | [diff] [blame] | 30 | [Tags] Host_BIOS_Update open-power |
George Keishing | 42e023a | 2017-01-06 08:13:03 -0600 | [diff] [blame] | 31 | |
| 32 | Validate Parameters |
| 33 | Prepare BMC For Update |
Jay Azurin | e4c52eb | 2016-08-16 20:51:10 -0500 | [diff] [blame] | 34 | Update PNOR Image |
Jay Azurin | e4c52eb | 2016-08-16 20:51:10 -0500 | [diff] [blame] | 35 | |
Prachi Gupta | 5284328 | 2017-04-21 10:05:47 -0500 | [diff] [blame] | 36 | Host 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 Azurin | e4c52eb | 2016-08-16 20:51:10 -0500 | [diff] [blame] | 42 | *** Keywords *** |
| 43 | |
George Keishing | 42e023a | 2017-01-06 08:13:03 -0600 | [diff] [blame] | 44 | Prepare BMC For Update |
| 45 | [Documentation] Prepare system for PNOR update. |
| 46 | |
Michael Walsh | abbe68c | 2017-04-12 16:41:56 -0500 | [diff] [blame] | 47 | # Call 'OBMC Boot Test' to do a 'REST Power Off', if needed. |
| 48 | Run Key U OBMC Boot Test \ REST Power Off |
Michael Walsh | abbe68c | 2017-04-12 16:41:56 -0500 | [diff] [blame] | 49 | Run Key Clear BMC Record Log |
George Keishing | 42e023a | 2017-01-06 08:13:03 -0600 | [diff] [blame] | 50 | |
Jay Azurin | e4c52eb | 2016-08-16 20:51:10 -0500 | [diff] [blame] | 51 | Update PNOR Image |
| 52 | [Documentation] Copy the PNOR image to the BMC /tmp dir and flash it. |
George Keishing | 42e023a | 2017-01-06 08:13:03 -0600 | [diff] [blame] | 53 | |
Michael Walsh | abbe68c | 2017-04-12 16:41:56 -0500 | [diff] [blame] | 54 | 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 Azurin | e4c52eb | 2016-08-16 20:51:10 -0500 | [diff] [blame] | 58 | |
Prachi Gupta | 5284328 | 2017-04-21 10:05:47 -0500 | [diff] [blame] | 59 | Validate Power On |
| 60 | [Documentation] Power the host on, and validate that the sytem booted. |
| 61 | [Teardown] Validate Power On Teardown |
George Keishing | 42e023a | 2017-01-06 08:13:03 -0600 | [diff] [blame] | 62 | |
Prachi Gupta | 5284328 | 2017-04-21 10:05:47 -0500 | [diff] [blame] | 63 | # 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 Keishing | 42e023a | 2017-01-06 08:13:03 -0600 | [diff] [blame] | 67 | |
Prachi Gupta | 5284328 | 2017-04-21 10:05:47 -0500 | [diff] [blame] | 68 | Validate Power On Teardown |
| 69 | [Documentation] Teardown after Validate Power On. |
Jay Azurin | e4c52eb | 2016-08-16 20:51:10 -0500 | [diff] [blame] | 70 | |
Prachi Gupta | 5284328 | 2017-04-21 10:05:47 -0500 | [diff] [blame] | 71 | ${keyword_buf}= Catenate Stop SOL Console Logging |
| 72 | ... \ targ_file_path=${EXECDIR}${/}logs${/}SOL.log |
| 73 | Run Key ${keyword_buf} |
Jay Azurin | e4c52eb | 2016-08-16 20:51:10 -0500 | [diff] [blame] | 74 | |
Prachi Gupta | 5284328 | 2017-04-21 10:05:47 -0500 | [diff] [blame] | 75 | Test 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 Keishing | 42e023a | 2017-01-06 08:13:03 -0600 | [diff] [blame] | 81 | |
| 82 | Validate 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 | |