blob: a15ed503fb7fc0fc0a7cbaf8e1f18f0004106199 [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 Keishing224377b2019-07-15 14:15:09 -05009Resource ../../lib/bmc_network_utils.robot
10Library ../../lib/gen_robot_valid.py
George Keishing22872e52019-01-30 22:44:04 -060011
George Keishing97c93942019-03-04 12:45:07 -060012Test Setup Test Setup Execution
George Keishing49f46332019-03-26 08:13:05 -050013Test Teardown Test Teardown Execution
George Keishing22872e52019-01-30 22:44:04 -060014
George Keishing912094b2019-06-07 09:49:03 -050015
16*** Variables ***
17
18${SYSTEM_SHUTDOWN_TIME} ${5}
19
20# Strings to check from journald.
21${REBOOT_REGEX} ^\-- Reboot --
22
George Keishing22872e52019-01-30 22:44:04 -060023*** Test Cases ***
24
George Keishing5ee33d92019-02-02 12:33:25 -060025Verify Redfish BMC Firmware Version
George Keishing22872e52019-01-30 22:44:04 -060026 [Documentation] Get firmware version from BMC manager.
George Keishing5ee33d92019-02-02 12:33:25 -060027 [Tags] Verify_Redfish_BMC_Firmware_Version
George Keishing22872e52019-01-30 22:44:04 -060028
George Keishing97c93942019-03-04 12:45:07 -060029 Redfish.Login
30 ${resp}= Redfish.Get /redfish/v1/Managers/bmc
George Keishing22872e52019-01-30 22:44:04 -060031 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 Keishing22872e52019-01-30 22:44:04 -060035
36
George Keishing5ee33d92019-02-02 12:33:25 -060037Verify Redfish BMC Manager Properties
George Keishing22872e52019-01-30 22:44:04 -060038 [Documentation] Verify BMC managers resource properties.
George Keishing5ee33d92019-02-02 12:33:25 -060039 [Tags] Verify_Redfish_BMC_Manager_Properties
George Keishing22872e52019-01-30 22:44:04 -060040
George Keishing97c93942019-03-04 12:45:07 -060041 Redfish.Login
42 ${resp}= Redfish.Get /redfish/v1/Managers/bmc
George Keishing22872e52019-01-30 22:44:04 -060043 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 Keishing22872e52019-01-30 22:44:04 -060059
60
George Keishing224377b2019-07-15 14:15:09 -050061Verify MAC Address Property Is Populated
62 [Documentation] Verify BMC managers resource properties.
63 [Tags] Verify_MAC_Address_Property_Is_Populated
64
George Keishing11789a22020-07-17 14:38:00 -050065 # Get OrderedDict from the BMC which contains active ethernet channel.
66 # Example: ([('1', {'name': 'eth0',
67 # 'is_valid': True,
68 # 'active_sessions': 0,
69 # 'channel_info': {'medium_type': 'lan-802.3',
70 # 'protocol_type': 'ipmb-1.0',
71 # 'session_supported': 'multi-session',
72 # 'is_ipmi': True
73 # }
74 # }
75 # )])
76
77 ${active_channel_config}= Get Active Channel Config
78
79 FOR ${channel_number} IN @{active_channel_config.keys()}
80 Log Dictionary ${active_channel_config["${channel_number}"]}
81
82 # Get ethernet valid paths in redfish.
83 # Example: ['/redfish/v1/Managers/bmc/EthernetInterfaces']
84 ${eth_interface}= redfish_utils.Get Endpoint Path List
85 ... /redfish/v1/Managers/ EthernetInterfaces
86
87 # Get the MACAddress attrivute value with the 'name': 'eth0'.
88 # Example: /redfish/v1/Managers/bmc/EthernetInterfaces/eth0
89 ${redfish_mac_addr}= Redfish.Get Attribute
90 ... ${eth_interface[0]}/${active_channel_config["${channel_number}"]["name"]}
91 ... MACAddress
92 END
93
George Keishing224377b2019-07-15 14:15:09 -050094 Rprint Vars redfish_mac_addr fmt=terse
Michael Walshe7edb222019-08-19 17:39:38 -050095 Valid Value redfish_mac_addr
George Keishing224377b2019-07-15 14:15:09 -050096
97 ${ipaddr_mac_addr}= Get BMC MAC Address List
98 Rprint Vars ipaddr_mac_addr fmt=terse
99
100 List Should Contain Value ${ipaddr_mac_addr} ${redfish_mac_addr}
101
102
George Keishingba0441c2019-03-09 22:22:57 -0600103Redfish BMC Manager GracefulRestart When Host Off
104 [Documentation] BMC graceful restart when host is powered off.
105 [Tags] Redfish_BMC_Manager_GracefulRestart_When_Host_Off
George Keishing22872e52019-01-30 22:44:04 -0600106
George Keishing22872e52019-01-30 22:44:04 -0600107 # "Actions": {
108 # "#Manager.Reset": {
109 # "ResetType@Redfish.AllowableValues": [
110 # "GracefulRestart"
111 # ],
112 # "target": "/redfish/v1/Managers/bmc/Actions/Manager.Reset"
113 # }
114
George Keishing912094b2019-06-07 09:49:03 -0500115 ${test_file_path}= Set Variable /tmp/before_bmcreboot
116 BMC Execute Command touch ${test_file_path}
117
George Keishingba0441c2019-03-09 22:22:57 -0600118 Redfish OBMC Reboot (off)
George Keishing22872e52019-01-30 22:44:04 -0600119
George Keishing912094b2019-06-07 09:49:03 -0500120 BMC Execute Command if [ -f ${test_file_path} ] ; then false ; fi
121 Verify BMC RTC And UTC Time Drift
122
123 # Check for journald persistency post reboot.
124 Check For Regex In Journald ${REBOOT_REGEX} error_check=${1}
125
George Keishingba0441c2019-03-09 22:22:57 -0600126
George Keishinge210d592019-06-11 11:18:35 -0500127Verify Boot Count After BMC Reboot
128 [Documentation] Verify boot count increments on BMC reboot.
129 [Tags] Verify_Boot_Count_After_BMC_Reboot
130
131 Set BMC Boot Count ${0}
132 Redfish OBMC Reboot (off)
133 ${boot_count}= Get BMC Boot Count
134 Should Be Equal ${boot_count} ${1} msg=Boot count is not incremented.
135
136
George Keishingba0441c2019-03-09 22:22:57 -0600137Redfish BMC Manager GracefulRestart When Host Booted
138 [Documentation] BMC graceful restart when host is running.
139 [Tags] Redfish_BMC_Manager_GracefulRestart_When_Host_Booted
140
141 Redfish OBMC Reboot (run)
142
George Keishing44f890b2019-04-22 13:32:15 -0500143 # TODO: Replace OCC state check with redfish property when available.
144 Verify OCC State
145
George Keishing22872e52019-01-30 22:44:04 -0600146
George Keishing97c93942019-03-04 12:45:07 -0600147*** Keywords ***
George Keishing22872e52019-01-30 22:44:04 -0600148
George Keishing97c93942019-03-04 12:45:07 -0600149Test Setup Execution
150 [Documentation] Do test case setup tasks.
151
152 redfish.Login
153
154
155Test Teardown Execution
156 [Documentation] Do the post test teardown.
157
158 FFDC On Test Case Fail
159 redfish.Logout