| Charles Paul Hofer | 9f74d3a | 2017-08-18 09:54:28 -0500 | [diff] [blame] | 1 | *** Settings *** | 
|  | 2 | Documentation     Update the BMC code on a target BMC. | 
|  | 3 | ...               Execution Method: | 
|  | 4 | ...               python -m robot -v OPENBMC_HOST:<hostname> | 
|  | 5 | ...               -v IMAGE_FILE_PATH:<path/*.tar>  bmc_code_update.robot | 
|  | 6 |  | 
|  | 7 | Library           ../../lib/code_update_utils.py | 
|  | 8 | Variables         ../../data/variables.py | 
|  | 9 | Resource          ../../lib/boot_utils.robot | 
|  | 10 | Resource          code_update_utils.robot | 
|  | 11 | Resource          ../../lib/code_update_utils.robot | 
| George Keishing | 1eb85f5 | 2017-08-30 22:55:13 -0500 | [diff] [blame] | 12 | Resource          ../../lib/openbmc_ffdc.robot | 
|  | 13 | Resource          ../../lib/dump_utils.robot | 
| Charles Paul Hofer | 9f74d3a | 2017-08-18 09:54:28 -0500 | [diff] [blame] | 14 |  | 
| George Keishing | 0071549 | 2017-08-18 11:46:37 -0500 | [diff] [blame] | 15 | Test Teardown     Code Update Test Teardown | 
| Charles Paul Hofer | 9f74d3a | 2017-08-18 09:54:28 -0500 | [diff] [blame] | 16 |  | 
|  | 17 | *** Variables *** | 
|  | 18 |  | 
|  | 19 | ${QUIET}                          ${1} | 
|  | 20 | ${IMAGE_FILE_PATH}                ${EMPTY} | 
| Charles Paul Hofer | c1fa2bc | 2017-08-18 16:44:03 -0500 | [diff] [blame] | 21 | ${ALTERNATE_IMAGE_FILE_PATH}      ${EMPTY} | 
| Charles Paul Hofer | b7842a5 | 2017-09-22 10:11:33 -0500 | [diff] [blame] | 22 | ${SKIP_UPDATE_IF_ACTIVE}          false | 
| Charles Paul Hofer | 9f74d3a | 2017-08-18 09:54:28 -0500 | [diff] [blame] | 23 |  | 
|  | 24 | *** Test Cases *** | 
|  | 25 |  | 
|  | 26 | REST BMC Code Update | 
|  | 27 | [Documentation]  Do a BMC code update by uploading image on BMC via REST. | 
|  | 28 | [Tags]  REST_BMC_Code_Update | 
| George Keishing | 1eb85f5 | 2017-08-30 22:55:13 -0500 | [diff] [blame] | 29 | [Setup]  Code Update Setup | 
| Charles Paul Hofer | 9f74d3a | 2017-08-18 09:54:28 -0500 | [diff] [blame] | 30 |  | 
| Charles Paul Hofer | 2184546 | 2017-09-27 12:40:33 -0500 | [diff] [blame] | 31 | Upload And Activate Image  ${IMAGE_FILE_PATH} | 
|  | 32 | ...  skip_if_active=${SKIP_UPDATE_IF_ACTIVE} | 
| Charles Paul Hofer | 9f74d3a | 2017-08-18 09:54:28 -0500 | [diff] [blame] | 33 | OBMC Reboot (off) | 
|  | 34 |  | 
|  | 35 |  | 
| Charles Paul Hofer | c1fa2bc | 2017-08-18 16:44:03 -0500 | [diff] [blame] | 36 | Upload And Activate Multiple BMC Images | 
|  | 37 | [Documentation]  Upload another BMC image and verify that its state is | 
|  | 38 | ...              different from all others. | 
|  | 39 | [Tags]  Upload_And_Activate_Multiple_BMC_Images | 
|  | 40 | [Template]  Activate Image And Verify No Duplicate Priorities | 
|  | 41 | [Setup]  Upload And Activate Multiple BMC Images Setup | 
|  | 42 |  | 
|  | 43 | # Image File Path              Image Purpose | 
|  | 44 | ${ALTERNATE_IMAGE_FILE_PATH}   ${VERSION_PURPOSE_BMC} | 
|  | 45 |  | 
|  | 46 |  | 
| Charles Paul Hofer | 42f1746 | 2017-09-12 14:09:32 -0500 | [diff] [blame] | 47 | BMC Set Priority To Invalid Values | 
|  | 48 | [Documentation]  Attempt to set the priority of an image to an invalid | 
|  | 49 | ...              value and expect an error. | 
|  | 50 | [Tags]  BMC_Set_Priority_To_Invalid_Values | 
|  | 51 | [Template]  Set Priority To Invalid Value And Expect Error | 
|  | 52 |  | 
|  | 53 | # Version Type              Priority | 
|  | 54 | ${VERSION_PURPOSE_BMC}     ${-1} | 
|  | 55 | ${VERSION_PURPOSE_BMC}     ${256} | 
|  | 56 |  | 
|  | 57 |  | 
| Charles Paul Hofer | 9f74d3a | 2017-08-18 09:54:28 -0500 | [diff] [blame] | 58 | Delete BMC Image | 
|  | 59 | [Documentation]  Delete a BMC image from the BMC flash chip. | 
|  | 60 | [Tags]  Delete_BMC_Image | 
|  | 61 |  | 
|  | 62 | ${software_object}=  Get Non Running BMC Software Object | 
|  | 63 | Delete Image And Verify  ${software_object}  ${VERSION_PURPOSE_BMC} | 
| Charles Paul Hofer | c1fa2bc | 2017-08-18 16:44:03 -0500 | [diff] [blame] | 64 |  | 
|  | 65 |  | 
| George Keishing | 97ecb27 | 2017-09-12 04:30:20 -0500 | [diff] [blame] | 66 | BMC Image Priority Attribute Test | 
|  | 67 | [Documentation]  Set "Priority" attribute. | 
|  | 68 | [Tags]  BMC_Image_Priority_Attribute_Test | 
|  | 69 | [Template]  Temporarily Set BMC Attribute | 
|  | 70 |  | 
|  | 71 | # Property        Value | 
|  | 72 | Priority          ${0} | 
|  | 73 | Priority          ${1} | 
|  | 74 | Priority          ${127} | 
|  | 75 | Priority          ${255} | 
|  | 76 |  | 
|  | 77 |  | 
| Charles Paul Hofer | c1fa2bc | 2017-08-18 16:44:03 -0500 | [diff] [blame] | 78 | *** Keywords *** | 
|  | 79 |  | 
| George Keishing | 97ecb27 | 2017-09-12 04:30:20 -0500 | [diff] [blame] | 80 | Temporarily Set BMC Attribute | 
|  | 81 | [Documentation]  Update the BMC attribute value. | 
|  | 82 | [Arguments]  ${attribute_name}  ${attribute_value} | 
|  | 83 |  | 
|  | 84 | # Description of argument(s): | 
|  | 85 | # attribute_name    BMC software attribute name (e.g. "Priority"). | 
|  | 86 | # attribute_value   Value to be written. | 
|  | 87 |  | 
|  | 88 | ${image_ids}=  Get Software Objects  ${VERSION_PURPOSE_BMC} | 
|  | 89 | ${init_bmc_properties}=  Get Host Software Property  ${image_ids[0]} | 
|  | 90 | ${initial_priority}=  Set Variable  ${init_bmc_properties["Priority"]} | 
|  | 91 |  | 
|  | 92 | Set Host Software Property  ${image_ids[0]}  ${attribute_name} | 
|  | 93 | ...  ${attribute_value} | 
|  | 94 |  | 
|  | 95 | ${cur_bmc_properties}=  Get Host Software Property  ${image_ids[0]} | 
|  | 96 | Should Be Equal As Integers  ${cur_bmc_properties["Priority"]} | 
|  | 97 | ...  ${attribute_value} | 
|  | 98 |  | 
|  | 99 | # Revert to to initial value. | 
|  | 100 | Set Host Software Property | 
|  | 101 | ...  ${image_ids[0]}  ${attribute_name}  ${initial_priority} | 
|  | 102 |  | 
|  | 103 |  | 
| Charles Paul Hofer | c1fa2bc | 2017-08-18 16:44:03 -0500 | [diff] [blame] | 104 | Upload And Activate Multiple BMC Images Setup | 
|  | 105 | [Documentation]  Check that the ALTERNATE_FILE_PATH variable is set. | 
|  | 106 |  | 
| George Keishing | 1eb85f5 | 2017-08-30 22:55:13 -0500 | [diff] [blame] | 107 | Should Not Be Empty  ${ALTERNATE_IMAGE_FILE_PATH} | 
|  | 108 |  | 
|  | 109 | Code Update Setup | 
|  | 110 | [Documentation]  Do code update test case setup. | 
|  | 111 | # - Clean up all existing BMC dumps. | 
|  | 112 |  | 
|  | 113 | Delete All Dumps | 
| George Keishing | 0071549 | 2017-08-18 11:46:37 -0500 | [diff] [blame] | 114 |  | 
|  | 115 | Code Update Test Teardown | 
|  | 116 | [Documentation]  Do code update test case teardown. | 
|  | 117 | # 1. Collect FFDC if test case failed. | 
|  | 118 | # 2. Collect FFDC if test PASS but error log exists. | 
|  | 119 |  | 
|  | 120 | FFDC On Test Case Fail | 
|  | 121 | Run Keyword If  '${TEST_STATUS}' == 'PASS'  Check Error And Collect FFDC |