blob: 9f2f29baa265382d8f6d595f735399476f6fcd0b [file] [log] [blame]
George Keishing22872e52019-01-30 22:44:04 -06001*** Settings ***
George Keishing2db7bca2019-02-14 13:03:08 -06002Resource ../../lib/resource.robot
George Keishing22872e52019-01-30 22:44:04 -06003Resource ../../lib/bmc_redfish_resource.robot
4Resource ../../lib/common_utils.robot
George Keishing3298d5c2019-02-12 06:59:25 -06005Resource ../../lib/openbmc_ffdc.robot
George Keishing22872e52019-01-30 22:44:04 -06006
George Keishing97c93942019-03-04 12:45:07 -06007Test Setup Test Setup Execution
8Test Teardown Redfish.Logout
George Keishing22872e52019-01-30 22:44:04 -06009
10*** Test Cases ***
11
George Keishing5ee33d92019-02-02 12:33:25 -060012Verify Redfish BMC Firmware Version
George Keishing22872e52019-01-30 22:44:04 -060013 [Documentation] Get firmware version from BMC manager.
George Keishing5ee33d92019-02-02 12:33:25 -060014 [Tags] Verify_Redfish_BMC_Firmware_Version
George Keishing22872e52019-01-30 22:44:04 -060015
George Keishing97c93942019-03-04 12:45:07 -060016 Redfish.Login
17 ${resp}= Redfish.Get /redfish/v1/Managers/bmc
George Keishing22872e52019-01-30 22:44:04 -060018 Should Be Equal As Strings ${resp.status} ${HTTP_OK}
19 ${bmc_version}= Get BMC Version
20 Should Be Equal As Strings
21 ... ${resp.dict["FirmwareVersion"]} ${bmc_version.strip('"')}
George Keishing22872e52019-01-30 22:44:04 -060022
23
George Keishing5ee33d92019-02-02 12:33:25 -060024Verify Redfish BMC Manager Properties
George Keishing22872e52019-01-30 22:44:04 -060025 [Documentation] Verify BMC managers resource properties.
George Keishing5ee33d92019-02-02 12:33:25 -060026 [Tags] Verify_Redfish_BMC_Manager_Properties
George Keishing22872e52019-01-30 22:44:04 -060027
George Keishing97c93942019-03-04 12:45:07 -060028 Redfish.Login
29 ${resp}= Redfish.Get /redfish/v1/Managers/bmc
George Keishing22872e52019-01-30 22:44:04 -060030 Should Be Equal As Strings ${resp.status} ${HTTP_OK}
31 # Example:
32 # "Description": "Baseboard Management Controller"
33 # "Id": "bmc"
34 # "Model": "OpenBmc",
35 # "Name": "OpenBmc Manager",
36 # "UUID": "xxxxxxxx-xxx-xxx-xxx-xxxxxxxxxxxx"
37 # "PowerState": "On"
38
39 Should Be Equal As Strings
40 ... ${resp.dict["Description"]} Baseboard Management Controller
41 Should Be Equal As Strings ${resp.dict["Id"]} bmc
42 Should Be Equal As Strings ${resp.dict["Model"]} OpenBmc
43 Should Be Equal As Strings ${resp.dict["Name"]} OpenBmc Manager
44 Should Not Be Empty ${resp.dict["UUID"]}
45 Should Be Equal As Strings ${resp.dict["PowerState"]} On
George Keishing22872e52019-01-30 22:44:04 -060046
47
George Keishing5ee33d92019-02-02 12:33:25 -060048Test Redfish BMC Manager GracefulRestart
George Keishing22872e52019-01-30 22:44:04 -060049 [Documentation] BMC graceful restart.
George Keishing5ee33d92019-02-02 12:33:25 -060050 [Tags] Test_Redfish_BMC_Manager_GracefulRestart
George Keishing22872e52019-01-30 22:44:04 -060051
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
George Keishing97c93942019-03-04 12:45:07 -060061 Redfish.Login
George Keishing22872e52019-01-30 22:44:04 -060062 ${payload}= Create Dictionary ResetType=GracefulRestart
George Keishing97c93942019-03-04 12:45:07 -060063 ${resp}= Redfish.Post Managers/bmc/Actions/Manager.Reset body=&{payload}
George Keishing22872e52019-01-30 22:44:04 -060064 Should Be Equal As Strings ${resp.status} ${HTTP_OK}
65
66 # TODO: Add logic to ping and check BMC online state
67
George Keishing97c93942019-03-04 12:45:07 -060068*** Keywords ***
George Keishing22872e52019-01-30 22:44:04 -060069
George Keishing97c93942019-03-04 12:45:07 -060070Test Setup Execution
71 [Documentation] Do test case setup tasks.
72
73 redfish.Login
74
75
76Test Teardown Execution
77 [Documentation] Do the post test teardown.
78
79 FFDC On Test Case Fail
80 redfish.Logout
George Keishing22872e52019-01-30 22:44:04 -060081