blob: e98f55f342898caa5751df044394b984dc4a69b5 [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
George Keishingf699f552023-09-14 19:05:01 +053018Force Tags Event_Association
19
Sweta Potthurie27b4392017-05-11 07:27:04 -050020***Variables***
George Keishingf2fe7452017-08-24 09:40:46 -050021${target_device_path} /sys/devices/platform/gpio-fsi/fsi0/slave@00:00/raw
Sweta Potthurie27b4392017-05-11 07:27:04 -050022
George Keishing95c371a2017-09-14 15:42:33 -050023${stack_mode} skip
24
Chris Austenb29d2e82016-06-07 12:25:35 -050025*** Test Cases ***
26
George Keishingf58c4862017-03-28 13:01:03 -050027Create Test Error Callout And Verify
28 [Documentation] Create error log callout and verify via REST.
29 [Tags] Create_Test_Error_Callout_And_Verify
Chris Austenb29d2e82016-06-07 12:25:35 -050030
George Keishingf58c4862017-03-28 13:01:03 -050031 Create Test Error With Callout
32 Verify Test Error Log And Callout
Chris Austenb29d2e82016-06-07 12:25:35 -050033
George Keishingad5817a2017-06-28 10:19:03 -050034
Sweta Potthurie27b4392017-05-11 07:27:04 -050035Create Test Error Callout And Verify AdditionalData
36 [Documentation] Create Test Error Callout And Verify AdditionalData.
37 [Tags] Create_Test_Error_Callout_And_Verify_AdditionalData
38
39 # Test error log entry example:
40 # "/xyz/openbmc_project/logging/entry/1": {
41 # "AdditionalData": [
42 # "CALLOUT_DEVICE_PATH_TEST=/sys/devices/platform/fsi-master/slave@00:00",
43 # "CALLOUT_ERRNO_TEST=0",
44 # "DEV_ADDR=0x0DEADEAD"
45 # ]
46
47 Create Test Error With Callout
George Keishingad5817a2017-06-28 10:19:03 -050048 ${elog_entry}= Get Elog URL List
49 ${resp}= OpenBMC Get Request ${elog_entry[0]}
George Keishing04f9b8c2019-02-28 13:55:18 -060050 List Should Contain Value
George Keishingfbd67002022-08-01 11:24:03 -050051 ... ${resp.json()["data"]["AdditionalData"]} CALLOUT_DEVICE_PATH_TEST=${target_device_path}
52 List Should Contain Value ${resp.json()["data"]["AdditionalData"]} DEV_ADDR=0x0DEADEAD
Sweta Potthurie27b4392017-05-11 07:27:04 -050053
George Keishingad5817a2017-06-28 10:19:03 -050054
George Keishingc41eaa72017-07-27 04:04:32 -050055Create Test Error Callout And Verify Associations
George Keishing58520d02020-02-24 10:55:32 -060056 [Documentation] Create test error callout and verify Associations.
George Keishingc41eaa72017-07-27 04:04:32 -050057 [Tags] Create_Test_Error_Callout_And_Verify_Associations
58
59 # Test error log association entry example:
George Keishing58520d02020-02-24 10:55:32 -060060 # "Associations": [
George Keishingc41eaa72017-07-27 04:04:32 -050061 # [
62 # "callout",
63 # "fault",
64 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0"
65 # ]
66 # ]
67
68 Create Test Error With Callout
69 ${elog_entry}= Get Elog URL List
70 ${resp}= OpenBMC Get Request ${elog_entry[0]}
George Keishingfbd67002022-08-01 11:24:03 -050071 List Should Contain Value ${resp.json()["data"]["Associations"][0]} callout
72 List Should Contain Value ${resp.json()["data"]["Associations"][0]} fault
George Keishingc41eaa72017-07-27 04:04:32 -050073 List Should Contain Value
George Keishingfbd67002022-08-01 11:24:03 -050074 ... ${resp.json()["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]}
George Keishingfbd67002022-08-01 11:24:03 -0500203 Should Contain ${resp.json()["data"]["Associations"][0]} callout
Sweta Potthuriab73f9a2017-07-07 05:33:42 -0500204
205 # Set the error log field "Resolved".
206 # By doing so, the callout object should get deleted automatically.
207 ${valueDict}= Create Dictionary data=${1}
208 OpenBMC Put Request ${elog_entry[0]}/attr/Resolved data=${valueDict}
209
210 # Verify if the callout entry is deleted.
211 ${resp}= OpenBMC Get Request ${elog_entry[0]}/callout
212 Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND}
Rahul Maheshwari43be6932017-05-01 02:37:06 -0500213
Chris Austenb29d2e82016-06-07 12:25:35 -0500214*** Keywords ***
215
George Keishing95c371a2017-09-14 15:42:33 -0500216Callout Test Binary Exist
George Keishingf58c4862017-03-28 13:01:03 -0500217 [Documentation] Verify existence of prerequisite callout-test.
Chris Austenb29d2e82016-06-07 12:25:35 -0500218
George Keishingd434c512016-10-07 06:46:29 -0500219 Open Connection And Log In
George Keishing95c371a2017-09-14 15:42:33 -0500220 ${out} ${stderr}= Execute Command
221 ... which /tmp/tarball/bin/callout-test return_stderr=True
George Keishingf58c4862017-03-28 13:01:03 -0500222 Should Be Empty ${stderr}
223 Should Contain ${out} callout-test
224
George Keishingf58c4862017-03-28 13:01:03 -0500225
George Keishingf58c4862017-03-28 13:01:03 -0500226Create Test Error With Callout
227 [Documentation] Generate test error log with callout for CPU0.
228
229 # Test error log entry example:
230 # "/xyz/openbmc_project/logging/entry/4": {
231 # "AdditionalData": [
232 # "CALLOUT_DEVICE_PATH_TEST=/sys/devices/platform/fsi-master/slave@00:00",
233 # "CALLOUT_ERRNO_TEST=0",
234 # "DEV_ADDR=0x0DEADEAD"
235 # ],
236 # "Id": 4,
237 # "Message": "example.xyz.openbmc_project.Example.Elog.TestCallout",
238 # "Resolved": 0,
239 # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error",
240 # "Timestamp": 1487747332528,
George Keishing58520d02020-02-24 10:55:32 -0600241 # "Associations": [
George Keishingf58c4862017-03-28 13:01:03 -0500242 # [
243 # "callout",
244 # "fault",
245 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0"
246 # ]
247 # ]
248 # },
249 # "/xyz/openbmc_project/logging/entry/4/callout": {
250 # "endpoints": [
251 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0"
252 # ]
253 # },
254
Joy Onyerikwu2ef965a2018-05-24 15:23:27 -0500255 BMC Execute Command
George Keishing95c371a2017-09-14 15:42:33 -0500256 ... /tmp/tarball/bin/callout-test ${target_device_path}
George Keishingf58c4862017-03-28 13:01:03 -0500257
258Verify Test Error Log And Callout
259 [Documentation] Verify test error log entries.
George Keishingad5817a2017-06-28 10:19:03 -0500260 ${elog_entry}= Get Elog URL List
261 ${resp}= OpenBMC Get Request ${elog_entry[0]}
George Keishingad5817a2017-06-28 10:19:03 -0500262
George Keishingfbd67002022-08-01 11:24:03 -0500263 Should Be Equal ${resp.json()["data"]["Message"]}
George Keishingf58c4862017-03-28 13:01:03 -0500264 ... example.xyz.openbmc_project.Example.Elog.TestCallout
George Keishingad5817a2017-06-28 10:19:03 -0500265
George Keishingfbd67002022-08-01 11:24:03 -0500266 Should Be Equal ${resp.json()["data"]["Severity"]}
George Keishingf58c4862017-03-28 13:01:03 -0500267 ... xyz.openbmc_project.Logging.Entry.Level.Error
George Keishingad5817a2017-06-28 10:19:03 -0500268
269 ${content}= Read Attribute ${elog_entry[0]}/callout endpoints
George Keishingaa093502019-07-24 23:32:37 -0500270
George Keishingf58c4862017-03-28 13:01:03 -0500271 Should Be Equal ${content[0]}
272 ... /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0
273
George Keishing95c371a2017-09-14 15:42:33 -0500274
275Test Setup Execution
Sweta Potthuri04c68d72017-07-19 06:06:50 -0500276 [Documentation] Do test case setup tasks.
George Keishing95c371a2017-09-14 15:42:33 -0500277
Sweta Potthuri04c68d72017-07-19 06:06:50 -0500278 ${status}= Run Keyword And Return Status Callout Test Binary Exist
279 Run Keyword If ${status} == ${False} Install Tarball
280 Delete All Error Logs
George Keishing95c371a2017-09-14 15:42:33 -0500281
282
283Install Tarball
284 [Documentation] Install tarball on BMC.
285
286 Run Keyword If '${DEBUG_TARBALL_PATH}' == '${EMPTY}' Return from Keyword
287 BMC Execute Command rm -rf /tmp/tarball
288 Install Debug Tarball On BMC ${DEBUG_TARBALL_PATH}
George Keishingaa093502019-07-24 23:32:37 -0500289
290
291Suite Setup Execution
292 [Documentation] Do test case setup tasks.
293
294 Redfish.Login
295
296 Redfish Purge Event Log
297
298 Redfish Power On stack_mode=skip quiet=1
299
300 ${status}= Run Keyword And Return Status Logging Test Binary Exist
301 Run Keyword If ${status} == ${False} Install Tarball
302
303
304Suite Teardown Execution
305 [Documentation] Do the post suite teardown.
306
307 Redfish.Logout