Sushil Singh | cdebdd5 | 2019-08-14 15:29:24 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 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. |
| 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 |
| 17 | Resource ../../lib/dump_utils.robot |
| 18 | Resource ../../lib/logging_utils.robot |
| 19 | Resource ../../lib/redfish_code_update_utils.robot |
Sushil Singh | b13fc36 | 2020-02-06 03:40:56 -0600 | [diff] [blame] | 20 | Resource ../../lib/utils.robot |
Sushil Singh | cdebdd5 | 2019-08-14 15:29:24 -0500 | [diff] [blame] | 21 | Library ../../lib/gen_robot_valid.py |
| 22 | Library ../../lib/tftp_update_utils.py |
Sushil Singh | f7674a5 | 2019-11-19 00:36:15 -0600 | [diff] [blame] | 23 | Library ../../lib/gen_robot_keyword.py |
Sushil Singh | cdebdd5 | 2019-08-14 15:29:24 -0500 | [diff] [blame] | 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 BMC_Code_Update |
| 31 | |
| 32 | *** Test Cases *** |
| 33 | |
| 34 | Redfish Code Update With ApplyTime OnReset |
| 35 | [Documentation] Update the firmaware image with ApplyTime of OnReset. |
| 36 | [Tags] Redfish_Code_Update_With_ApplyTime_OnReset |
| 37 | [Template] Redfish Update Firmware |
| 38 | |
| 39 | # policy |
| 40 | OnReset |
| 41 | |
| 42 | |
| 43 | Redfish Code Update With ApplyTime Immediate |
| 44 | [Documentation] Update the firmaware image with ApplyTime of Immediate. |
| 45 | [Tags] Redfish_Code_Update_With_ApplyTime_Immediate |
| 46 | [Template] Redfish Update Firmware |
| 47 | |
| 48 | # policy |
| 49 | Immediate |
| 50 | |
| 51 | |
Sushil Singh | ffbfedf | 2019-10-17 15:58:25 -0500 | [diff] [blame] | 52 | Redfish Code Update With Multiple Firmware |
| 53 | [Documentation] Update the firmaware image with ApplyTime of Immediate. |
| 54 | [Tags] Redfish_Code_Update_With_Multiple_Firmware |
| 55 | [Template] Redfish Multiple Upload Image And Check Progress State |
| 56 | |
| 57 | # policy image_file_path alternate_image_file_path |
| 58 | Immediate ${IMAGE_FILE_PATH} ${ALTERNATE_IMAGE_FILE_PATH} |
| 59 | |
| 60 | |
Sushil Singh | cdebdd5 | 2019-08-14 15:29:24 -0500 | [diff] [blame] | 61 | *** Keywords *** |
| 62 | |
| 63 | Suite Setup Execution |
| 64 | [Documentation] Do the suite setup. |
| 65 | |
Sushil Singh | cdebdd5 | 2019-08-14 15:29:24 -0500 | [diff] [blame] | 66 | Valid File Path IMAGE_FILE_PATH |
| 67 | Redfish.Login |
Sushil Singh | cdebdd5 | 2019-08-14 15:29:24 -0500 | [diff] [blame] | 68 | Delete All BMC Dump |
| 69 | Redfish Purge Event Log |
| 70 | |
| 71 | |
| 72 | Redfish Update Firmware |
| 73 | [Documentation] Update the BMC firmware via redfish interface. |
| 74 | [Arguments] ${apply_time} |
| 75 | |
| 76 | # Description of argument(s): |
| 77 | # policy ApplyTime allowed values (e.g. "OnReset", "Immediate"). |
| 78 | |
Sushil Singh | b13fc36 | 2020-02-06 03:40:56 -0600 | [diff] [blame] | 79 | ${post_code_update_actions}= Get Post Boot Action |
Sushil Singh | cdebdd5 | 2019-08-14 15:29:24 -0500 | [diff] [blame] | 80 | ${state}= Get Pre Reboot State |
| 81 | Rprint Vars state |
Sushil Singh | 6f86f17 | 2019-10-30 11:36:25 -0500 | [diff] [blame] | 82 | Set ApplyTime policy=${apply_Time} |
| 83 | Redfish Upload Image And Check Progress State |
Sushil Singh | b13fc36 | 2020-02-06 03:40:56 -0600 | [diff] [blame] | 84 | Run Key ${post_code_update_actions['BMC image']['${apply_time}']} |
Sushil Singh | f7674a5 | 2019-11-19 00:36:15 -0600 | [diff] [blame] | 85 | Redfish.Login |
Sushil Singh | b13fc36 | 2020-02-06 03:40:56 -0600 | [diff] [blame] | 86 | Redfish Verify BMC Version ${IMAGE_FILE_PATH} |
Sushil Singh | 811ffae | 2019-10-23 05:16:22 -0500 | [diff] [blame] | 87 | Verify Get ApplyTime ${apply_time} |
Sushil Singh | cdebdd5 | 2019-08-14 15:29:24 -0500 | [diff] [blame] | 88 | |
Sushil Singh | ffbfedf | 2019-10-17 15:58:25 -0500 | [diff] [blame] | 89 | |
| 90 | Redfish Multiple Upload Image And Check Progress State |
| 91 | [Documentation] Update multiple BMC firmware via redfish interface and check status. |
| 92 | [Arguments] ${apply_time} ${IMAGE_FILE_PATH} ${ALTERNATE_IMAGE_FILE_PATH} |
| 93 | |
| 94 | # Description of argument(s): |
| 95 | # apply_time ApplyTime allowed values (e.g. "OnReset", "Immediate"). |
| 96 | # IMAGE_FILE_PATH The path to BMC image file. |
| 97 | # ALTERNATE_IMAGE_FILE_PATH The path to alternate BMC image file. |
| 98 | |
Sushil Singh | b13fc36 | 2020-02-06 03:40:56 -0600 | [diff] [blame] | 99 | ${post_code_update_actions}= Get Post Boot Action |
Sushil Singh | ffbfedf | 2019-10-17 15:58:25 -0500 | [diff] [blame] | 100 | Valid File Path ALTERNATE_IMAGE_FILE_PATH |
| 101 | ${state}= Get Pre Reboot State |
| 102 | Rprint Vars state |
| 103 | |
| 104 | Set ApplyTime policy=${apply_time} |
| 105 | Redfish Upload Image ${REDFISH_BASE_URI}UpdateService ${IMAGE_FILE_PATH} |
| 106 | |
| 107 | ${first_image_id}= Get Latest Image ID |
| 108 | Rprint Vars first_image_id |
| 109 | Sleep 5s |
| 110 | Redfish Upload Image ${REDFISH_BASE_URI}UpdateService ${ALTERNATE_IMAGE_FILE_PATH} |
| 111 | |
| 112 | ${second_image_id}= Get Latest Image ID |
| 113 | Rprint Vars second_image_id |
| 114 | |
| 115 | Check Image Update Progress State |
| 116 | ... match_state='Updating', 'Disabled' image_id=${second_image_id} |
| 117 | |
| 118 | Check Image Update Progress State |
| 119 | ... match_state='Updating' image_id=${first_image_id} |
| 120 | |
| 121 | Wait Until Keyword Succeeds 8 min 20 sec |
| 122 | ... Check Image Update Progress State |
| 123 | ... match_state='Enabled' image_id=${first_image_id} |
Sushil Singh | b13fc36 | 2020-02-06 03:40:56 -0600 | [diff] [blame] | 124 | Run Key ${post_code_update_actions['BMC image']['${apply_time}']} |
| 125 | Redfish.Login |
| 126 | Redfish Verify BMC Version ${IMAGE_FILE_PATH} |