George Keishing | 22872e5 | 2019-01-30 22:44:04 -0600 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Resource ../../lib/resource.txt |
| 3 | Resource ../../lib/bmc_redfish_resource.robot |
| 4 | Resource ../../lib/common_utils.robot |
| 5 | |
| 6 | Suite Teardown redfish.Logout |
| 7 | |
| 8 | *** Test Cases *** |
| 9 | |
| 10 | Verify BMC Firmware Version |
| 11 | [Documentation] Get firmware version from BMC manager. |
| 12 | [Tags] Verify_BMC_Firmware_Version |
| 13 | |
| 14 | redfish.Login |
George Keishing | 3a813a9 | 2019-02-01 20:34:47 -0600 | [diff] [blame] | 15 | ${resp}= redfish.Get /redfish/v1/Managers/bmc |
George Keishing | 22872e5 | 2019-01-30 22:44:04 -0600 | [diff] [blame] | 16 | Should Be Equal As Strings ${resp.status} ${HTTP_OK} |
| 17 | ${bmc_version}= Get BMC Version |
| 18 | Should Be Equal As Strings |
| 19 | ... ${resp.dict["FirmwareVersion"]} ${bmc_version.strip('"')} |
| 20 | redfish.Logout |
| 21 | |
| 22 | |
| 23 | Verify BMC Manager Properties |
| 24 | [Documentation] Verify BMC managers resource properties. |
| 25 | [Tags] Verify_BMC_Manager_Properties |
| 26 | |
| 27 | redfish.Login |
George Keishing | 3a813a9 | 2019-02-01 20:34:47 -0600 | [diff] [blame] | 28 | ${resp}= redfish.Get /redfish/v1/Managers/bmc |
George Keishing | 22872e5 | 2019-01-30 22:44:04 -0600 | [diff] [blame] | 29 | Should Be Equal As Strings ${resp.status} ${HTTP_OK} |
| 30 | # Example: |
| 31 | # "Description": "Baseboard Management Controller" |
| 32 | # "Id": "bmc" |
| 33 | # "Model": "OpenBmc", |
| 34 | # "Name": "OpenBmc Manager", |
| 35 | # "UUID": "xxxxxxxx-xxx-xxx-xxx-xxxxxxxxxxxx" |
| 36 | # "PowerState": "On" |
| 37 | |
| 38 | Should Be Equal As Strings |
| 39 | ... ${resp.dict["Description"]} Baseboard Management Controller |
| 40 | Should Be Equal As Strings ${resp.dict["Id"]} bmc |
| 41 | Should Be Equal As Strings ${resp.dict["Model"]} OpenBmc |
| 42 | Should Be Equal As Strings ${resp.dict["Name"]} OpenBmc Manager |
| 43 | Should Not Be Empty ${resp.dict["UUID"]} |
| 44 | Should Be Equal As Strings ${resp.dict["PowerState"]} On |
| 45 | redfish.Logout |
| 46 | |
| 47 | |
| 48 | Test BMC Manager GracefulRestart |
| 49 | [Documentation] BMC graceful restart. |
| 50 | [Tags] Test_BMC_Manager_GracefulRestart |
| 51 | |
| 52 | # Example: |
| 53 | # "Actions": { |
| 54 | # "#Manager.Reset": { |
| 55 | # "ResetType@Redfish.AllowableValues": [ |
| 56 | # "GracefulRestart" |
| 57 | # ], |
| 58 | # "target": "/redfish/v1/Managers/bmc/Actions/Manager.Reset" |
| 59 | # } |
| 60 | |
| 61 | redfish.Login |
| 62 | ${payload}= Create Dictionary ResetType=GracefulRestart |
| 63 | ${resp}= redfish.Post Managers/bmc/Actions/Manager.Reset body=&{payload} |
| 64 | Should Be Equal As Strings ${resp.status} ${HTTP_OK} |
| 65 | |
| 66 | # TODO: Add logic to ping and check BMC online state |
| 67 | |
| 68 | |
| 69 | |