blob: 3537447e6275808e5a1f912e54f081e9b6172fcc [file] [log] [blame]
George Keishing22872e52019-01-30 22:44:04 -06001*** Settings ***
Joy Onyerikwudbfe97d2019-03-11 19:44:56 -05002Documentation Test BMC Manager functionality.
George Keishing2db7bca2019-02-14 13:03:08 -06003Resource ../../lib/resource.robot
George Keishing22872e52019-01-30 22:44:04 -06004Resource ../../lib/bmc_redfish_resource.robot
5Resource ../../lib/common_utils.robot
George Keishing3298d5c2019-02-12 06:59:25 -06006Resource ../../lib/openbmc_ffdc.robot
George Keishingba0441c2019-03-09 22:22:57 -06007Resource ../../lib/boot_utils.robot
George Keishing44f890b2019-04-22 13:32:15 -05008Resource ../../lib/open_power_utils.robot
George Keishing22872e52019-01-30 22:44:04 -06009
George Keishing97c93942019-03-04 12:45:07 -060010Test Setup Test Setup Execution
George Keishing49f46332019-03-26 08:13:05 -050011Test Teardown Test Teardown Execution
George Keishing22872e52019-01-30 22:44:04 -060012
George Keishing912094b2019-06-07 09:49:03 -050013
14*** Variables ***
15
16${SYSTEM_SHUTDOWN_TIME} ${5}
17
18# Strings to check from journald.
19${REBOOT_REGEX} ^\-- Reboot --
20
George Keishing22872e52019-01-30 22:44:04 -060021*** Test Cases ***
22
George Keishing5ee33d92019-02-02 12:33:25 -060023Verify Redfish BMC Firmware Version
George Keishing22872e52019-01-30 22:44:04 -060024 [Documentation] Get firmware version from BMC manager.
George Keishing5ee33d92019-02-02 12:33:25 -060025 [Tags] Verify_Redfish_BMC_Firmware_Version
George Keishing22872e52019-01-30 22:44:04 -060026
George Keishing97c93942019-03-04 12:45:07 -060027 Redfish.Login
28 ${resp}= Redfish.Get /redfish/v1/Managers/bmc
George Keishing22872e52019-01-30 22:44:04 -060029 Should Be Equal As Strings ${resp.status} ${HTTP_OK}
30 ${bmc_version}= Get BMC Version
31 Should Be Equal As Strings
32 ... ${resp.dict["FirmwareVersion"]} ${bmc_version.strip('"')}
George Keishing22872e52019-01-30 22:44:04 -060033
34
George Keishing5ee33d92019-02-02 12:33:25 -060035Verify Redfish BMC Manager Properties
George Keishing22872e52019-01-30 22:44:04 -060036 [Documentation] Verify BMC managers resource properties.
George Keishing5ee33d92019-02-02 12:33:25 -060037 [Tags] Verify_Redfish_BMC_Manager_Properties
George Keishing22872e52019-01-30 22:44:04 -060038
George Keishing97c93942019-03-04 12:45:07 -060039 Redfish.Login
40 ${resp}= Redfish.Get /redfish/v1/Managers/bmc
George Keishing22872e52019-01-30 22:44:04 -060041 Should Be Equal As Strings ${resp.status} ${HTTP_OK}
42 # Example:
43 # "Description": "Baseboard Management Controller"
44 # "Id": "bmc"
45 # "Model": "OpenBmc",
46 # "Name": "OpenBmc Manager",
47 # "UUID": "xxxxxxxx-xxx-xxx-xxx-xxxxxxxxxxxx"
48 # "PowerState": "On"
49
50 Should Be Equal As Strings
51 ... ${resp.dict["Description"]} Baseboard Management Controller
52 Should Be Equal As Strings ${resp.dict["Id"]} bmc
53 Should Be Equal As Strings ${resp.dict["Model"]} OpenBmc
54 Should Be Equal As Strings ${resp.dict["Name"]} OpenBmc Manager
55 Should Not Be Empty ${resp.dict["UUID"]}
56 Should Be Equal As Strings ${resp.dict["PowerState"]} On
George Keishing22872e52019-01-30 22:44:04 -060057
58
George Keishingba0441c2019-03-09 22:22:57 -060059Redfish BMC Manager GracefulRestart When Host Off
60 [Documentation] BMC graceful restart when host is powered off.
61 [Tags] Redfish_BMC_Manager_GracefulRestart_When_Host_Off
George Keishing22872e52019-01-30 22:44:04 -060062
George Keishing22872e52019-01-30 22:44:04 -060063 # "Actions": {
64 # "#Manager.Reset": {
65 # "ResetType@Redfish.AllowableValues": [
66 # "GracefulRestart"
67 # ],
68 # "target": "/redfish/v1/Managers/bmc/Actions/Manager.Reset"
69 # }
70
George Keishing912094b2019-06-07 09:49:03 -050071 ${test_file_path}= Set Variable /tmp/before_bmcreboot
72 BMC Execute Command touch ${test_file_path}
73
George Keishingba0441c2019-03-09 22:22:57 -060074 Redfish OBMC Reboot (off)
George Keishing22872e52019-01-30 22:44:04 -060075
George Keishing912094b2019-06-07 09:49:03 -050076 BMC Execute Command if [ -f ${test_file_path} ] ; then false ; fi
77 Verify BMC RTC And UTC Time Drift
78
79 # Check for journald persistency post reboot.
80 Check For Regex In Journald ${REBOOT_REGEX} error_check=${1}
81
George Keishingba0441c2019-03-09 22:22:57 -060082
George Keishinge210d592019-06-11 11:18:35 -050083Verify Boot Count After BMC Reboot
84 [Documentation] Verify boot count increments on BMC reboot.
85 [Tags] Verify_Boot_Count_After_BMC_Reboot
86
87 Set BMC Boot Count ${0}
88 Redfish OBMC Reboot (off)
89 ${boot_count}= Get BMC Boot Count
90 Should Be Equal ${boot_count} ${1} msg=Boot count is not incremented.
91
92
George Keishingba0441c2019-03-09 22:22:57 -060093Redfish BMC Manager GracefulRestart When Host Booted
94 [Documentation] BMC graceful restart when host is running.
95 [Tags] Redfish_BMC_Manager_GracefulRestart_When_Host_Booted
96
97 Redfish OBMC Reboot (run)
98
George Keishing44f890b2019-04-22 13:32:15 -050099 # TODO: Replace OCC state check with redfish property when available.
100 Verify OCC State
101
George Keishing22872e52019-01-30 22:44:04 -0600102
George Keishing97c93942019-03-04 12:45:07 -0600103*** Keywords ***
George Keishing22872e52019-01-30 22:44:04 -0600104
George Keishing97c93942019-03-04 12:45:07 -0600105Test Setup Execution
106 [Documentation] Do test case setup tasks.
107
108 redfish.Login
109
110
111Test Teardown Execution
112 [Documentation] Do the post test teardown.
113
114 FFDC On Test Case Fail
115 redfish.Logout