Sushil Singh | c08932e | 2019-09-10 15:23:10 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Redfish BMC/Host signed and unsigned code update |
| 3 | ... over BMC functional signed image. |
| 4 | |
| 5 | # Test Parameters: |
| 6 | # IMAGE_FILE_PATH The path to the BMC/Host image file. |
| 7 | # |
| 8 | # Firmware update states: |
| 9 | # Enabled Image is installed and either functional or active. |
| 10 | # Disabled Image installation failed or ready for activation. |
| 11 | # Updating Image installation currently in progress. |
| 12 | |
| 13 | Resource ../../lib/resource.robot |
| 14 | Resource ../../lib/bmc_redfish_resource.robot |
| 15 | Resource ../../lib/openbmc_ffdc.robot |
| 16 | Resource ../../lib/common_utils.robot |
| 17 | Resource ../../lib/code_update_utils.robot |
| 18 | Resource ../../lib/redfish_code_update_utils.robot |
| 19 | Resource ../../extended/code_update/update_bmc.robot |
| 20 | Library ../../lib/gen_robot_valid.py |
| 21 | Library ../../lib/var_funcs.py |
| 22 | |
| 23 | Suite Setup Suite Setup Execution |
| 24 | Suite Teardown Redfish.Logout |
| 25 | Test Setup Printn |
| 26 | Test Teardown FFDC On Test Case Fail |
| 27 | |
| 28 | *** Test Cases *** |
| 29 | |
| 30 | Redfish Signed Code Update |
| 31 | [Documentation] BMC/Host signed code update over functional signed |
| 32 | ... image, when FieldMode is set to true value. |
| 33 | [Tags] Redfish_Signed_Code_Update |
| 34 | [Template] Redfish Signed Firmware Update |
| 35 | |
| 36 | # image_file_path |
| 37 | ${IMAGE_FILE_PATH} |
| 38 | |
| 39 | |
| 40 | Redfish Fail Unsigned Code Update |
| 41 | [Documentation] BMC/Host unsigned code update over functional signed |
| 42 | ... image, when Field Mode is set to true to value. |
| 43 | [Tags] Redfish_Fail_Unsigned_Code_Update |
| 44 | [Template] Redfish Unsigned Firmware Update |
| 45 | |
| 46 | # image_file_path |
| 47 | ${IMAGE_FILE_PATH} |
| 48 | |
| 49 | |
| 50 | *** Keywords *** |
| 51 | |
| 52 | Suite Setup Execution |
| 53 | [Documentation] Do the suite setup. |
| 54 | |
| 55 | Valid File Path IMAGE_FILE_PATH |
| 56 | Redfish.Login |
| 57 | Delete All BMC Dump |
| 58 | Redfish Purge Event Log |
| 59 | |
| 60 | |
| 61 | Redfish Signed Firmware Update |
| 62 | [Documentation] Update the BMC/Host firmware via redfish interface. |
| 63 | [Arguments] ${image_file_path} |
| 64 | |
| 65 | # Description of argument(s): |
| 66 | # IMAGE_FILE_PATH The path to the image file. |
| 67 | |
| 68 | Field Mode Should Be Enabled |
| 69 | ${image_version}= Get Version Tar ${image_file_path} |
| 70 | ${state}= Get Pre Reboot State |
| 71 | Rprint Vars state |
| 72 | Redfish Upload Image And Check Progress State Immediate |
| 73 | ${image_info}= Get Software Inventory State By Version ${image_version} |
| 74 | Run Keyword If 'BMC update' == '${image_info["image_type"]}' |
| 75 | ... Reboot BMC And Verify BMC Image Immediate start_boot_seconds=${state['epoch_seconds']} |
| 76 | ... ELSE |
| 77 | ... Poweron Host And Verify Host Image |
| 78 | |
| 79 | |
| 80 | Redfish Unsigned Firmware Update |
| 81 | [Documentation] Update the BMC/Host firmware via redfish interface. |
| 82 | [Arguments] ${image_file_path} |
| 83 | |
| 84 | # Description of argument(s): |
| 85 | # IMAGE_FILE_PATH The path to the image file. |
| 86 | |
| 87 | Field Mode Should Be Enabled |
| 88 | Set ApplyTime policy=Immediate |
| 89 | Redfish Upload Image ${REDFISH_BASE_URI}UpdateService ${image_file_path} |
| 90 | ${image_id}= Get Latest Image ID |
| 91 | Rprint Vars image_id |
| 92 | Sleep 5s |
| 93 | Wait Until Keyword Succeeds 8 min 20 sec |
| 94 | ... Check Image Update Progress State |
| 95 | ... match_state='Disabled', 'Updating', 'Disabled' image_id=${image_id} |
| 96 | Delete Software Object |
| 97 | ... /xyz/openbmc_project/software/${image_id} |
| 98 | |