blob: 3dc8d793296b18eee39fed1a63e22826fc4d5005 [file] [log] [blame]
Chris Austenb29d2e82016-06-07 12:25:35 -05001*** Settings ***
George Keishingaa093502019-07-24 23:32:37 -05002Documentation REST test Error callout association.
Chris Austenb29d2e82016-06-07 12:25:35 -05003
George Keishingaa093502019-07-24 23:32:37 -05004Resource ../../../lib/bmc_redfish_resource.robot
5Resource ../../../lib/bmc_redfish_utils.robot
6Resource ../../../lib/connection_client.robot
7Resource ../../../lib/openbmc_ffdc.robot
8Resource ../../../lib/utils.robot
9Resource ../../../lib/state_manager.robot
10Resource ../../../lib/boot_utils.robot
Chris Austenb29d2e82016-06-07 12:25:35 -050011
George Keishingaa093502019-07-24 23:32:37 -050012
13Suite Setup Suite Setup Execution
14Suite Teardown Suite Teardown Execution
George Keishing95c371a2017-09-14 15:42:33 -050015Test Setup Test Setup Execution
George Keishing19b64552019-01-14 06:56:22 -060016Test Teardown FFDC On Test Case Fail
George Keishingd434c512016-10-07 06:46:29 -050017
Sweta Potthurie27b4392017-05-11 07:27:04 -050018***Variables***
George Keishingf2fe7452017-08-24 09:40:46 -050019${target_device_path} /sys/devices/platform/gpio-fsi/fsi0/slave@00:00/raw
Sweta Potthurie27b4392017-05-11 07:27:04 -050020
George Keishing95c371a2017-09-14 15:42:33 -050021${stack_mode} skip
22
Chris Austenb29d2e82016-06-07 12:25:35 -050023*** Test Cases ***
24
George Keishingf58c4862017-03-28 13:01:03 -050025Create Test Error Callout And Verify
26 [Documentation] Create error log callout and verify via REST.
27 [Tags] Create_Test_Error_Callout_And_Verify
Chris Austenb29d2e82016-06-07 12:25:35 -050028
George Keishingf58c4862017-03-28 13:01:03 -050029 Create Test Error With Callout
30 Verify Test Error Log And Callout
Chris Austenb29d2e82016-06-07 12:25:35 -050031
George Keishingad5817a2017-06-28 10:19:03 -050032
Sweta Potthurie27b4392017-05-11 07:27:04 -050033Create Test Error Callout And Verify AdditionalData
34 [Documentation] Create Test Error Callout And Verify AdditionalData.
35 [Tags] Create_Test_Error_Callout_And_Verify_AdditionalData
36
37 # Test error log entry example:
38 # "/xyz/openbmc_project/logging/entry/1": {
39 # "AdditionalData": [
40 # "CALLOUT_DEVICE_PATH_TEST=/sys/devices/platform/fsi-master/slave@00:00",
41 # "CALLOUT_ERRNO_TEST=0",
42 # "DEV_ADDR=0x0DEADEAD"
43 # ]
44
45 Create Test Error With Callout
George Keishingad5817a2017-06-28 10:19:03 -050046 ${elog_entry}= Get Elog URL List
47 ${resp}= OpenBMC Get Request ${elog_entry[0]}
Sweta Potthurie27b4392017-05-11 07:27:04 -050048 ${jsondata}= To JSON ${resp.content}
George Keishing04f9b8c2019-02-28 13:55:18 -060049 List Should Contain Value
50 ... ${jsondata["data"]["AdditionalData"]} CALLOUT_DEVICE_PATH_TEST=${target_device_path}
51 List Should Contain Value ${jsondata["data"]["AdditionalData"]} DEV_ADDR=0x0DEADEAD
Sweta Potthurie27b4392017-05-11 07:27:04 -050052
George Keishingad5817a2017-06-28 10:19:03 -050053
George Keishingc41eaa72017-07-27 04:04:32 -050054Create Test Error Callout And Verify Associations
George Keishing58520d02020-02-24 10:55:32 -060055 [Documentation] Create test error callout and verify Associations.
George Keishingc41eaa72017-07-27 04:04:32 -050056 [Tags] Create_Test_Error_Callout_And_Verify_Associations
57
58 # Test error log association entry example:
George Keishing58520d02020-02-24 10:55:32 -060059 # "Associations": [
George Keishingc41eaa72017-07-27 04:04:32 -050060 # [
61 # "callout",
62 # "fault",
63 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0"
64 # ]
65 # ]
66
67 Create Test Error With Callout
68 ${elog_entry}= Get Elog URL List
69 ${resp}= OpenBMC Get Request ${elog_entry[0]}
70 ${jsondata}= To JSON ${resp.content}
George Keishing58520d02020-02-24 10:55:32 -060071 List Should Contain Value ${jsondata["data"]["Associations"][0]} callout
72 List Should Contain Value ${jsondata["data"]["Associations"][0]} fault
George Keishingc41eaa72017-07-27 04:04:32 -050073 List Should Contain Value
George Keishing58520d02020-02-24 10:55:32 -060074 ... ${jsondata["data"]["Associations"][0]}
George Keishingc41eaa72017-07-27 04:04:32 -050075 ... /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0
76
77
Sweta Potthurie27b4392017-05-11 07:27:04 -050078Create Test Error Callout And Delete
79 [Documentation] Create Test Error Callout And Delete.
80 [Tags] Create_Test_Error_Callout_And_Delete
81
82 # Test error log entry example:
83 # "/xyz/openbmc_project/logging/entry/1": {
84 # "AdditionalData": [
85 # "CALLOUT_DEVICE_PATH_TEST=/sys/devices/platform/fsi-master/slave@00:00",
86 # "CALLOUT_ERRNO_TEST=0",
87 # "DEV_ADDR=0x0DEADEAD"
88 # ],
89 # "Id": 1,
90 # "Message": "example.xyz.openbmc_project.Example.Elog.TestCallout",
91 # "Resolved": 0,
92 # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error",
93 # "Timestamp": 1487747332528,
George Keishing58520d02020-02-24 10:55:32 -060094 # "Associations": [
Sweta Potthurie27b4392017-05-11 07:27:04 -050095 # [
96 # "callout",
97 # "fault",
98 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0"
99 # ]
100 # ]
101 # },
102 # "/xyz/openbmc_project/logging/entry/1/callout": {
103 # "endpoints": [
104 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0"
105 # ]
106 # },
107
108 Create Test Error With Callout
George Keishingad5817a2017-06-28 10:19:03 -0500109 ${elog_entry}= Get Elog URL List
110 Delete Error Log Entry ${elog_entry[0]}
111 ${resp}= OpenBMC Get Request ${elog_entry[0]}/callout
Sweta Potthurie27b4392017-05-11 07:27:04 -0500112 Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND}
113
George Keishingad5817a2017-06-28 10:19:03 -0500114
Sweta Potthurie27b4392017-05-11 07:27:04 -0500115Create Two Test Error Callout And Delete
116 [Documentation] Create Two Test Error Callout And Delete.
117 [Tags] Create_Two_Test_Error_Callout_And_Delete
118
119 # Test error log entry example:
120 # "/xyz/openbmc_project/logging/entry/1": {
121 # "AdditionalData": [
122 # "CALLOUT_DEVICE_PATH_TEST=/sys/devices/platform/fsi-master/slave@00:00",
123 # "CALLOUT_ERRNO_TEST=0",
124 # "DEV_ADDR=0x0DEADEAD"
125 # ],
126 # "Id": 1,
127 # "Message": "example.xyz.openbmc_project.Example.Elog.TestCallout",
128 # "Resolved": 0,
129 # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error",
130 # "Timestamp": 1487747332528,
George Keishing58520d02020-02-24 10:55:32 -0600131 # "Associations": [
Sweta Potthurie27b4392017-05-11 07:27:04 -0500132 # [
133 # "callout",
134 # "fault",
135 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0"
136 # ]
137 # ]
138 # },
139 # "/xyz/openbmc_project/logging/entry/1/callout": {
140 # "endpoints": [
141 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0"
142 # ]
143 # },
144 # "/xyz/openbmc_project/logging/entry/2": {
145 # "AdditionalData": [
146 # "CALLOUT_DEVICE_PATH_TEST=/sys/devices/platform/fsi-master/slave@00:00",
147 # "CALLOUT_ERRNO_TEST=0",
148 # "DEV_ADDR=0x0DEADEAD"
149 # ],
150 # "Id": 2,
151 # "Message": "example.xyz.openbmc_project.Example.Elog.TestCallout",
152 # "Resolved": 0,
153 # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error",
154 # "Timestamp": 1487747332528,
George Keishing58520d02020-02-24 10:55:32 -0600155 # "Associations": [
Sweta Potthurie27b4392017-05-11 07:27:04 -0500156 # [
157 # "callout",
158 # "fault",
159 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0"
160 # ]
161 # ]
162 # },
163 # "/xyz/openbmc_project/logging/entry/2/callout": {
164 # "endpoints": [
165 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0"
166 # ]
167 # },
168
169 # Create two error logs.
170 Create Test Error With Callout
171 Create Test Error With Callout
172
173 # Delete entry/2 elog entry.
George Keishingad5817a2017-06-28 10:19:03 -0500174 ${elog_entry}= Get Elog URL List
175 Delete Error Log Entry ${elog_entry[1]}
Sweta Potthurie27b4392017-05-11 07:27:04 -0500176
177 # Verify if entry/1 exist and entry/2 is deleted.
George Keishingad5817a2017-06-28 10:19:03 -0500178 ${resp}= OpenBMC Get Request ${elog_entry[0]}
179 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
180 ${resp}= OpenBMC Get Request ${elog_entry[1]}
181 Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND}
Chris Austenb29d2e82016-06-07 12:25:35 -0500182
George Keishingaa093502019-07-24 23:32:37 -0500183
Rahul Maheshwari43be6932017-05-01 02:37:06 -0500184Create Test Error Callout And Verify LED
185 [Documentation] Create an error log callout and verify respective
186 ... LED state.
187 [Tags] Create_Test_Error_Callout_And_Verify_LED
188
189 Create Test Error With Callout
190
191 ${resp}= Get LED State XYZ cpu0_fault
192 Should Be Equal ${resp} ${1}
193
George Keishingaa093502019-07-24 23:32:37 -0500194
Sweta Potthuriab73f9a2017-07-07 05:33:42 -0500195Set Resolved Field And Verify Callout Deletion
196 [Documentation] Set the "Resolved" error log and verify callout is deleted
197 [Tags] Set_Resolved_Field_And_Verify_Callout_Deletion
198
George Keishingcc71c3c2017-09-20 09:38:03 -0500199 Delete All Error Logs
Sweta Potthuriab73f9a2017-07-07 05:33:42 -0500200 Create Test Error With Callout
201 ${elog_entry}= Get URL List ${BMC_LOGGING_ENTRY}
202 ${resp}= OpenBMC Get Request ${elog_entry[0]}
203 ${jsondata}= To JSON ${resp.content}
George Keishing58520d02020-02-24 10:55:32 -0600204 Should Contain ${jsondata["data"]["Associations"][0]} callout
Sweta Potthuriab73f9a2017-07-07 05:33:42 -0500205
206 # Set the error log field "Resolved".
207 # By doing so, the callout object should get deleted automatically.
208 ${valueDict}= Create Dictionary data=${1}
209 OpenBMC Put Request ${elog_entry[0]}/attr/Resolved data=${valueDict}
210
211 # Verify if the callout entry is deleted.
212 ${resp}= OpenBMC Get Request ${elog_entry[0]}/callout
213 Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND}
Rahul Maheshwari43be6932017-05-01 02:37:06 -0500214
Chris Austenb29d2e82016-06-07 12:25:35 -0500215*** Keywords ***
216
George Keishing95c371a2017-09-14 15:42:33 -0500217Callout Test Binary Exist
George Keishingf58c4862017-03-28 13:01:03 -0500218 [Documentation] Verify existence of prerequisite callout-test.
Chris Austenb29d2e82016-06-07 12:25:35 -0500219
George Keishingd434c512016-10-07 06:46:29 -0500220 Open Connection And Log In
George Keishing95c371a2017-09-14 15:42:33 -0500221 ${out} ${stderr}= Execute Command
222 ... which /tmp/tarball/bin/callout-test return_stderr=True
George Keishingf58c4862017-03-28 13:01:03 -0500223 Should Be Empty ${stderr}
224 Should Contain ${out} callout-test
225
George Keishingf58c4862017-03-28 13:01:03 -0500226
George Keishingf58c4862017-03-28 13:01:03 -0500227Create Test Error With Callout
228 [Documentation] Generate test error log with callout for CPU0.
229
230 # Test error log entry example:
231 # "/xyz/openbmc_project/logging/entry/4": {
232 # "AdditionalData": [
233 # "CALLOUT_DEVICE_PATH_TEST=/sys/devices/platform/fsi-master/slave@00:00",
234 # "CALLOUT_ERRNO_TEST=0",
235 # "DEV_ADDR=0x0DEADEAD"
236 # ],
237 # "Id": 4,
238 # "Message": "example.xyz.openbmc_project.Example.Elog.TestCallout",
239 # "Resolved": 0,
240 # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error",
241 # "Timestamp": 1487747332528,
George Keishing58520d02020-02-24 10:55:32 -0600242 # "Associations": [
George Keishingf58c4862017-03-28 13:01:03 -0500243 # [
244 # "callout",
245 # "fault",
246 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0"
247 # ]
248 # ]
249 # },
250 # "/xyz/openbmc_project/logging/entry/4/callout": {
251 # "endpoints": [
252 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0"
253 # ]
254 # },
255
Joy Onyerikwu2ef965a2018-05-24 15:23:27 -0500256 BMC Execute Command
George Keishing95c371a2017-09-14 15:42:33 -0500257 ... /tmp/tarball/bin/callout-test ${target_device_path}
George Keishingf58c4862017-03-28 13:01:03 -0500258
259Verify Test Error Log And Callout
260 [Documentation] Verify test error log entries.
George Keishingad5817a2017-06-28 10:19:03 -0500261 ${elog_entry}= Get Elog URL List
262 ${resp}= OpenBMC Get Request ${elog_entry[0]}
263 ${json}= To JSON ${resp.content}
264
265 Should Be Equal ${json["data"]["Message"]}
George Keishingf58c4862017-03-28 13:01:03 -0500266 ... example.xyz.openbmc_project.Example.Elog.TestCallout
George Keishingad5817a2017-06-28 10:19:03 -0500267
268 Should Be Equal ${json["data"]["Severity"]}
George Keishingf58c4862017-03-28 13:01:03 -0500269 ... xyz.openbmc_project.Logging.Entry.Level.Error
George Keishingad5817a2017-06-28 10:19:03 -0500270
271 ${content}= Read Attribute ${elog_entry[0]}/callout endpoints
George Keishingaa093502019-07-24 23:32:37 -0500272
George Keishingf58c4862017-03-28 13:01:03 -0500273 Should Be Equal ${content[0]}
274 ... /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0
275
George Keishing95c371a2017-09-14 15:42:33 -0500276
277Test Setup Execution
Sweta Potthuri04c68d72017-07-19 06:06:50 -0500278 [Documentation] Do test case setup tasks.
George Keishing95c371a2017-09-14 15:42:33 -0500279
Sweta Potthuri04c68d72017-07-19 06:06:50 -0500280 ${status}= Run Keyword And Return Status Callout Test Binary Exist
281 Run Keyword If ${status} == ${False} Install Tarball
282 Delete All Error Logs
George Keishing95c371a2017-09-14 15:42:33 -0500283
284
285Install Tarball
286 [Documentation] Install tarball on BMC.
287
288 Run Keyword If '${DEBUG_TARBALL_PATH}' == '${EMPTY}' Return from Keyword
289 BMC Execute Command rm -rf /tmp/tarball
290 Install Debug Tarball On BMC ${DEBUG_TARBALL_PATH}
George Keishingaa093502019-07-24 23:32:37 -0500291
292
293Suite Setup Execution
294 [Documentation] Do test case setup tasks.
295
296 Redfish.Login
297
298 Redfish Purge Event Log
299
300 Redfish Power On stack_mode=skip quiet=1
301
302 ${status}= Run Keyword And Return Status Logging Test Binary Exist
303 Run Keyword If ${status} == ${False} Install Tarball
304
305
306Suite Teardown Execution
307 [Documentation] Do the post suite teardown.
308
309 Redfish.Logout