| George Keishing | 22872e5 | 2019-01-30 22:44:04 -0600 | [diff] [blame] | 1 | *** Settings *** | 
| Joy Onyerikwu | dbfe97d | 2019-03-11 19:44:56 -0500 | [diff] [blame] | 2 | Documentation    Test BMC Manager functionality. | 
| George Keishing | 2db7bca | 2019-02-14 13:03:08 -0600 | [diff] [blame] | 3 | Resource         ../../lib/resource.robot | 
| George Keishing | 22872e5 | 2019-01-30 22:44:04 -0600 | [diff] [blame] | 4 | Resource         ../../lib/bmc_redfish_resource.robot | 
|  | 5 | Resource         ../../lib/common_utils.robot | 
| George Keishing | 3298d5c | 2019-02-12 06:59:25 -0600 | [diff] [blame] | 6 | Resource         ../../lib/openbmc_ffdc.robot | 
| George Keishing | ba0441c | 2019-03-09 22:22:57 -0600 | [diff] [blame] | 7 | Resource         ../../lib/boot_utils.robot | 
| George Keishing | 44f890b | 2019-04-22 13:32:15 -0500 | [diff] [blame] | 8 | Resource         ../../lib/open_power_utils.robot | 
| George Keishing | 224377b | 2019-07-15 14:15:09 -0500 | [diff] [blame] | 9 | Resource         ../../lib/bmc_network_utils.robot | 
|  | 10 | Library          ../../lib/gen_robot_valid.py | 
| George Keishing | 22872e5 | 2019-01-30 22:44:04 -0600 | [diff] [blame] | 11 |  | 
| George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 12 | Test Setup       Test Setup Execution | 
| George Keishing | 49f4633 | 2019-03-26 08:13:05 -0500 | [diff] [blame] | 13 | Test Teardown    Test Teardown Execution | 
| George Keishing | 22872e5 | 2019-01-30 22:44:04 -0600 | [diff] [blame] | 14 |  | 
| George Keishing | 912094b | 2019-06-07 09:49:03 -0500 | [diff] [blame] | 15 |  | 
|  | 16 | *** Variables *** | 
|  | 17 |  | 
|  | 18 | ${SYSTEM_SHUTDOWN_TIME}    ${5} | 
|  | 19 |  | 
|  | 20 | # Strings to check from journald. | 
|  | 21 | ${REBOOT_REGEX}    ^\-- Reboot -- | 
|  | 22 |  | 
| George Keishing | 22872e5 | 2019-01-30 22:44:04 -0600 | [diff] [blame] | 23 | *** Test Cases *** | 
|  | 24 |  | 
| George Keishing | 5ee33d9 | 2019-02-02 12:33:25 -0600 | [diff] [blame] | 25 | Verify Redfish BMC Firmware Version | 
| George Keishing | 22872e5 | 2019-01-30 22:44:04 -0600 | [diff] [blame] | 26 | [Documentation]  Get firmware version from BMC manager. | 
| George Keishing | 5ee33d9 | 2019-02-02 12:33:25 -0600 | [diff] [blame] | 27 | [Tags]  Verify_Redfish_BMC_Firmware_Version | 
| George Keishing | 22872e5 | 2019-01-30 22:44:04 -0600 | [diff] [blame] | 28 |  | 
| George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 29 | Redfish.Login | 
|  | 30 | ${resp}=  Redfish.Get  /redfish/v1/Managers/bmc | 
| George Keishing | 22872e5 | 2019-01-30 22:44:04 -0600 | [diff] [blame] | 31 | Should Be Equal As Strings  ${resp.status}  ${HTTP_OK} | 
|  | 32 | ${bmc_version}=  Get BMC Version | 
|  | 33 | Should Be Equal As Strings | 
|  | 34 | ...  ${resp.dict["FirmwareVersion"]}  ${bmc_version.strip('"')} | 
| George Keishing | 22872e5 | 2019-01-30 22:44:04 -0600 | [diff] [blame] | 35 |  | 
|  | 36 |  | 
| George Keishing | 5ee33d9 | 2019-02-02 12:33:25 -0600 | [diff] [blame] | 37 | Verify Redfish BMC Manager Properties | 
| George Keishing | 22872e5 | 2019-01-30 22:44:04 -0600 | [diff] [blame] | 38 | [Documentation]  Verify BMC managers resource properties. | 
| George Keishing | 5ee33d9 | 2019-02-02 12:33:25 -0600 | [diff] [blame] | 39 | [Tags]  Verify_Redfish_BMC_Manager_Properties | 
| George Keishing | 22872e5 | 2019-01-30 22:44:04 -0600 | [diff] [blame] | 40 |  | 
| George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 41 | Redfish.Login | 
|  | 42 | ${resp}=  Redfish.Get  /redfish/v1/Managers/bmc | 
| George Keishing | 22872e5 | 2019-01-30 22:44:04 -0600 | [diff] [blame] | 43 | Should Be Equal As Strings  ${resp.status}  ${HTTP_OK} | 
|  | 44 | # Example: | 
|  | 45 | #  "Description": "Baseboard Management Controller" | 
|  | 46 | #  "Id": "bmc" | 
|  | 47 | #  "Model": "OpenBmc", | 
|  | 48 | #  "Name": "OpenBmc Manager", | 
|  | 49 | #  "UUID": "xxxxxxxx-xxx-xxx-xxx-xxxxxxxxxxxx" | 
|  | 50 | #  "PowerState": "On" | 
|  | 51 |  | 
|  | 52 | Should Be Equal As Strings | 
|  | 53 | ...  ${resp.dict["Description"]}  Baseboard Management Controller | 
|  | 54 | Should Be Equal As Strings  ${resp.dict["Id"]}  bmc | 
|  | 55 | Should Be Equal As Strings  ${resp.dict["Model"]}  OpenBmc | 
|  | 56 | Should Be Equal As Strings  ${resp.dict["Name"]}  OpenBmc Manager | 
|  | 57 | Should Not Be Empty  ${resp.dict["UUID"]} | 
|  | 58 | Should Be Equal As Strings  ${resp.dict["PowerState"]}  On | 
| George Keishing | 22872e5 | 2019-01-30 22:44:04 -0600 | [diff] [blame] | 59 |  | 
|  | 60 |  | 
| George Keishing | 224377b | 2019-07-15 14:15:09 -0500 | [diff] [blame] | 61 | Verify MAC Address Property Is Populated | 
|  | 62 | [Documentation]  Verify BMC managers resource properties. | 
|  | 63 | [Tags]  Verify_MAC_Address_Property_Is_Populated | 
|  | 64 |  | 
|  | 65 | ${redfish_mac_addr}=  Redfish.Get Attribute  /redfish/v1/Managers/bmc/EthernetInterfaces/eth0  MACAddress | 
|  | 66 | Rprint Vars  redfish_mac_addr  fmt=terse | 
|  | 67 | Rvalid Value  redfish_mac_addr | 
|  | 68 |  | 
|  | 69 | ${ipaddr_mac_addr}=  Get BMC MAC Address List | 
|  | 70 | Rprint Vars  ipaddr_mac_addr  fmt=terse | 
|  | 71 |  | 
|  | 72 | List Should Contain Value  ${ipaddr_mac_addr}  ${redfish_mac_addr} | 
|  | 73 |  | 
|  | 74 |  | 
| George Keishing | ba0441c | 2019-03-09 22:22:57 -0600 | [diff] [blame] | 75 | Redfish BMC Manager GracefulRestart When Host Off | 
|  | 76 | [Documentation]  BMC graceful restart when host is powered off. | 
|  | 77 | [Tags]  Redfish_BMC_Manager_GracefulRestart_When_Host_Off | 
| George Keishing | 22872e5 | 2019-01-30 22:44:04 -0600 | [diff] [blame] | 78 |  | 
| George Keishing | 22872e5 | 2019-01-30 22:44:04 -0600 | [diff] [blame] | 79 | # "Actions": { | 
|  | 80 | # "#Manager.Reset": { | 
|  | 81 | #  "ResetType@Redfish.AllowableValues": [ | 
|  | 82 | #    "GracefulRestart" | 
|  | 83 | #  ], | 
|  | 84 | #  "target": "/redfish/v1/Managers/bmc/Actions/Manager.Reset" | 
|  | 85 | # } | 
|  | 86 |  | 
| George Keishing | 912094b | 2019-06-07 09:49:03 -0500 | [diff] [blame] | 87 | ${test_file_path}=  Set Variable  /tmp/before_bmcreboot | 
|  | 88 | BMC Execute Command  touch ${test_file_path} | 
|  | 89 |  | 
| George Keishing | ba0441c | 2019-03-09 22:22:57 -0600 | [diff] [blame] | 90 | Redfish OBMC Reboot (off) | 
| George Keishing | 22872e5 | 2019-01-30 22:44:04 -0600 | [diff] [blame] | 91 |  | 
| George Keishing | 912094b | 2019-06-07 09:49:03 -0500 | [diff] [blame] | 92 | BMC Execute Command  if [ -f ${test_file_path} ] ; then false ; fi | 
|  | 93 | Verify BMC RTC And UTC Time Drift | 
|  | 94 |  | 
|  | 95 | # Check for journald persistency post reboot. | 
|  | 96 | Check For Regex In Journald  ${REBOOT_REGEX}  error_check=${1} | 
|  | 97 |  | 
| George Keishing | ba0441c | 2019-03-09 22:22:57 -0600 | [diff] [blame] | 98 |  | 
| George Keishing | e210d59 | 2019-06-11 11:18:35 -0500 | [diff] [blame] | 99 | Verify Boot Count After BMC Reboot | 
|  | 100 | [Documentation]  Verify boot count increments on BMC reboot. | 
|  | 101 | [Tags]  Verify_Boot_Count_After_BMC_Reboot | 
|  | 102 |  | 
|  | 103 | Set BMC Boot Count  ${0} | 
|  | 104 | Redfish OBMC Reboot (off) | 
|  | 105 | ${boot_count}=  Get BMC Boot Count | 
|  | 106 | Should Be Equal  ${boot_count}  ${1}  msg=Boot count is not incremented. | 
|  | 107 |  | 
|  | 108 |  | 
| George Keishing | ba0441c | 2019-03-09 22:22:57 -0600 | [diff] [blame] | 109 | Redfish BMC Manager GracefulRestart When Host Booted | 
|  | 110 | [Documentation]  BMC graceful restart when host is running. | 
|  | 111 | [Tags]  Redfish_BMC_Manager_GracefulRestart_When_Host_Booted | 
|  | 112 |  | 
|  | 113 | Redfish OBMC Reboot (run) | 
|  | 114 |  | 
| George Keishing | 44f890b | 2019-04-22 13:32:15 -0500 | [diff] [blame] | 115 | # TODO: Replace OCC state check with redfish property when available. | 
|  | 116 | Verify OCC State | 
|  | 117 |  | 
| George Keishing | 22872e5 | 2019-01-30 22:44:04 -0600 | [diff] [blame] | 118 |  | 
| George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 119 | *** Keywords *** | 
| George Keishing | 22872e5 | 2019-01-30 22:44:04 -0600 | [diff] [blame] | 120 |  | 
| George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 121 | Test Setup Execution | 
|  | 122 | [Documentation]  Do test case setup tasks. | 
|  | 123 |  | 
|  | 124 | redfish.Login | 
|  | 125 |  | 
|  | 126 |  | 
|  | 127 | Test Teardown Execution | 
|  | 128 | [Documentation]  Do the post test teardown. | 
|  | 129 |  | 
|  | 130 | FFDC On Test Case Fail | 
|  | 131 | redfish.Logout |