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 | |
George Keishing | a0a1312 | 2017-05-18 12:51:09 -0500 | [diff] [blame] | 26 | ${pflash_cmd} /usr/sbin/pflash -r /dev/stdout -P VERSION |
| 27 | |
Jay Azurin | e4c52eb | 2016-08-16 20:51:10 -0500 | [diff] [blame] | 28 | *** Test Cases *** |
| 29 | |
Prachi Gupta | 5284328 | 2017-04-21 10:05:47 -0500 | [diff] [blame] | 30 | Host BIOS Update |
Michael Walsh | abbe68c | 2017-04-12 16:41:56 -0500 | [diff] [blame] | 31 | [Documentation] Update PNOR image and verify. |
Prachi Gupta | 5284328 | 2017-04-21 10:05:47 -0500 | [diff] [blame] | 32 | [Tags] Host_BIOS_Update open-power |
George Keishing | 42e023a | 2017-01-06 08:13:03 -0600 | [diff] [blame] | 33 | |
| 34 | Validate Parameters |
| 35 | Prepare BMC For Update |
Jay Azurin | e4c52eb | 2016-08-16 20:51:10 -0500 | [diff] [blame] | 36 | Update PNOR Image |
George Keishing | a0a1312 | 2017-05-18 12:51:09 -0500 | [diff] [blame] | 37 | Verify PNOR Update |
Jay Azurin | e4c52eb | 2016-08-16 20:51:10 -0500 | [diff] [blame] | 38 | |
Prachi Gupta | 5284328 | 2017-04-21 10:05:47 -0500 | [diff] [blame] | 39 | Host 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 Azurin | e4c52eb | 2016-08-16 20:51:10 -0500 | [diff] [blame] | 45 | *** Keywords *** |
| 46 | |
George Keishing | a0a1312 | 2017-05-18 12:51:09 -0500 | [diff] [blame] | 47 | Verify 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 Keishing | 42e023a | 2017-01-06 08:13:03 -0600 | [diff] [blame] | 57 | Prepare BMC For Update |
| 58 | [Documentation] Prepare system for PNOR update. |
| 59 | |
Michael Walsh | abbe68c | 2017-04-12 16:41:56 -0500 | [diff] [blame] | 60 | # Call 'OBMC Boot Test' to do a 'REST Power Off', if needed. |
| 61 | Run Key U OBMC Boot Test \ REST Power Off |
Michael Walsh | abbe68c | 2017-04-12 16:41:56 -0500 | [diff] [blame] | 62 | Run Key Clear BMC Record Log |
George Keishing | 42e023a | 2017-01-06 08:13:03 -0600 | [diff] [blame] | 63 | |
Jay Azurin | e4c52eb | 2016-08-16 20:51:10 -0500 | [diff] [blame] | 64 | Update PNOR Image |
| 65 | [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] | 66 | |
Michael Walsh | abbe68c | 2017-04-12 16:41:56 -0500 | [diff] [blame] | 67 | 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 Azurin | e4c52eb | 2016-08-16 20:51:10 -0500 | [diff] [blame] | 71 | |
Prachi Gupta | 5284328 | 2017-04-21 10:05:47 -0500 | [diff] [blame] | 72 | Validate Power On |
| 73 | [Documentation] Power the host on, and validate that the sytem booted. |
| 74 | [Teardown] Validate Power On Teardown |
George Keishing | 42e023a | 2017-01-06 08:13:03 -0600 | [diff] [blame] | 75 | |
Prachi Gupta | 5284328 | 2017-04-21 10:05:47 -0500 | [diff] [blame] | 76 | # 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 Keishing | 42e023a | 2017-01-06 08:13:03 -0600 | [diff] [blame] | 80 | |
Prachi Gupta | 5284328 | 2017-04-21 10:05:47 -0500 | [diff] [blame] | 81 | Validate Power On Teardown |
| 82 | [Documentation] Teardown after Validate Power On. |
Jay Azurin | e4c52eb | 2016-08-16 20:51:10 -0500 | [diff] [blame] | 83 | |
Prachi Gupta | 5284328 | 2017-04-21 10:05:47 -0500 | [diff] [blame] | 84 | ${keyword_buf}= Catenate Stop SOL Console Logging |
| 85 | ... \ targ_file_path=${EXECDIR}${/}logs${/}SOL.log |
| 86 | Run Key ${keyword_buf} |
Jay Azurin | e4c52eb | 2016-08-16 20:51:10 -0500 | [diff] [blame] | 87 | |
Prachi Gupta | 5284328 | 2017-04-21 10:05:47 -0500 | [diff] [blame] | 88 | Test 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 Keishing | 42e023a | 2017-01-06 08:13:03 -0600 | [diff] [blame] | 94 | |
| 95 | Validate 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 | |