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 |
| 21 | Library ../../lib/gen_robot_valid.py |
| 22 | Library ../../lib/tftp_update_utils.py |
| 23 | |
| 24 | Suite Setup Suite Setup Execution |
| 25 | Suite Teardown Redfish.Logout |
| 26 | Test Setup Printn |
| 27 | Test Teardown FFDC On Test Case Fail |
| 28 | |
| 29 | Force Tags Host_Code_Update |
| 30 | |
| 31 | *** Test Cases *** |
| 32 | |
| 33 | Redfish Code Update With ApplyTime OnReset |
| 34 | [Documentation] Update the firmaware image with ApplyTime of OnReset. |
| 35 | [Tags] Redfish_Code_Update_With_ApplyTime_OnReset |
| 36 | [Template] Redfish Update Firmware |
| 37 | |
| 38 | # policy |
| 39 | OnReset |
| 40 | |
| 41 | |
| 42 | Redfish Code Update With ApplyTime Immediate |
| 43 | [Documentation] Update the firmaware image with ApplyTime of Immediate. |
| 44 | [Tags] Redfish_Code_Update_With_ApplyTime_Immediate |
| 45 | [Template] Redfish Update Firmware |
| 46 | |
| 47 | # policy |
| 48 | Immediate |
| 49 | |
Sushil Singh | 1620cfb | 2019-10-10 06:07:53 -0500 | [diff] [blame] | 50 | |
Sivas SRR | bf2d10e | 2019-10-22 23:25:35 -0500 | [diff] [blame] | 51 | BMC Reboot When PNOR Update Goes On |
| 52 | [Documentation] Trigger PNOR update and do BMC reboot. |
| 53 | [Tags] BMC_Reboot_When_PNOR_Update_Goes_On |
| 54 | |
| 55 | ${bios_version_before}= Redfish.Get Attribute /redfish/v1/Systems/system/ BiosVersion |
| 56 | Redfish Firmware Update And Do BMC Reboot |
| 57 | ${bios_version_after}= Redfish.Get Attribute /redfish/v1/Systems/system/ BiosVersion |
| 58 | Valid Value bios_version_after ['${bios_version_before}'] |
| 59 | |
| 60 | |
Sushil Singh | 32e2b58 | 2019-08-16 04:58:24 -0500 | [diff] [blame] | 61 | *** Keywords *** |
| 62 | |
| 63 | Suite Setup Execution |
| 64 | [Documentation] Do the suite setup. |
| 65 | |
| 66 | Valid File Path IMAGE_FILE_PATH |
| 67 | Redfish.Login |
| 68 | Delete All BMC Dump |
| 69 | Redfish Purge Event Log |
Sushil Singh | 1620cfb | 2019-10-10 06:07:53 -0500 | [diff] [blame] | 70 | Redfish Power On stack_mode=skip |
Sushil Singh | 32e2b58 | 2019-08-16 04:58:24 -0500 | [diff] [blame] | 71 | |
| 72 | |
| 73 | Redfish Update Firmware |
| 74 | [Documentation] Update the BMC firmware via redfish interface. |
| 75 | [Arguments] ${apply_time} |
| 76 | |
| 77 | # Description of argument(s): |
| 78 | # policy ApplyTime allowed values (e.g. "OnReset", "Immediate"). |
| 79 | |
| 80 | Redfish.Login |
Sushil Singh | 6f86f17 | 2019-10-30 11:36:25 -0500 | [diff] [blame] | 81 | Set ApplyTime policy=${apply_Time} |
| 82 | Redfish Upload Image And Check Progress State |
Sushil Singh | 1620cfb | 2019-10-10 06:07:53 -0500 | [diff] [blame] | 83 | Poweron Host And Verify Host Image ${apply_time} |
Sushil Singh | 811ffae | 2019-10-23 05:16:22 -0500 | [diff] [blame] | 84 | Verify Get ApplyTime ${apply_time} |
Sushil Singh | 32e2b58 | 2019-08-16 04:58:24 -0500 | [diff] [blame] | 85 | |
Sivas SRR | bf2d10e | 2019-10-22 23:25:35 -0500 | [diff] [blame] | 86 | |
| 87 | Redfish Firmware Update And Do BMC Reboot |
| 88 | [Documentation] Update the firmware via redfish interface and do BMC reboot. |
| 89 | |
| 90 | Set ApplyTime policy="Immediate" |
| 91 | Redfish Upload Image ${REDFISH_BASE_URI}UpdateService ${IMAGE_FILE_PATH} |
| 92 | ${image_id}= Get Latest Image ID |
| 93 | Wait Until Keyword Succeeds 1 min 10 sec |
| 94 | ... Check Image Update Progress State match_state='Updating' image_id=${image_id} |
| 95 | |
| 96 | # BMC reboot while PNOR update is in progress. |
| 97 | Redfish OBMC Reboot (off) |