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