blob: eafa165c18fd469ba6aae467342ba76683f42c35 [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/esel_utils.robot
George Keishing6716d6a2019-06-03 10:18:20 -05009Resource ../../../lib/boot_utils.robot
10Variables ../../../data/variables.py
Chris Austenb29d2e82016-06-07 12:25:35 -050011
Steven Sombarfac31e92017-12-15 09:40:34 -060012Suite Setup Suite Setup Execution
13Suite Teardown Suite Teardown Execution
George Keishing6716d6a2019-06-03 10:18:20 -050014Test Setup Test Setup Execution
George Keishing505d5b42017-02-21 11:01:54 -060015Test Teardown FFDC On Test Case Fail
16
Matt Fischer6fb70d92023-10-24 19:06:33 -060017Test Tags eSEL
George Keishing505d5b42017-02-21 11:01:54 -060018
19*** Variables ***
20
Sridevi Ramesh2a2dbbd2025-03-18 00:57:14 -050021${stack_mode} skip
George Keishing505d5b42017-02-21 11:01:54 -060022
Sridevi Ramesh2a2dbbd2025-03-18 00:57:14 -050023${LOGGING_SERVICE} xyz.openbmc_project.Logging.service
Chris Austenb29d2e82016-06-07 12:25:35 -050024
Sridevi Ramesh2a2dbbd2025-03-18 00:57:14 -050025${ESEL_DATA} ESEL=00 00 df 00 00 00 00 20 00 04 12 35 6f aa 00 00
26
27${IPMI_RAW_PREFIX} 0x3a 0xf0 0x
George Keishing616c2782017-02-23 13:04:04 -060028
Chris Austenb29d2e82016-06-07 12:25:35 -050029*** Test Cases ***
30
George Keishing6716d6a2019-06-03 10:18:20 -050031Verify eSEL Using Redfish
32 [Documentation] Generate eSEL log and verify using redfish.
33 [Tags] Verify_eSEL_Using_Redfish
George Keishing505d5b42017-02-21 11:01:54 -060034
Sridevi Ramesh2a2dbbd2025-03-18 00:57:14 -050035 Create eSEL ${IPMI_RAW_PREFIX}
George Keishing6716d6a2019-06-03 10:18:20 -050036 Event Log Should Exist
George Keishing505d5b42017-02-21 11:01:54 -060037
Steven Sombar31b6bd02019-03-06 10:58:07 -060038
George Keishing6716d6a2019-06-03 10:18:20 -050039Verify eSEL Entries Using Redfish
George Keishing616c2782017-02-23 13:04:04 -060040 [Documentation] Verify that eSEL entries have data.
George Keishing6716d6a2019-06-03 10:18:20 -050041 [Tags] Verify_eSEL_Entries_Using_Redfish
Sridevi Ramesh87be0642017-05-19 01:20:50 -050042
Sridevi Ramesh2a2dbbd2025-03-18 00:57:14 -050043 Create eSEL ${IPMI_RAW_PREFIX}
George Keishing6716d6a2019-06-03 10:18:20 -050044 Redfish.Login
George Keishing616c2782017-02-23 13:04:04 -060045 Verify eSEL Entries
46
Steven Sombar31b6bd02019-03-06 10:58:07 -060047
George Keishing146da7e2018-04-20 10:35:55 -050048Verify eSEL Description And EntryID Using REST
49 [Documentation] Create eSEL log and verify "Description" and "EntryID"
50 ... are not empty via REST.
51 [Tags] Verify_eSEL_Description_And_EntryID_Using_REST
52
53 # {
54 # "AdditionalData": [
55 # "CALLOUT_INVENTORY_PATH=",
56 # "ESEL=00 00 df 00 00 00 00 20 00 04 12 35 6f aa 00 00",
57 # "_PID=1175"
58 # ],
59 # "Description": "An error was detected with the base platform,
60 # but was not able to be deciphered. Contact your next level of support.",
61 # "EventID": "FQPSPAA0011M",
62 # "Id": 1,
63 # "Message": "org.open_power.Host.Error.Event",
64 # "Resolved": 0,
65 # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error",
66 # "Timestamp": 1524233022072,
George Keishing58520d02020-02-24 10:55:32 -060067 # "Associations": [
George Keishing146da7e2018-04-20 10:35:55 -050068 # [
69 # "callout",
70 # "fault",
71 # ""
72 # ]
73 # ]
74
Sridevi Ramesh2a2dbbd2025-03-18 00:57:14 -050075 Create eSEL ${IPMI_RAW_PREFIX}
George Keishing146da7e2018-04-20 10:35:55 -050076
77 ${elog_entry}= Get URL List ${BMC_LOGGING_ENTRY}
78 ${desc}= Read Attribute ${elog_entry[0]} Description
79 Should Not Be Empty ${desc} msg=${desc} is not populated.
80
81 ${event_id}= Read Attribute ${elog_entry[0]} EventID
82 Should Not Be Equal ${event_id} ${None}
83 ... msg=${event_id} is populated default "None".
84
George Keishing616c2782017-02-23 13:04:04 -060085
George Keishing6716d6a2019-06-03 10:18:20 -050086Verify Multiple eSEL Using Redfish
87 [Documentation] Generate multiple eSEL log and verify using redfish
88 [Tags] Verify_Multiple_eSEL_Using_Redfish
Sridevi Ramesh87be0642017-05-19 01:20:50 -050089
Sridevi Ramesh2a2dbbd2025-03-18 00:57:14 -050090 Create eSEL ${IPMI_RAW_PREFIX}
George Keishing616c2782017-02-23 13:04:04 -060091 ${entries}= Count eSEL Entries
Steven Sombar31b6bd02019-03-06 10:58:07 -060092 Should Be Equal As Integers ${entries} ${2}
93 ... msg=Expecting 2 eSELs but found ${entries}.
94
George Keishing616c2782017-02-23 13:04:04 -060095
George Keishing3d14cfa2017-03-06 02:49:49 -060096Check eSEL AdditionalData
97 [Documentation] Generate eSEL log and verify AdditionalData is
98 ... not empty.
George Keishing3d14cfa2017-03-06 02:49:49 -060099 [Tags] Check_eSEL_AdditionalData
Sridevi Ramesh87be0642017-05-19 01:20:50 -0500100
Sridevi Ramesh2a2dbbd2025-03-18 00:57:14 -0500101 Create eSEL ${IPMI_RAW_PREFIX}
Sweta Potthuri85c36c12017-07-03 05:30:44 -0500102 ${elog_entry}= Get URL List ${BMC_LOGGING_ENTRY}
103 ${resp}= OpenBMC Get Request ${elog_entry[0]}
George Keishing3d14cfa2017-03-06 02:49:49 -0600104 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
George Keishing3d14cfa2017-03-06 02:49:49 -0600105 # "/xyz/openbmc_project/logging/entry/1": {
106 # "Timestamp": 1487743771812,
107 # "AdditionalData": [],
108 # "Message": "org.open_power.Error.Host.Event.Event",
109 # "Id": 1,
110 # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Emergency"
111 # }
George Keishingfbd67002022-08-01 11:24:03 -0500112 Should Not Be Empty ${resp.json()["data"]["AdditionalData"]}
George Keishing3d14cfa2017-03-06 02:49:49 -0600113
Steven Sombar31b6bd02019-03-06 10:58:07 -0600114
Chris Austenb29d2e82016-06-07 12:25:35 -0500115Test Wrong Reservation_ID
Steven Sombara3f04392018-10-01 15:38:21 -0500116 [Documentation] This testcase is to test BMC can handle multi-requestor's
117 ... oem partial add command with incorrect reservation id.
118 ... It simulates sending partial add command with fake content
119 ... and wrong Reservation ID. This command will be rejected.
George Keishingcac24c72016-09-23 04:44:19 -0500120 [Tags] Test_Wrong_Reservation_ID
Gunnar Mills56b32892016-11-14 13:56:17 -0600121
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500122 ${rev_id_1}= Run Inband IPMI Raw Command 0x0a 0x42
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600123 ${rev_id_ls}= Get Substring ${rev_id_1} 1 3
124 ${rev_id_ms}= Get Substring ${rev_id_1} -2
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500125 Run Inband IPMI Raw Command 0x0a 0x42
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500126 ${output}= Check IPMI OEMpartialadd Reject
Sridevi Ramesh2a2dbbd2025-03-18 00:57:14 -0500127 ... ${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 -0500128 Should Contain ${output} Reservation cancelled
129
130Test Correct Reservation_ID
Steven Sombara3f04392018-10-01 15:38:21 -0500131 [Documentation] This testcase is to test BMC can handle multi-requestor's
132 ... oem partial add command with correct reservation id. It
133 ... simulates sending partial add command with fake content
134 ... and correct Reservation ID. This command will be accepted.
George Keishingcac24c72016-09-23 04:44:19 -0500135 [Tags] Test_Correct_Reservation_ID
Gunnar Mills56b32892016-11-14 13:56:17 -0600136
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500137 Run Inband IPMI Raw Command 0x0a 0x42
138 ${rev_id_2}= Run Inband IPMI Raw Command 0x0a 0x42
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600139 ${rev_id_ls}= Get Substring ${rev_id_2} 1 3
140 ${rev_id_ms}= Get Substring ${rev_id_2} -2
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500141 ${output}= Check IPMI OEMpartialadd Accept
Sridevi Ramesh2a2dbbd2025-03-18 00:57:14 -0500142 ... ${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 -0500143 Should Be Empty ${output}
144
Steven Sombara3f04392018-10-01 15:38:21 -0500145
Chris Austenb29d2e82016-06-07 12:25:35 -0500146*** Keywords ***
147
George Keishing616c2782017-02-23 13:04:04 -0600148
Steven Sombarfac31e92017-12-15 09:40:34 -0600149Suite Teardown Execution
George Keishing616c2782017-02-23 13:04:04 -0600150 [Documentation] Cleanup test logs and connection.
George Keishing616c2782017-02-23 13:04:04 -0600151 Close All Connections
George Keishing6716d6a2019-06-03 10:18:20 -0500152 Redfish.Logout
George Keishing616c2782017-02-23 13:04:04 -0600153
154
George Keishing505d5b42017-02-21 11:01:54 -0600155Restart Logging Service
156 [Documentation] Restart Logging to clear eSEL log.
157 ${MainPID} ${stderr}= Execute Command
158 ... systemctl restart ${LOGGING_SERVICE} return_stderr=True
159 Should Be Empty ${stderr}
160
161 Sleep 10s reason=Wait for service to restart properly.
162
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500163
Chris Austenb29d2e82016-06-07 12:25:35 -0500164Run IPMI Command Returned
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500165 [Documentation] Run the IPMI command and return the output.
Gunnar Mills38032802016-12-12 13:43:40 -0600166 [Arguments] ${args}
Sridevi Ramesh2a2dbbd2025-03-18 00:57:14 -0500167
168 # Description of Argument(s):
169 # args IPMI raw data
170 # (e.g: 0x00 0x03 0x03).
171
Sridevi Ramesh87be0642017-05-19 01:20:50 -0500172 ${output_1}= Execute Command /tmp/ipmitool -I dbus raw ${args}
George Keishing409df052024-01-17 22:36:14 +0530173 RETURN ${output_1}
Chris Austenb29d2e82016-06-07 12:25:35 -0500174
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500175
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500176Check IPMI OEMpartialadd Reject
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500177 [Documentation] Check if IPMI rejects the OEM partial add command.
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500178 [Arguments] ${args}
Sridevi Ramesh2a2dbbd2025-03-18 00:57:14 -0500179
180 # Description of Argument(s):
181 # args IPMI raw data
182 # (e.g: 0x00 0x03 0x03).
183
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500184 Login To OS Host ${OS_HOST} ${OS_USERNAME} ${OS_PASSWORD}
185 ${stdout} ${stderr} ${output_2}= Execute Command ipmitool raw ${args}
186 ... return_stdout=True return_stderr=True return_rc=True
George Keishing409df052024-01-17 22:36:14 +0530187 RETURN ${stderr}
Chris Austenb29d2e82016-06-07 12:25:35 -0500188
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500189
George Keishing6716d6a2019-06-03 10:18:20 -0500190Test Setup Execution
191 [Documentation] Do test case setup tasks.
192
193 Redfish.Login
194 Redfish Purge Event Log
195
196
Steven Sombarfac31e92017-12-15 09:40:34 -0600197Suite Setup Execution
Sridevi Ramesh87be0642017-05-19 01:20:50 -0500198 [Documentation] Validates input parameters & check if HOST OS is up.
199
200 Should Not Be Empty
201 ... ${OS_HOST} msg=You must provide DNS name/IP of the OS host.
202 Should Not Be Empty
203 ... ${OS_USERNAME} msg=You must provide OS host user name.
204 Should Not Be Empty
205 ... ${OS_PASSWORD} msg=You must provide OS host user password.
206
Sweta Potthurib2c50f12017-06-28 03:53:30 -0500207 # Boot to OS.
George Keishing6716d6a2019-06-03 10:18:20 -0500208 Redfish Power On
209
210 Redfish.Login
211 Redfish Purge Event Log
Sweta Potthurib2c50f12017-06-28 03:53:30 -0500212
Sridevi Ramesh87be0642017-05-19 01:20:50 -0500213 Login To OS Host ${OS_HOST} ${OS_USERNAME} ${OS_PASSWORD}
214 Open Connection And Log In
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500215
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500216
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500217Check IPMI OEMpartialadd Accept
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500218 [Documentation] Check if IPMI accepts the OEM partial add command.
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500219 [Arguments] ${args}
Sridevi Ramesh2a2dbbd2025-03-18 00:57:14 -0500220
221 # Description of Argument(s):
222 # args IPMI raw data
223 # (e.g: 0x00 0x03 0x03).
224
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500225 Login To OS Host ${OS_HOST} ${OS_USERNAME} ${OS_PASSWORD}
226 ${stdout} ${stderr} ${output_3}= Execute Command ipmitool raw ${args}
227 ... return_stdout=True return_stderr=True return_rc=True
228 Should Be Equal ${output_3} ${0} msg=${stderr}
George Keishing409df052024-01-17 22:36:14 +0530229 RETURN ${stderr}
George Keishing6716d6a2019-06-03 10:18:20 -0500230
231
232Event Log Should Exist
233 [Documentation] Event log entries should exist.
234
235 ${elogs}= Get Event Logs
236 Should Not Be Empty ${elogs} msg=System event log entry is not empty.