blob: fa321334a2758f2bc7354609d9c8221ab99741d2 [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
83Redfish BMC Manager GracefulRestart When Host Booted
84 [Documentation] BMC graceful restart when host is running.
85 [Tags] Redfish_BMC_Manager_GracefulRestart_When_Host_Booted
86
87 Redfish OBMC Reboot (run)
88
George Keishing44f890b2019-04-22 13:32:15 -050089 # TODO: Replace OCC state check with redfish property when available.
90 Verify OCC State
91
George Keishing22872e52019-01-30 22:44:04 -060092
George Keishing97c93942019-03-04 12:45:07 -060093*** Keywords ***
George Keishing22872e52019-01-30 22:44:04 -060094
George Keishing97c93942019-03-04 12:45:07 -060095Test Setup Execution
96 [Documentation] Do test case setup tasks.
97
98 redfish.Login
99
100
101Test Teardown Execution
102 [Documentation] Do the post test teardown.
103
104 FFDC On Test Case Fail
105 redfish.Logout