Sushil Singh | 32e2b58 | 2019-08-16 04:58:24 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Update firmware on a target Host via Redifsh. |
| 3 | |
| 4 | # Test Parameters: |
| 5 | # IMAGE_FILE_PATH The path to the Host image file. |
| 6 | # |
| 7 | # Firmware update states: |
| 8 | # Enabled Image is installed and either functional or active. |
| 9 | # Disabled Image installation failed or ready for activation. |
| 10 | # Updating Image installation currently in progress. |
| 11 | |
| 12 | Resource ../../lib/resource.robot |
| 13 | Resource ../../lib/bmc_redfish_resource.robot |
| 14 | Resource ../../lib/boot_utils.robot |
| 15 | Resource ../../lib/openbmc_ffdc.robot |
| 16 | Resource ../../lib/common_utils.robot |
| 17 | Resource ../../lib/code_update_utils.robot |
| 18 | Resource ../../lib/dump_utils.robot |
| 19 | Resource ../../lib/logging_utils.robot |
| 20 | Resource ../../lib/redfish_code_update_utils.robot |
Sushil Singh | 9770dae | 2020-02-10 03:17:51 -0600 | [diff] [blame] | 21 | Resource ../../lib/utils.robot |
Sushil Singh | 32e2b58 | 2019-08-16 04:58:24 -0500 | [diff] [blame] | 22 | Library ../../lib/gen_robot_valid.py |
| 23 | Library ../../lib/tftp_update_utils.py |
| 24 | |
| 25 | Suite Setup Suite Setup Execution |
| 26 | Suite Teardown Redfish.Logout |
| 27 | Test Setup Printn |
| 28 | Test Teardown FFDC On Test Case Fail |
| 29 | |
| 30 | Force Tags Host_Code_Update |
| 31 | |
| 32 | *** Test Cases *** |
| 33 | |
Tony Lee | dce3be1 | 2020-06-02 11:19:19 +0800 | [diff] [blame] | 34 | Redfish Host Code Update With ApplyTime OnReset |
George Keishing | 16b3c7b | 2021-01-28 09:23:37 -0600 | [diff] [blame] | 35 | [Documentation] Update the firmware image with ApplyTime of OnReset. |
Tony Lee | dce3be1 | 2020-06-02 11:19:19 +0800 | [diff] [blame] | 36 | [Tags] Redfish_Host_Code_Update_With_ApplyTime_OnReset |
Sushil Singh | 32e2b58 | 2019-08-16 04:58:24 -0500 | [diff] [blame] | 37 | [Template] Redfish Update Firmware |
| 38 | |
| 39 | # policy |
| 40 | OnReset |
| 41 | |
| 42 | |
Tony Lee | dce3be1 | 2020-06-02 11:19:19 +0800 | [diff] [blame] | 43 | Redfish Host Code Update With ApplyTime Immediate |
George Keishing | 16b3c7b | 2021-01-28 09:23:37 -0600 | [diff] [blame] | 44 | [Documentation] Update the firmware image with ApplyTime of Immediate. |
Tony Lee | dce3be1 | 2020-06-02 11:19:19 +0800 | [diff] [blame] | 45 | [Tags] Redfish_Host_Code_Update_With_ApplyTime_Immediate |
Sushil Singh | 32e2b58 | 2019-08-16 04:58:24 -0500 | [diff] [blame] | 46 | [Template] Redfish Update Firmware |
| 47 | |
| 48 | # policy |
| 49 | Immediate |
| 50 | |
Sushil Singh | 1620cfb | 2019-10-10 06:07:53 -0500 | [diff] [blame] | 51 | |
Sivas SRR | bf2d10e | 2019-10-22 23:25:35 -0500 | [diff] [blame] | 52 | BMC Reboot When PNOR Update Goes On |
| 53 | [Documentation] Trigger PNOR update and do BMC reboot. |
| 54 | [Tags] BMC_Reboot_When_PNOR_Update_Goes_On |
| 55 | |
| 56 | ${bios_version_before}= Redfish.Get Attribute /redfish/v1/Systems/system/ BiosVersion |
| 57 | Redfish Firmware Update And Do BMC Reboot |
| 58 | ${bios_version_after}= Redfish.Get Attribute /redfish/v1/Systems/system/ BiosVersion |
| 59 | Valid Value bios_version_after ['${bios_version_before}'] |
| 60 | |
| 61 | |
Sushil Singh | 32e2b58 | 2019-08-16 04:58:24 -0500 | [diff] [blame] | 62 | *** Keywords *** |
| 63 | |
| 64 | Suite Setup Execution |
| 65 | [Documentation] Do the suite setup. |
| 66 | |
| 67 | Valid File Path IMAGE_FILE_PATH |
| 68 | Redfish.Login |
George Keishing | 44c0910 | 2021-08-18 23:29:28 -0500 | [diff] [blame] | 69 | Run Keyword And Ignore Error Redfish Delete All BMC Dumps |
| 70 | Run Keyword And Ignore Error Redfish Purge Event Log |
George Keishing | 219c633 | 2021-08-19 03:37:13 -0500 | [diff] [blame] | 71 | Redfish Power Off stack_mode=skip |
Sushil Singh | 32e2b58 | 2019-08-16 04:58:24 -0500 | [diff] [blame] | 72 | |
| 73 | |
| 74 | Redfish Update Firmware |
| 75 | [Documentation] Update the BMC firmware via redfish interface. |
| 76 | [Arguments] ${apply_time} |
| 77 | |
| 78 | # Description of argument(s): |
| 79 | # policy ApplyTime allowed values (e.g. "OnReset", "Immediate"). |
| 80 | |
| 81 | Redfish.Login |
Sushil Singh | 9770dae | 2020-02-10 03:17:51 -0600 | [diff] [blame] | 82 | ${post_code_update_actions}= Get Post Boot Action |
Sushil Singh | 6f86f17 | 2019-10-30 11:36:25 -0500 | [diff] [blame] | 83 | Set ApplyTime policy=${apply_Time} |
| 84 | Redfish Upload Image And Check Progress State |
Sushil Singh | 9770dae | 2020-02-10 03:17:51 -0600 | [diff] [blame] | 85 | Run Key ${post_code_update_actions['Host image']['${apply_time}']} |
| 86 | Redfish.Login |
| 87 | Redfish Verify Host Version ${IMAGE_FILE_PATH} |
Sushil Singh | 811ffae | 2019-10-23 05:16:22 -0500 | [diff] [blame] | 88 | Verify Get ApplyTime ${apply_time} |
Sushil Singh | 32e2b58 | 2019-08-16 04:58:24 -0500 | [diff] [blame] | 89 | |
Sivas SRR | bf2d10e | 2019-10-22 23:25:35 -0500 | [diff] [blame] | 90 | |
| 91 | Redfish Firmware Update And Do BMC Reboot |
| 92 | [Documentation] Update the firmware via redfish interface and do BMC reboot. |
| 93 | |
| 94 | Set ApplyTime policy="Immediate" |
| 95 | Redfish Upload Image ${REDFISH_BASE_URI}UpdateService ${IMAGE_FILE_PATH} |
| 96 | ${image_id}= Get Latest Image ID |
| 97 | Wait Until Keyword Succeeds 1 min 10 sec |
| 98 | ... Check Image Update Progress State match_state='Updating' image_id=${image_id} |
| 99 | |
| 100 | # BMC reboot while PNOR update is in progress. |
| 101 | Redfish OBMC Reboot (off) |