Sushil Singh | 5ea86d0 | 2019-07-11 02:05:16 -0500 | [diff] [blame] | 1 | *** Settings *** |
Sushil Singh | 11d0d14 | 2019-08-03 11:09:42 -0500 | [diff] [blame] | 2 | Documentation Update firmware on a target BMC via Redifsh. |
| 3 | |
| 4 | # Test Parameters: |
| 5 | # IMAGE_FILE_PATH The path to the BMC 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. |
Sushil Singh | 5ea86d0 | 2019-07-11 02:05:16 -0500 | [diff] [blame] | 11 | |
| 12 | Resource ../../lib/resource.robot |
| 13 | Resource ../../lib/bmc_redfish_resource.robot |
| 14 | Resource ../../lib/openbmc_ffdc.robot |
| 15 | Resource ../../lib/common_utils.robot |
| 16 | Resource ../../lib/code_update_utils.robot |
Sushil Singh | acd6b4c | 2019-07-30 05:32:36 -0500 | [diff] [blame] | 17 | Resource ../../lib/dump_utils.robot |
| 18 | Resource ../../lib/logging_utils.robot |
Sushil Singh | 11d0d14 | 2019-08-03 11:09:42 -0500 | [diff] [blame] | 19 | Resource ../../lib/redfish_code_update_utils.robot |
Sushil Singh | 5ea86d0 | 2019-07-11 02:05:16 -0500 | [diff] [blame] | 20 | Library ../../lib/gen_robot_valid.py |
Sushil Singh | 11d0d14 | 2019-08-03 11:09:42 -0500 | [diff] [blame] | 21 | Library ../../lib/tftp_update_utils.py |
Sushil Singh | 5ea86d0 | 2019-07-11 02:05:16 -0500 | [diff] [blame] | 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 | Force Tags BMC_Code_Update |
| 29 | |
| 30 | *** Variables *** |
| 31 | ${immediate} Immediate |
| 32 | ${onreset} OnReset |
| 33 | |
| 34 | *** Test Cases *** |
| 35 | |
Sushil Singh | 11d0d14 | 2019-08-03 11:09:42 -0500 | [diff] [blame] | 36 | Redfish Code Update With ApplyTime OnReset |
| 37 | [Documentation] Update the firmaware image with ApplyTime of OnReset. |
| 38 | [Tags] Redfish_Code_Update_With_ApplyTime_OnReset |
| 39 | [Template] Redfish Update Firmware |
Sushil Singh | 5ea86d0 | 2019-07-11 02:05:16 -0500 | [diff] [blame] | 40 | |
Sushil Singh | 11d0d14 | 2019-08-03 11:09:42 -0500 | [diff] [blame] | 41 | # policy |
| 42 | ${onreset} |
Sushil Singh | 5ea86d0 | 2019-07-11 02:05:16 -0500 | [diff] [blame] | 43 | |
Sushil Singh | 5ea86d0 | 2019-07-11 02:05:16 -0500 | [diff] [blame] | 44 | |
Sushil Singh | 11d0d14 | 2019-08-03 11:09:42 -0500 | [diff] [blame] | 45 | Redfish Code Update With ApplyTime Immediate |
| 46 | [Documentation] Update the firmaware image with ApplyTime of Immediate. |
| 47 | [Tags] Redfish_Code_Update_With_ApplyTime_Immediate |
| 48 | [Template] Redfish Update Firmware |
Sushil Singh | 5ea86d0 | 2019-07-11 02:05:16 -0500 | [diff] [blame] | 49 | |
Sushil Singh | 11d0d14 | 2019-08-03 11:09:42 -0500 | [diff] [blame] | 50 | # policy |
| 51 | ${immediate} |
Sushil Singh | 5ea86d0 | 2019-07-11 02:05:16 -0500 | [diff] [blame] | 52 | |
| 53 | |
| 54 | *** Keywords *** |
| 55 | |
| 56 | Suite Setup Execution |
| 57 | [Documentation] Do the suite setup. |
| 58 | |
| 59 | Redfish.Login |
Sushil Singh | acd6b4c | 2019-07-30 05:32:36 -0500 | [diff] [blame] | 60 | |
| 61 | # Delete BMC dump and Error logs |
| 62 | Delete All BMC Dump |
| 63 | Redfish Purge Event Log |
| 64 | |
Sushil Singh | 5ea86d0 | 2019-07-11 02:05:16 -0500 | [diff] [blame] | 65 | # Checking for file existence. |
| 66 | OperatingSystem.File Should Exist ${IMAGE_FILE_PATH} |
Sushil Singh | acd6b4c | 2019-07-30 05:32:36 -0500 | [diff] [blame] | 67 | |
Sushil Singh | 11d0d14 | 2019-08-03 11:09:42 -0500 | [diff] [blame] | 68 | |
| 69 | Redfish Update Firmware |
| 70 | [Documentation] Code update with ApplyTime and verify installation. |
| 71 | [Arguments] ${apply_time} |
| 72 | |
| 73 | # Description of argument(s): |
| 74 | # policy ApplyTime allowed values (e.g. "OnReset", "Immediate"). |
| 75 | |
| 76 | ${state}= Get Pre Reboot State |
| 77 | Rprint Vars state |
| 78 | |
| 79 | Set ApplyTime policy=${apply_time} |
| 80 | |
| 81 | Redfish Upload Image ${REDFISH_BASE_URI}UpdateService ${IMAGE_FILE_PATH} |
| 82 | |
| 83 | ${image_id}= Get Latest Image ID |
| 84 | Rprint Vars image_id |
| 85 | |
| 86 | Check Image Update Progress State |
| 87 | ... match_state='Disabled', 'Updating' image_id=${image_id} |
| 88 | |
| 89 | # Wait a few seconds to check if the update progress started. |
| 90 | Sleep 5s |
| 91 | Check Image Update Progress State |
| 92 | ... match_state='Updating' image_id=${image_id} |
| 93 | |
| 94 | Wait Until Keyword Succeeds 8 min 20 sec |
| 95 | ... Check Image Update Progress State |
| 96 | ... match_state='Enabled' image_id=${image_id} |
| 97 | |
| 98 | Reboot BMC And Verify BMC Image |
| 99 | ... ${apply_time} start_boot_seconds=${state['epoch_seconds']} |
| 100 | |
| 101 | |
| 102 | Reboot BMC And Verify BMC Image |
| 103 | [Documentation] Reboot or wait for BMC standby post reboot and |
| 104 | ... verify installed image is functional. |
| 105 | [Arguments] ${apply_time} ${start_boot_seconds} |
| 106 | |
| 107 | # Description of argument(s): |
| 108 | # policy ApplyTime allowed values (e.g. "OnReset", "Immediate"). |
| 109 | # start_boot_seconds See 'Wait For Reboot' for details. |
| 110 | |
| 111 | Run Keyword if 'OnReset' == '${apply_time}' |
| 112 | ... Run Keywords |
| 113 | ... Redfish OBMC Reboot (off) AND |
| 114 | ... Redfish.Login AND |
| 115 | ... Redfish Verify BMC Version ${IMAGE_FILE_PATH} |
| 116 | ... ELSE |
| 117 | ... Run Keywords |
| 118 | ... Wait For Reboot start_boot_seconds=${start_boot_seconds} AND |
| 119 | ... Redfish.Login AND |
| 120 | ... Redfish Verify BMC Version ${IMAGE_FILE_PATH} |
| 121 | |