Sushil Singh | 5ea86d0 | 2019-07-11 02:05:16 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Update the BMC code on a target BMC via Redifsh. |
| 3 | |
| 4 | Resource ../../lib/resource.robot |
| 5 | Resource ../../lib/bmc_redfish_resource.robot |
| 6 | Resource ../../lib/openbmc_ffdc.robot |
| 7 | Resource ../../lib/common_utils.robot |
| 8 | Resource ../../lib/code_update_utils.robot |
Sushil Singh | acd6b4c | 2019-07-30 05:32:36 -0500 | [diff] [blame] | 9 | Resource ../../lib/dump_utils.robot |
| 10 | Resource ../../lib/logging_utils.robot |
Sushil Singh | 5ea86d0 | 2019-07-11 02:05:16 -0500 | [diff] [blame] | 11 | Library ../../lib/gen_robot_valid.py |
| 12 | |
| 13 | Suite Setup Suite Setup Execution |
| 14 | Suite Teardown Redfish.Logout |
| 15 | Test Setup Printn |
| 16 | Test Teardown FFDC On Test Case Fail |
| 17 | |
| 18 | Force Tags BMC_Code_Update |
| 19 | |
| 20 | *** Variables *** |
| 21 | ${immediate} Immediate |
| 22 | ${onreset} OnReset |
| 23 | |
| 24 | *** Test Cases *** |
| 25 | |
| 26 | Redfish BMC Code Update |
| 27 | [Documentation] Do a BMC code update by uploading image on BMC via redfish. |
| 28 | [Tags] Redfish_BMC_Code_Update |
| 29 | |
| 30 | Set ApplyTime policy=${onreset} |
| 31 | |
| 32 | ${base_redfish_uri}= Set Variable ${REDFISH_BASE_URI}UpdateService |
| 33 | |
| 34 | Redfish Upload Image ${base_redfish_uri} ${IMAGE_FILE_PATH} |
| 35 | |
| 36 | ${image_id}= Get Latest Image ID |
| 37 | Rprint Vars image_id |
| 38 | |
| 39 | Check Image Update Progress State match_state='Disabled', 'Updating' image_id=${image_id} |
| 40 | |
| 41 | # Wait a few seconds to check if the update progress started. |
| 42 | Sleep 5s |
| 43 | Check Image Update Progress State match_state='Updating' image_id=${image_id} |
| 44 | |
| 45 | Wait Until Keyword Succeeds 5 min 20 sec |
| 46 | ... Check Image Update Progress State match_state='Enabled' image_id=${image_id} |
| 47 | |
| 48 | Redfish OBMC Reboot (off) |
| 49 | Redfish.Login |
| 50 | Redfish Verify BMC Version ${IMAGE_FILE_PATH} |
| 51 | |
| 52 | |
| 53 | *** Keywords *** |
| 54 | |
| 55 | Suite Setup Execution |
| 56 | [Documentation] Do the suite setup. |
| 57 | |
| 58 | Redfish.Login |
Sushil Singh | acd6b4c | 2019-07-30 05:32:36 -0500 | [diff] [blame] | 59 | |
| 60 | # Delete BMC dump and Error logs |
| 61 | Delete All BMC Dump |
| 62 | Redfish Purge Event Log |
| 63 | |
Sushil Singh | 5ea86d0 | 2019-07-11 02:05:16 -0500 | [diff] [blame] | 64 | # Checking for file existence. |
| 65 | OperatingSystem.File Should Exist ${IMAGE_FILE_PATH} |
Sushil Singh | acd6b4c | 2019-07-30 05:32:36 -0500 | [diff] [blame] | 66 | |