blob: 5185d24663e5845e9e6a8b86d5be6f75b46a52e1 [file] [log] [blame]
Chris Austenb29d2e82016-06-07 12:25:35 -05001*** Settings ***
2
George Keishing505d5b42017-02-21 11:01:54 -06003Documentation eSEL's Test cases.
Chris Austenb29d2e82016-06-07 12:25:35 -05004
George Keishing4840c832019-06-03 08:31:09 -05005Resource ../../../lib/ipmi_client.robot
6Resource ../../../lib/openbmc_ffdc.robot
7Resource ../../../lib/utils.robot
George Keishing4840c832019-06-03 08:31:09 -05008Resource ../../../lib/boot_utils.robot
9Resource ../../../lib/esel_utils.robot
George Keishing6716d6a2019-06-03 10:18:20 -050010Resource ../../../lib/boot_utils.robot
11Variables ../../../data/variables.py
Chris Austenb29d2e82016-06-07 12:25:35 -050012
Steven Sombarfac31e92017-12-15 09:40:34 -060013Suite Setup Suite Setup Execution
14Suite Teardown Suite Teardown Execution
George Keishing6716d6a2019-06-03 10:18:20 -050015Test Setup Test Setup Execution
George Keishing505d5b42017-02-21 11:01:54 -060016Test Teardown FFDC On Test Case Fail
17
Matt Fischer6fb70d92023-10-24 19:06:33 -060018Test Tags eSEL
George Keishing505d5b42017-02-21 11:01:54 -060019
20*** Variables ***
21
Sridevi Ramesh2a2dbbd2025-03-18 00:57:14 -050022${stack_mode} skip
George Keishing505d5b42017-02-21 11:01:54 -060023
Sridevi Ramesh2a2dbbd2025-03-18 00:57:14 -050024${LOGGING_SERVICE} xyz.openbmc_project.Logging.service
Chris Austenb29d2e82016-06-07 12:25:35 -050025
Sridevi Ramesh2a2dbbd2025-03-18 00:57:14 -050026${ESEL_DATA} ESEL=00 00 df 00 00 00 00 20 00 04 12 35 6f aa 00 00
27
28${IPMI_RAW_PREFIX} 0x3a 0xf0 0x
George Keishing616c2782017-02-23 13:04:04 -060029
Chris Austenb29d2e82016-06-07 12:25:35 -050030*** Test Cases ***
31
George Keishing6716d6a2019-06-03 10:18:20 -050032Verify eSEL Using Redfish
33 [Documentation] Generate eSEL log and verify using redfish.
34 [Tags] Verify_eSEL_Using_Redfish
George Keishing505d5b42017-02-21 11:01:54 -060035
Sridevi Ramesh2a2dbbd2025-03-18 00:57:14 -050036 Create eSEL ${IPMI_RAW_PREFIX}
George Keishing6716d6a2019-06-03 10:18:20 -050037 Event Log Should Exist
George Keishing505d5b42017-02-21 11:01:54 -060038
Steven Sombar31b6bd02019-03-06 10:58:07 -060039
George Keishing6716d6a2019-06-03 10:18:20 -050040Verify eSEL Entries Using Redfish
George Keishing616c2782017-02-23 13:04:04 -060041 [Documentation] Verify that eSEL entries have data.
George Keishing6716d6a2019-06-03 10:18:20 -050042 [Tags] Verify_eSEL_Entries_Using_Redfish
Sridevi Ramesh87be0642017-05-19 01:20:50 -050043
Sridevi Ramesh2a2dbbd2025-03-18 00:57:14 -050044 Create eSEL ${IPMI_RAW_PREFIX}
George Keishing6716d6a2019-06-03 10:18:20 -050045 Redfish.Login
George Keishing616c2782017-02-23 13:04:04 -060046 Verify eSEL Entries
47
Steven Sombar31b6bd02019-03-06 10:58:07 -060048
George Keishing6716d6a2019-06-03 10:18:20 -050049# TODO: openbmc/openbmc-test-automation#1789
George Keishing146da7e2018-04-20 10:35:55 -050050Verify eSEL Description And EntryID Using REST
51 [Documentation] Create eSEL log and verify "Description" and "EntryID"
52 ... are not empty via REST.
53 [Tags] Verify_eSEL_Description_And_EntryID_Using_REST
54
55 # {
56 # "AdditionalData": [
57 # "CALLOUT_INVENTORY_PATH=",
58 # "ESEL=00 00 df 00 00 00 00 20 00 04 12 35 6f aa 00 00",
59 # "_PID=1175"
60 # ],
61 # "Description": "An error was detected with the base platform,
62 # but was not able to be deciphered. Contact your next level of support.",
63 # "EventID": "FQPSPAA0011M",
64 # "Id": 1,
65 # "Message": "org.open_power.Host.Error.Event",
66 # "Resolved": 0,
67 # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error",
68 # "Timestamp": 1524233022072,
George Keishing58520d02020-02-24 10:55:32 -060069 # "Associations": [
George Keishing146da7e2018-04-20 10:35:55 -050070 # [
71 # "callout",
72 # "fault",
73 # ""
74 # ]
75 # ]
76
Sridevi Ramesh2a2dbbd2025-03-18 00:57:14 -050077 Create eSEL ${IPMI_RAW_PREFIX}
George Keishing146da7e2018-04-20 10:35:55 -050078
79 ${elog_entry}= Get URL List ${BMC_LOGGING_ENTRY}
80 ${desc}= Read Attribute ${elog_entry[0]} Description
81 Should Not Be Empty ${desc} msg=${desc} is not populated.
82
83 ${event_id}= Read Attribute ${elog_entry[0]} EventID
84 Should Not Be Equal ${event_id} ${None}
85 ... msg=${event_id} is populated default "None".
86
George Keishing616c2782017-02-23 13:04:04 -060087
George Keishing6716d6a2019-06-03 10:18:20 -050088Verify Multiple eSEL Using Redfish
89 [Documentation] Generate multiple eSEL log and verify using redfish
90 [Tags] Verify_Multiple_eSEL_Using_Redfish
Sridevi Ramesh87be0642017-05-19 01:20:50 -050091
Sridevi Ramesh2a2dbbd2025-03-18 00:57:14 -050092 Create eSEL ${IPMI_RAW_PREFIX}
George Keishing616c2782017-02-23 13:04:04 -060093 ${entries}= Count eSEL Entries
Steven Sombar31b6bd02019-03-06 10:58:07 -060094 Should Be Equal As Integers ${entries} ${2}
95 ... msg=Expecting 2 eSELs but found ${entries}.
96
George Keishing616c2782017-02-23 13:04:04 -060097
George Keishing6716d6a2019-06-03 10:18:20 -050098# TODO: openbmc/openbmc-test-automation#1789
George Keishing3d14cfa2017-03-06 02:49:49 -060099Check eSEL AdditionalData
100 [Documentation] Generate eSEL log and verify AdditionalData is
101 ... not empty.
George Keishing3d14cfa2017-03-06 02:49:49 -0600102 [Tags] Check_eSEL_AdditionalData
Sridevi Ramesh87be0642017-05-19 01:20:50 -0500103
Sridevi Ramesh2a2dbbd2025-03-18 00:57:14 -0500104 Create eSEL ${IPMI_RAW_PREFIX}
Sweta Potthuri85c36c12017-07-03 05:30:44 -0500105 ${elog_entry}= Get URL List ${BMC_LOGGING_ENTRY}
106 ${resp}= OpenBMC Get Request ${elog_entry[0]}
George Keishing3d14cfa2017-03-06 02:49:49 -0600107 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
George Keishing3d14cfa2017-03-06 02:49:49 -0600108 # "/xyz/openbmc_project/logging/entry/1": {
109 # "Timestamp": 1487743771812,
110 # "AdditionalData": [],
111 # "Message": "org.open_power.Error.Host.Event.Event",
112 # "Id": 1,
113 # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Emergency"
114 # }
George Keishingfbd67002022-08-01 11:24:03 -0500115 Should Not Be Empty ${resp.json()["data"]["AdditionalData"]}
George Keishing3d14cfa2017-03-06 02:49:49 -0600116
Steven Sombar31b6bd02019-03-06 10:58:07 -0600117
Chris Austenb29d2e82016-06-07 12:25:35 -0500118Test Wrong Reservation_ID
Steven Sombara3f04392018-10-01 15:38:21 -0500119 [Documentation] This testcase is to test BMC can handle multi-requestor's
120 ... oem partial add command with incorrect reservation id.
121 ... It simulates sending partial add command with fake content
122 ... and wrong Reservation ID. This command will be rejected.
George Keishingcac24c72016-09-23 04:44:19 -0500123 [Tags] Test_Wrong_Reservation_ID
Gunnar Mills56b32892016-11-14 13:56:17 -0600124
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500125 ${rev_id_1}= Run Inband IPMI Raw Command 0x0a 0x42
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600126 ${rev_id_ls}= Get Substring ${rev_id_1} 1 3
127 ${rev_id_ms}= Get Substring ${rev_id_1} -2
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500128 Run Inband IPMI Raw Command 0x0a 0x42
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500129 ${output}= Check IPMI OEMpartialadd Reject
Sridevi Ramesh2a2dbbd2025-03-18 00:57:14 -0500130 ... ${IPMI_RAW_PREFIX}${rev_id_ls} 0x${rev_id_ms} 0 0 0 0 0 1 2 3 4 5 6 7 8 9 0xa 0xb 0xc 0xd 0xe 0xf
Chris Austenb29d2e82016-06-07 12:25:35 -0500131 Should Contain ${output} Reservation cancelled
132
133Test Correct Reservation_ID
Steven Sombara3f04392018-10-01 15:38:21 -0500134 [Documentation] This testcase is to test BMC can handle multi-requestor's
135 ... oem partial add command with correct reservation id. It
136 ... simulates sending partial add command with fake content
137 ... and correct Reservation ID. This command will be accepted.
George Keishingcac24c72016-09-23 04:44:19 -0500138 [Tags] Test_Correct_Reservation_ID
Gunnar Mills56b32892016-11-14 13:56:17 -0600139
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500140 Run Inband IPMI Raw Command 0x0a 0x42
141 ${rev_id_2}= Run Inband IPMI Raw Command 0x0a 0x42
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600142 ${rev_id_ls}= Get Substring ${rev_id_2} 1 3
143 ${rev_id_ms}= Get Substring ${rev_id_2} -2
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500144 ${output}= Check IPMI OEMpartialadd Accept
Sridevi Ramesh2a2dbbd2025-03-18 00:57:14 -0500145 ... ${IPMI_RAW_PREFIX}${rev_id_ls} 0x${rev_id_ms} 0 0 0 0 0 1 2 3 4 5 6 7 8 9 0xa 0xb 0xc 0xd 0xe 0xf
Chris Austenb29d2e82016-06-07 12:25:35 -0500146 Should Be Empty ${output}
147
Steven Sombara3f04392018-10-01 15:38:21 -0500148
Chris Austenb29d2e82016-06-07 12:25:35 -0500149*** Keywords ***
150
George Keishing616c2782017-02-23 13:04:04 -0600151
Steven Sombarfac31e92017-12-15 09:40:34 -0600152Suite Teardown Execution
George Keishing616c2782017-02-23 13:04:04 -0600153 [Documentation] Cleanup test logs and connection.
George Keishing616c2782017-02-23 13:04:04 -0600154 Close All Connections
George Keishing6716d6a2019-06-03 10:18:20 -0500155 Redfish.Logout
George Keishing616c2782017-02-23 13:04:04 -0600156
157
George Keishing505d5b42017-02-21 11:01:54 -0600158Restart Logging Service
159 [Documentation] Restart Logging to clear eSEL log.
160 ${MainPID} ${stderr}= Execute Command
161 ... systemctl restart ${LOGGING_SERVICE} return_stderr=True
162 Should Be Empty ${stderr}
163
164 Sleep 10s reason=Wait for service to restart properly.
165
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500166
Chris Austenb29d2e82016-06-07 12:25:35 -0500167Run IPMI Command Returned
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500168 [Documentation] Run the IPMI command and return the output.
Gunnar Mills38032802016-12-12 13:43:40 -0600169 [Arguments] ${args}
Sridevi Ramesh2a2dbbd2025-03-18 00:57:14 -0500170
171 # Description of Argument(s):
172 # args IPMI raw data
173 # (e.g: 0x00 0x03 0x03).
174
Sridevi Ramesh87be0642017-05-19 01:20:50 -0500175 ${output_1}= Execute Command /tmp/ipmitool -I dbus raw ${args}
George Keishing409df052024-01-17 22:36:14 +0530176 RETURN ${output_1}
Chris Austenb29d2e82016-06-07 12:25:35 -0500177
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500178
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500179Check IPMI OEMpartialadd Reject
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500180 [Documentation] Check if IPMI rejects the OEM partial add command.
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500181 [Arguments] ${args}
Sridevi Ramesh2a2dbbd2025-03-18 00:57:14 -0500182
183 # Description of Argument(s):
184 # args IPMI raw data
185 # (e.g: 0x00 0x03 0x03).
186
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500187 Login To OS Host ${OS_HOST} ${OS_USERNAME} ${OS_PASSWORD}
188 ${stdout} ${stderr} ${output_2}= Execute Command ipmitool raw ${args}
189 ... return_stdout=True return_stderr=True return_rc=True
George Keishing409df052024-01-17 22:36:14 +0530190 RETURN ${stderr}
Chris Austenb29d2e82016-06-07 12:25:35 -0500191
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500192
George Keishing6716d6a2019-06-03 10:18:20 -0500193Test Setup Execution
194 [Documentation] Do test case setup tasks.
195
196 Redfish.Login
197 Redfish Purge Event Log
198
199
Steven Sombarfac31e92017-12-15 09:40:34 -0600200Suite Setup Execution
Sridevi Ramesh87be0642017-05-19 01:20:50 -0500201 [Documentation] Validates input parameters & check if HOST OS is up.
202
203 Should Not Be Empty
204 ... ${OS_HOST} msg=You must provide DNS name/IP of the OS host.
205 Should Not Be Empty
206 ... ${OS_USERNAME} msg=You must provide OS host user name.
207 Should Not Be Empty
208 ... ${OS_PASSWORD} msg=You must provide OS host user password.
209
Sweta Potthurib2c50f12017-06-28 03:53:30 -0500210 # Boot to OS.
George Keishing6716d6a2019-06-03 10:18:20 -0500211 Redfish Power On
212
213 Redfish.Login
214 Redfish Purge Event Log
Sweta Potthurib2c50f12017-06-28 03:53:30 -0500215
Sridevi Ramesh87be0642017-05-19 01:20:50 -0500216 Login To OS Host ${OS_HOST} ${OS_USERNAME} ${OS_PASSWORD}
217 Open Connection And Log In
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500218
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500219
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500220Check IPMI OEMpartialadd Accept
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500221 [Documentation] Check if IPMI accepts the OEM partial add command.
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500222 [Arguments] ${args}
Sridevi Ramesh2a2dbbd2025-03-18 00:57:14 -0500223
224 # Description of Argument(s):
225 # args IPMI raw data
226 # (e.g: 0x00 0x03 0x03).
227
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500228 Login To OS Host ${OS_HOST} ${OS_USERNAME} ${OS_PASSWORD}
229 ${stdout} ${stderr} ${output_3}= Execute Command ipmitool raw ${args}
230 ... return_stdout=True return_stderr=True return_rc=True
231 Should Be Equal ${output_3} ${0} msg=${stderr}
George Keishing409df052024-01-17 22:36:14 +0530232 RETURN ${stderr}
George Keishing6716d6a2019-06-03 10:18:20 -0500233
234
235Event Log Should Exist
236 [Documentation] Event log entries should exist.
237
238 ${elogs}= Get Event Logs
239 Should Not Be Empty ${elogs} msg=System event log entry is not empty.