blob: 7381f6e5941a3d41b59a6a18fa598dea8e75ffef [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
18Force Tags eSEL_Logging
19
20*** Variables ***
21
Sweta Potthuriaf741cb2017-07-04 09:41:17 -050022${stack_mode} skip
George Keishing505d5b42017-02-21 11:01:54 -060023
24${LOGGING_SERVICE} xyz.openbmc_project.Logging.service
Chris Austenb29d2e82016-06-07 12:25:35 -050025
George Keishing616c2782017-02-23 13:04:04 -060026${ESEL_DATA} ESEL=00 00 df 00 00 00 00 20 00 04 12 35 6f aa 00 00
27
Chris Austenb29d2e82016-06-07 12:25:35 -050028*** Test Cases ***
29
George Keishing6716d6a2019-06-03 10:18:20 -050030Verify eSEL Using Redfish
31 [Documentation] Generate eSEL log and verify using redfish.
32 [Tags] Verify_eSEL_Using_Redfish
George Keishing505d5b42017-02-21 11:01:54 -060033
George Keishing616c2782017-02-23 13:04:04 -060034 Create eSEL
George Keishing6716d6a2019-06-03 10:18:20 -050035 Event Log Should Exist
George Keishing505d5b42017-02-21 11:01:54 -060036
Steven Sombar31b6bd02019-03-06 10:58:07 -060037
George Keishing6716d6a2019-06-03 10:18:20 -050038Verify eSEL Entries Using Redfish
George Keishing616c2782017-02-23 13:04:04 -060039 [Documentation] Verify that eSEL entries have data.
George Keishing6716d6a2019-06-03 10:18:20 -050040 [Tags] Verify_eSEL_Entries_Using_Redfish
Sridevi Ramesh87be0642017-05-19 01:20:50 -050041
George Keishing616c2782017-02-23 13:04:04 -060042 Create eSEL
George Keishing6716d6a2019-06-03 10:18:20 -050043 Redfish.Login
George Keishing616c2782017-02-23 13:04:04 -060044 Verify eSEL Entries
45
Steven Sombar31b6bd02019-03-06 10:58:07 -060046
George Keishing6716d6a2019-06-03 10:18:20 -050047# TODO: openbmc/openbmc-test-automation#1789
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
75 Create eSEL
76
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
George Keishing616c2782017-02-23 13:04:04 -060090 Create eSEL
91 Create eSEL
92 ${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 Keishing6716d6a2019-06-03 10:18:20 -050097# TODO: openbmc/openbmc-test-automation#1789
George Keishing3d14cfa2017-03-06 02:49:49 -060098Check eSEL AdditionalData
99 [Documentation] Generate eSEL log and verify AdditionalData is
100 ... not empty.
George Keishing3d14cfa2017-03-06 02:49:49 -0600101 [Tags] Check_eSEL_AdditionalData
Sridevi Ramesh87be0642017-05-19 01:20:50 -0500102
George Keishing3d14cfa2017-03-06 02:49:49 -0600103 Create eSEL
Sweta Potthuri85c36c12017-07-03 05:30:44 -0500104 ${elog_entry}= Get URL List ${BMC_LOGGING_ENTRY}
105 ${resp}= OpenBMC Get Request ${elog_entry[0]}
George Keishing3d14cfa2017-03-06 02:49:49 -0600106 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
George Keishing3d14cfa2017-03-06 02:49:49 -0600107 # "/xyz/openbmc_project/logging/entry/1": {
108 # "Timestamp": 1487743771812,
109 # "AdditionalData": [],
110 # "Message": "org.open_power.Error.Host.Event.Event",
111 # "Id": 1,
112 # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Emergency"
113 # }
George Keishingfbd67002022-08-01 11:24:03 -0500114 Should Not Be Empty ${resp.json()["data"]["AdditionalData"]}
George Keishing3d14cfa2017-03-06 02:49:49 -0600115
Steven Sombar31b6bd02019-03-06 10:58:07 -0600116
Chris Austenb29d2e82016-06-07 12:25:35 -0500117Test Wrong Reservation_ID
Steven Sombara3f04392018-10-01 15:38:21 -0500118 [Documentation] This testcase is to test BMC can handle multi-requestor's
119 ... oem partial add command with incorrect reservation id.
120 ... It simulates sending partial add command with fake content
121 ... and wrong Reservation ID. This command will be rejected.
George Keishingcac24c72016-09-23 04:44:19 -0500122 [Tags] Test_Wrong_Reservation_ID
Gunnar Mills56b32892016-11-14 13:56:17 -0600123
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500124 ${rev_id_1}= Run Inband IPMI Raw Command 0x0a 0x42
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600125 ${rev_id_ls}= Get Substring ${rev_id_1} 1 3
126 ${rev_id_ms}= Get Substring ${rev_id_1} -2
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500127 Run Inband IPMI Raw Command 0x0a 0x42
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500128 ${output}= Check IPMI OEMpartialadd Reject
129 ... 0x3a 0xf0 0x${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 -0500130 Should Contain ${output} Reservation cancelled
131
132Test Correct Reservation_ID
Steven Sombara3f04392018-10-01 15:38:21 -0500133 [Documentation] This testcase is to test BMC can handle multi-requestor's
134 ... oem partial add command with correct reservation id. It
135 ... simulates sending partial add command with fake content
136 ... and correct Reservation ID. This command will be accepted.
George Keishingcac24c72016-09-23 04:44:19 -0500137 [Tags] Test_Correct_Reservation_ID
Gunnar Mills56b32892016-11-14 13:56:17 -0600138
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500139 Run Inband IPMI Raw Command 0x0a 0x42
140 ${rev_id_2}= Run Inband IPMI Raw Command 0x0a 0x42
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600141 ${rev_id_ls}= Get Substring ${rev_id_2} 1 3
142 ${rev_id_ms}= Get Substring ${rev_id_2} -2
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500143 ${output}= Check IPMI OEMpartialadd Accept
144 ... 0x3a 0xf0 0x${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 -0500145 Should Be Empty ${output}
146
Steven Sombara3f04392018-10-01 15:38:21 -0500147
Chris Austenb29d2e82016-06-07 12:25:35 -0500148*** Keywords ***
149
George Keishing616c2782017-02-23 13:04:04 -0600150
Steven Sombarfac31e92017-12-15 09:40:34 -0600151Suite Teardown Execution
George Keishing616c2782017-02-23 13:04:04 -0600152 [Documentation] Cleanup test logs and connection.
George Keishing616c2782017-02-23 13:04:04 -0600153 Close All Connections
George Keishing6716d6a2019-06-03 10:18:20 -0500154 Redfish.Logout
George Keishing616c2782017-02-23 13:04:04 -0600155
156
George Keishing505d5b42017-02-21 11:01:54 -0600157Restart Logging Service
158 [Documentation] Restart Logging to clear eSEL log.
159 ${MainPID} ${stderr}= Execute Command
160 ... systemctl restart ${LOGGING_SERVICE} return_stderr=True
161 Should Be Empty ${stderr}
162
163 Sleep 10s reason=Wait for service to restart properly.
164
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500165
Chris Austenb29d2e82016-06-07 12:25:35 -0500166Run IPMI Command Returned
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500167 [Documentation] Run the IPMI command and return the output.
Gunnar Mills38032802016-12-12 13:43:40 -0600168 [Arguments] ${args}
Sridevi Ramesh87be0642017-05-19 01:20:50 -0500169 ${output_1}= Execute Command /tmp/ipmitool -I dbus raw ${args}
Gunnar Millsc9ea9362016-12-13 16:21:13 -0600170 [Return] ${output_1}
Chris Austenb29d2e82016-06-07 12:25:35 -0500171
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500172
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500173Check IPMI OEMpartialadd Reject
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500174 [Documentation] Check if IPMI rejects the OEM partial add command.
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500175 [Arguments] ${args}
176 Login To OS Host ${OS_HOST} ${OS_USERNAME} ${OS_PASSWORD}
177 ${stdout} ${stderr} ${output_2}= Execute Command ipmitool raw ${args}
178 ... return_stdout=True return_stderr=True return_rc=True
Sridevi Ramesh87be0642017-05-19 01:20:50 -0500179 [Return] ${stderr}
Chris Austenb29d2e82016-06-07 12:25:35 -0500180
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500181
George Keishing6716d6a2019-06-03 10:18:20 -0500182Test Setup Execution
183 [Documentation] Do test case setup tasks.
184
185 Redfish.Login
186 Redfish Purge Event Log
187
188
Steven Sombarfac31e92017-12-15 09:40:34 -0600189Suite Setup Execution
Sridevi Ramesh87be0642017-05-19 01:20:50 -0500190 [Documentation] Validates input parameters & check if HOST OS is up.
191
192 Should Not Be Empty
193 ... ${OS_HOST} msg=You must provide DNS name/IP of the OS host.
194 Should Not Be Empty
195 ... ${OS_USERNAME} msg=You must provide OS host user name.
196 Should Not Be Empty
197 ... ${OS_PASSWORD} msg=You must provide OS host user password.
198
Sweta Potthurib2c50f12017-06-28 03:53:30 -0500199 # Boot to OS.
George Keishing6716d6a2019-06-03 10:18:20 -0500200 Redfish Power On
201
202 Redfish.Login
203 Redfish Purge Event Log
Sweta Potthurib2c50f12017-06-28 03:53:30 -0500204
Sridevi Ramesh87be0642017-05-19 01:20:50 -0500205 Login To OS Host ${OS_HOST} ${OS_USERNAME} ${OS_PASSWORD}
206 Open Connection And Log In
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500207
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500208
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500209Check IPMI OEMpartialadd Accept
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500210 [Documentation] Check if IPMI accepts the OEM partial add command.
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500211 [Arguments] ${args}
212 Login To OS Host ${OS_HOST} ${OS_USERNAME} ${OS_PASSWORD}
213 ${stdout} ${stderr} ${output_3}= Execute Command ipmitool raw ${args}
214 ... return_stdout=True return_stderr=True return_rc=True
215 Should Be Equal ${output_3} ${0} msg=${stderr}
Steven Sombara3f04392018-10-01 15:38:21 -0500216 [Return] ${stderr}
George Keishing6716d6a2019-06-03 10:18:20 -0500217
218
219Event Log Should Exist
220 [Documentation] Event log entries should exist.
221
222 ${elogs}= Get Event Logs
223 Should Not Be Empty ${elogs} msg=System event log entry is not empty.