blob: 56c51a230571272589e344e7b7bc3f01837053b9 [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 Keishing146da7e2018-04-20 10:35:55 -050049Verify eSEL Description And EntryID Using REST
50 [Documentation] Create eSEL log and verify "Description" and "EntryID"
51 ... are not empty via REST.
52 [Tags] Verify_eSEL_Description_And_EntryID_Using_REST
53
54 # {
55 # "AdditionalData": [
56 # "CALLOUT_INVENTORY_PATH=",
57 # "ESEL=00 00 df 00 00 00 00 20 00 04 12 35 6f aa 00 00",
58 # "_PID=1175"
59 # ],
60 # "Description": "An error was detected with the base platform,
61 # but was not able to be deciphered. Contact your next level of support.",
62 # "EventID": "FQPSPAA0011M",
63 # "Id": 1,
64 # "Message": "org.open_power.Host.Error.Event",
65 # "Resolved": 0,
66 # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error",
67 # "Timestamp": 1524233022072,
George Keishing58520d02020-02-24 10:55:32 -060068 # "Associations": [
George Keishing146da7e2018-04-20 10:35:55 -050069 # [
70 # "callout",
71 # "fault",
72 # ""
73 # ]
74 # ]
75
Sridevi Ramesh2a2dbbd2025-03-18 00:57:14 -050076 Create eSEL ${IPMI_RAW_PREFIX}
George Keishing146da7e2018-04-20 10:35:55 -050077
78 ${elog_entry}= Get URL List ${BMC_LOGGING_ENTRY}
79 ${desc}= Read Attribute ${elog_entry[0]} Description
80 Should Not Be Empty ${desc} msg=${desc} is not populated.
81
82 ${event_id}= Read Attribute ${elog_entry[0]} EventID
83 Should Not Be Equal ${event_id} ${None}
84 ... msg=${event_id} is populated default "None".
85
George Keishing616c2782017-02-23 13:04:04 -060086
George Keishing6716d6a2019-06-03 10:18:20 -050087Verify Multiple eSEL Using Redfish
88 [Documentation] Generate multiple eSEL log and verify using redfish
89 [Tags] Verify_Multiple_eSEL_Using_Redfish
Sridevi Ramesh87be0642017-05-19 01:20:50 -050090
Sridevi Ramesh2a2dbbd2025-03-18 00:57:14 -050091 Create eSEL ${IPMI_RAW_PREFIX}
George Keishing616c2782017-02-23 13:04:04 -060092 ${entries}= Count eSEL Entries
Steven Sombar31b6bd02019-03-06 10:58:07 -060093 Should Be Equal As Integers ${entries} ${2}
94 ... msg=Expecting 2 eSELs but found ${entries}.
95
George Keishing616c2782017-02-23 13:04:04 -060096
George Keishing3d14cfa2017-03-06 02:49:49 -060097Check eSEL AdditionalData
98 [Documentation] Generate eSEL log and verify AdditionalData is
99 ... not empty.
George Keishing3d14cfa2017-03-06 02:49:49 -0600100 [Tags] Check_eSEL_AdditionalData
Sridevi Ramesh87be0642017-05-19 01:20:50 -0500101
Sridevi Ramesh2a2dbbd2025-03-18 00:57:14 -0500102 Create eSEL ${IPMI_RAW_PREFIX}
Sweta Potthuri85c36c12017-07-03 05:30:44 -0500103 ${elog_entry}= Get URL List ${BMC_LOGGING_ENTRY}
104 ${resp}= OpenBMC Get Request ${elog_entry[0]}
George Keishing3d14cfa2017-03-06 02:49:49 -0600105 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
George Keishing3d14cfa2017-03-06 02:49:49 -0600106 # "/xyz/openbmc_project/logging/entry/1": {
107 # "Timestamp": 1487743771812,
108 # "AdditionalData": [],
109 # "Message": "org.open_power.Error.Host.Event.Event",
110 # "Id": 1,
111 # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Emergency"
112 # }
George Keishingfbd67002022-08-01 11:24:03 -0500113 Should Not Be Empty ${resp.json()["data"]["AdditionalData"]}
George Keishing3d14cfa2017-03-06 02:49:49 -0600114
Steven Sombar31b6bd02019-03-06 10:58:07 -0600115
Chris Austenb29d2e82016-06-07 12:25:35 -0500116Test Wrong Reservation_ID
Steven Sombara3f04392018-10-01 15:38:21 -0500117 [Documentation] This testcase is to test BMC can handle multi-requestor's
118 ... oem partial add command with incorrect reservation id.
119 ... It simulates sending partial add command with fake content
120 ... and wrong Reservation ID. This command will be rejected.
George Keishingcac24c72016-09-23 04:44:19 -0500121 [Tags] Test_Wrong_Reservation_ID
Gunnar Mills56b32892016-11-14 13:56:17 -0600122
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500123 ${rev_id_1}= Run Inband IPMI Raw Command 0x0a 0x42
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600124 ${rev_id_ls}= Get Substring ${rev_id_1} 1 3
125 ${rev_id_ms}= Get Substring ${rev_id_1} -2
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500126 Run Inband IPMI Raw Command 0x0a 0x42
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500127 ${output}= Check IPMI OEMpartialadd Reject
Sridevi Ramesh2a2dbbd2025-03-18 00:57:14 -0500128 ... ${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 -0500129 Should Contain ${output} Reservation cancelled
130
131Test Correct Reservation_ID
Steven Sombara3f04392018-10-01 15:38:21 -0500132 [Documentation] This testcase is to test BMC can handle multi-requestor's
133 ... oem partial add command with correct reservation id. It
134 ... simulates sending partial add command with fake content
135 ... and correct Reservation ID. This command will be accepted.
George Keishingcac24c72016-09-23 04:44:19 -0500136 [Tags] Test_Correct_Reservation_ID
Gunnar Mills56b32892016-11-14 13:56:17 -0600137
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500138 Run Inband IPMI Raw Command 0x0a 0x42
139 ${rev_id_2}= Run Inband IPMI Raw Command 0x0a 0x42
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600140 ${rev_id_ls}= Get Substring ${rev_id_2} 1 3
141 ${rev_id_ms}= Get Substring ${rev_id_2} -2
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500142 ${output}= Check IPMI OEMpartialadd Accept
Sridevi Ramesh2a2dbbd2025-03-18 00:57:14 -0500143 ... ${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 -0500144 Should Be Empty ${output}
145
Steven Sombara3f04392018-10-01 15:38:21 -0500146
Chris Austenb29d2e82016-06-07 12:25:35 -0500147*** Keywords ***
148
George Keishing616c2782017-02-23 13:04:04 -0600149
Steven Sombarfac31e92017-12-15 09:40:34 -0600150Suite Teardown Execution
George Keishing616c2782017-02-23 13:04:04 -0600151 [Documentation] Cleanup test logs and connection.
George Keishing616c2782017-02-23 13:04:04 -0600152 Close All Connections
George Keishing6716d6a2019-06-03 10:18:20 -0500153 Redfish.Logout
George Keishing616c2782017-02-23 13:04:04 -0600154
155
George Keishing505d5b42017-02-21 11:01:54 -0600156Restart Logging Service
157 [Documentation] Restart Logging to clear eSEL log.
158 ${MainPID} ${stderr}= Execute Command
159 ... systemctl restart ${LOGGING_SERVICE} return_stderr=True
160 Should Be Empty ${stderr}
161
162 Sleep 10s reason=Wait for service to restart properly.
163
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500164
Chris Austenb29d2e82016-06-07 12:25:35 -0500165Run IPMI Command Returned
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500166 [Documentation] Run the IPMI command and return the output.
Gunnar Mills38032802016-12-12 13:43:40 -0600167 [Arguments] ${args}
Sridevi Ramesh2a2dbbd2025-03-18 00:57:14 -0500168
169 # Description of Argument(s):
170 # args IPMI raw data
171 # (e.g: 0x00 0x03 0x03).
172
Sridevi Ramesh87be0642017-05-19 01:20:50 -0500173 ${output_1}= Execute Command /tmp/ipmitool -I dbus raw ${args}
George Keishing409df052024-01-17 22:36:14 +0530174 RETURN ${output_1}
Chris Austenb29d2e82016-06-07 12:25:35 -0500175
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500176
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500177Check IPMI OEMpartialadd Reject
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500178 [Documentation] Check if IPMI rejects the OEM partial add command.
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500179 [Arguments] ${args}
Sridevi Ramesh2a2dbbd2025-03-18 00:57:14 -0500180
181 # Description of Argument(s):
182 # args IPMI raw data
183 # (e.g: 0x00 0x03 0x03).
184
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500185 Login To OS Host ${OS_HOST} ${OS_USERNAME} ${OS_PASSWORD}
186 ${stdout} ${stderr} ${output_2}= Execute Command ipmitool raw ${args}
187 ... return_stdout=True return_stderr=True return_rc=True
George Keishing409df052024-01-17 22:36:14 +0530188 RETURN ${stderr}
Chris Austenb29d2e82016-06-07 12:25:35 -0500189
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500190
George Keishing6716d6a2019-06-03 10:18:20 -0500191Test Setup Execution
192 [Documentation] Do test case setup tasks.
193
194 Redfish.Login
195 Redfish Purge Event Log
196
197
Steven Sombarfac31e92017-12-15 09:40:34 -0600198Suite Setup Execution
Sridevi Ramesh87be0642017-05-19 01:20:50 -0500199 [Documentation] Validates input parameters & check if HOST OS is up.
200
201 Should Not Be Empty
202 ... ${OS_HOST} msg=You must provide DNS name/IP of the OS host.
203 Should Not Be Empty
204 ... ${OS_USERNAME} msg=You must provide OS host user name.
205 Should Not Be Empty
206 ... ${OS_PASSWORD} msg=You must provide OS host user password.
207
Sweta Potthurib2c50f12017-06-28 03:53:30 -0500208 # Boot to OS.
George Keishing6716d6a2019-06-03 10:18:20 -0500209 Redfish Power On
210
211 Redfish.Login
212 Redfish Purge Event Log
Sweta Potthurib2c50f12017-06-28 03:53:30 -0500213
Sridevi Ramesh87be0642017-05-19 01:20:50 -0500214 Login To OS Host ${OS_HOST} ${OS_USERNAME} ${OS_PASSWORD}
215 Open Connection And Log In
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500216
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500217
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500218Check IPMI OEMpartialadd Accept
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500219 [Documentation] Check if IPMI accepts the OEM partial add command.
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500220 [Arguments] ${args}
Sridevi Ramesh2a2dbbd2025-03-18 00:57:14 -0500221
222 # Description of Argument(s):
223 # args IPMI raw data
224 # (e.g: 0x00 0x03 0x03).
225
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500226 Login To OS Host ${OS_HOST} ${OS_USERNAME} ${OS_PASSWORD}
227 ${stdout} ${stderr} ${output_3}= Execute Command ipmitool raw ${args}
228 ... return_stdout=True return_stderr=True return_rc=True
229 Should Be Equal ${output_3} ${0} msg=${stderr}
George Keishing409df052024-01-17 22:36:14 +0530230 RETURN ${stderr}
George Keishing6716d6a2019-06-03 10:18:20 -0500231
232
233Event Log Should Exist
234 [Documentation] Event log entries should exist.
235
236 ${elogs}= Get Event Logs
237 Should Not Be Empty ${elogs} msg=System event log entry is not empty.