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