blob: 093aff0cd5ffb5b380d18e9bf2456c87db5e7bd3 [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]}
George Keishing04f9b8c2019-02-28 13:55:18 -060048 List Should Contain Value
George Keishingfbd67002022-08-01 11:24:03 -050049 ... ${resp.json()["data"]["AdditionalData"]} CALLOUT_DEVICE_PATH_TEST=${target_device_path}
50 List Should Contain Value ${resp.json()["data"]["AdditionalData"]} DEV_ADDR=0x0DEADEAD
Sweta Potthurie27b4392017-05-11 07:27:04 -050051
George Keishingad5817a2017-06-28 10:19:03 -050052
George Keishingc41eaa72017-07-27 04:04:32 -050053Create Test Error Callout And Verify Associations
George Keishing58520d02020-02-24 10:55:32 -060054 [Documentation] Create test error callout and verify Associations.
George Keishingc41eaa72017-07-27 04:04:32 -050055 [Tags] Create_Test_Error_Callout_And_Verify_Associations
56
57 # Test error log association entry example:
George Keishing58520d02020-02-24 10:55:32 -060058 # "Associations": [
George Keishingc41eaa72017-07-27 04:04:32 -050059 # [
60 # "callout",
61 # "fault",
62 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0"
63 # ]
64 # ]
65
66 Create Test Error With Callout
67 ${elog_entry}= Get Elog URL List
68 ${resp}= OpenBMC Get Request ${elog_entry[0]}
George Keishingfbd67002022-08-01 11:24:03 -050069 List Should Contain Value ${resp.json()["data"]["Associations"][0]} callout
70 List Should Contain Value ${resp.json()["data"]["Associations"][0]} fault
George Keishingc41eaa72017-07-27 04:04:32 -050071 List Should Contain Value
George Keishingfbd67002022-08-01 11:24:03 -050072 ... ${resp.json()["data"]["Associations"][0]}
George Keishingc41eaa72017-07-27 04:04:32 -050073 ... /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0
74
75
Sweta Potthurie27b4392017-05-11 07:27:04 -050076Create Test Error Callout And Delete
77 [Documentation] Create Test Error Callout And Delete.
78 [Tags] Create_Test_Error_Callout_And_Delete
79
80 # Test error log entry example:
81 # "/xyz/openbmc_project/logging/entry/1": {
82 # "AdditionalData": [
83 # "CALLOUT_DEVICE_PATH_TEST=/sys/devices/platform/fsi-master/slave@00:00",
84 # "CALLOUT_ERRNO_TEST=0",
85 # "DEV_ADDR=0x0DEADEAD"
86 # ],
87 # "Id": 1,
88 # "Message": "example.xyz.openbmc_project.Example.Elog.TestCallout",
89 # "Resolved": 0,
90 # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error",
91 # "Timestamp": 1487747332528,
George Keishing58520d02020-02-24 10:55:32 -060092 # "Associations": [
Sweta Potthurie27b4392017-05-11 07:27:04 -050093 # [
94 # "callout",
95 # "fault",
96 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0"
97 # ]
98 # ]
99 # },
100 # "/xyz/openbmc_project/logging/entry/1/callout": {
101 # "endpoints": [
102 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0"
103 # ]
104 # },
105
106 Create Test Error With Callout
George Keishingad5817a2017-06-28 10:19:03 -0500107 ${elog_entry}= Get Elog URL List
108 Delete Error Log Entry ${elog_entry[0]}
109 ${resp}= OpenBMC Get Request ${elog_entry[0]}/callout
Sweta Potthurie27b4392017-05-11 07:27:04 -0500110 Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND}
111
George Keishingad5817a2017-06-28 10:19:03 -0500112
Sweta Potthurie27b4392017-05-11 07:27:04 -0500113Create Two Test Error Callout And Delete
114 [Documentation] Create Two Test Error Callout And Delete.
115 [Tags] Create_Two_Test_Error_Callout_And_Delete
116
117 # Test error log entry example:
118 # "/xyz/openbmc_project/logging/entry/1": {
119 # "AdditionalData": [
120 # "CALLOUT_DEVICE_PATH_TEST=/sys/devices/platform/fsi-master/slave@00:00",
121 # "CALLOUT_ERRNO_TEST=0",
122 # "DEV_ADDR=0x0DEADEAD"
123 # ],
124 # "Id": 1,
125 # "Message": "example.xyz.openbmc_project.Example.Elog.TestCallout",
126 # "Resolved": 0,
127 # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error",
128 # "Timestamp": 1487747332528,
George Keishing58520d02020-02-24 10:55:32 -0600129 # "Associations": [
Sweta Potthurie27b4392017-05-11 07:27:04 -0500130 # [
131 # "callout",
132 # "fault",
133 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0"
134 # ]
135 # ]
136 # },
137 # "/xyz/openbmc_project/logging/entry/1/callout": {
138 # "endpoints": [
139 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0"
140 # ]
141 # },
142 # "/xyz/openbmc_project/logging/entry/2": {
143 # "AdditionalData": [
144 # "CALLOUT_DEVICE_PATH_TEST=/sys/devices/platform/fsi-master/slave@00:00",
145 # "CALLOUT_ERRNO_TEST=0",
146 # "DEV_ADDR=0x0DEADEAD"
147 # ],
148 # "Id": 2,
149 # "Message": "example.xyz.openbmc_project.Example.Elog.TestCallout",
150 # "Resolved": 0,
151 # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error",
152 # "Timestamp": 1487747332528,
George Keishing58520d02020-02-24 10:55:32 -0600153 # "Associations": [
Sweta Potthurie27b4392017-05-11 07:27:04 -0500154 # [
155 # "callout",
156 # "fault",
157 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0"
158 # ]
159 # ]
160 # },
161 # "/xyz/openbmc_project/logging/entry/2/callout": {
162 # "endpoints": [
163 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0"
164 # ]
165 # },
166
167 # Create two error logs.
168 Create Test Error With Callout
169 Create Test Error With Callout
170
171 # Delete entry/2 elog entry.
George Keishingad5817a2017-06-28 10:19:03 -0500172 ${elog_entry}= Get Elog URL List
173 Delete Error Log Entry ${elog_entry[1]}
Sweta Potthurie27b4392017-05-11 07:27:04 -0500174
175 # Verify if entry/1 exist and entry/2 is deleted.
George Keishingad5817a2017-06-28 10:19:03 -0500176 ${resp}= OpenBMC Get Request ${elog_entry[0]}
177 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
178 ${resp}= OpenBMC Get Request ${elog_entry[1]}
179 Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND}
Chris Austenb29d2e82016-06-07 12:25:35 -0500180
George Keishingaa093502019-07-24 23:32:37 -0500181
Rahul Maheshwari43be6932017-05-01 02:37:06 -0500182Create Test Error Callout And Verify LED
183 [Documentation] Create an error log callout and verify respective
184 ... LED state.
185 [Tags] Create_Test_Error_Callout_And_Verify_LED
186
187 Create Test Error With Callout
188
189 ${resp}= Get LED State XYZ cpu0_fault
190 Should Be Equal ${resp} ${1}
191
George Keishingaa093502019-07-24 23:32:37 -0500192
Sweta Potthuriab73f9a2017-07-07 05:33:42 -0500193Set Resolved Field And Verify Callout Deletion
194 [Documentation] Set the "Resolved" error log and verify callout is deleted
195 [Tags] Set_Resolved_Field_And_Verify_Callout_Deletion
196
George Keishingcc71c3c2017-09-20 09:38:03 -0500197 Delete All Error Logs
Sweta Potthuriab73f9a2017-07-07 05:33:42 -0500198 Create Test Error With Callout
199 ${elog_entry}= Get URL List ${BMC_LOGGING_ENTRY}
200 ${resp}= OpenBMC Get Request ${elog_entry[0]}
George Keishingfbd67002022-08-01 11:24:03 -0500201 Should Contain ${resp.json()["data"]["Associations"][0]} callout
Sweta Potthuriab73f9a2017-07-07 05:33:42 -0500202
203 # Set the error log field "Resolved".
204 # By doing so, the callout object should get deleted automatically.
205 ${valueDict}= Create Dictionary data=${1}
206 OpenBMC Put Request ${elog_entry[0]}/attr/Resolved data=${valueDict}
207
208 # Verify if the callout entry is deleted.
209 ${resp}= OpenBMC Get Request ${elog_entry[0]}/callout
210 Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND}
Rahul Maheshwari43be6932017-05-01 02:37:06 -0500211
Chris Austenb29d2e82016-06-07 12:25:35 -0500212*** Keywords ***
213
George Keishing95c371a2017-09-14 15:42:33 -0500214Callout Test Binary Exist
George Keishingf58c4862017-03-28 13:01:03 -0500215 [Documentation] Verify existence of prerequisite callout-test.
Chris Austenb29d2e82016-06-07 12:25:35 -0500216
George Keishingd434c512016-10-07 06:46:29 -0500217 Open Connection And Log In
George Keishing95c371a2017-09-14 15:42:33 -0500218 ${out} ${stderr}= Execute Command
219 ... which /tmp/tarball/bin/callout-test return_stderr=True
George Keishingf58c4862017-03-28 13:01:03 -0500220 Should Be Empty ${stderr}
221 Should Contain ${out} callout-test
222
George Keishingf58c4862017-03-28 13:01:03 -0500223
George Keishingf58c4862017-03-28 13:01:03 -0500224Create Test Error With Callout
225 [Documentation] Generate test error log with callout for CPU0.
226
227 # Test error log entry example:
228 # "/xyz/openbmc_project/logging/entry/4": {
229 # "AdditionalData": [
230 # "CALLOUT_DEVICE_PATH_TEST=/sys/devices/platform/fsi-master/slave@00:00",
231 # "CALLOUT_ERRNO_TEST=0",
232 # "DEV_ADDR=0x0DEADEAD"
233 # ],
234 # "Id": 4,
235 # "Message": "example.xyz.openbmc_project.Example.Elog.TestCallout",
236 # "Resolved": 0,
237 # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error",
238 # "Timestamp": 1487747332528,
George Keishing58520d02020-02-24 10:55:32 -0600239 # "Associations": [
George Keishingf58c4862017-03-28 13:01:03 -0500240 # [
241 # "callout",
242 # "fault",
243 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0"
244 # ]
245 # ]
246 # },
247 # "/xyz/openbmc_project/logging/entry/4/callout": {
248 # "endpoints": [
249 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0"
250 # ]
251 # },
252
Joy Onyerikwu2ef965a2018-05-24 15:23:27 -0500253 BMC Execute Command
George Keishing95c371a2017-09-14 15:42:33 -0500254 ... /tmp/tarball/bin/callout-test ${target_device_path}
George Keishingf58c4862017-03-28 13:01:03 -0500255
256Verify Test Error Log And Callout
257 [Documentation] Verify test error log entries.
George Keishingad5817a2017-06-28 10:19:03 -0500258 ${elog_entry}= Get Elog URL List
259 ${resp}= OpenBMC Get Request ${elog_entry[0]}
George Keishingad5817a2017-06-28 10:19:03 -0500260
George Keishingfbd67002022-08-01 11:24:03 -0500261 Should Be Equal ${resp.json()["data"]["Message"]}
George Keishingf58c4862017-03-28 13:01:03 -0500262 ... example.xyz.openbmc_project.Example.Elog.TestCallout
George Keishingad5817a2017-06-28 10:19:03 -0500263
George Keishingfbd67002022-08-01 11:24:03 -0500264 Should Be Equal ${resp.json()["data"]["Severity"]}
George Keishingf58c4862017-03-28 13:01:03 -0500265 ... xyz.openbmc_project.Logging.Entry.Level.Error
George Keishingad5817a2017-06-28 10:19:03 -0500266
267 ${content}= Read Attribute ${elog_entry[0]}/callout endpoints
George Keishingaa093502019-07-24 23:32:37 -0500268
George Keishingf58c4862017-03-28 13:01:03 -0500269 Should Be Equal ${content[0]}
270 ... /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0
271
George Keishing95c371a2017-09-14 15:42:33 -0500272
273Test Setup Execution
Sweta Potthuri04c68d72017-07-19 06:06:50 -0500274 [Documentation] Do test case setup tasks.
George Keishing95c371a2017-09-14 15:42:33 -0500275
Sweta Potthuri04c68d72017-07-19 06:06:50 -0500276 ${status}= Run Keyword And Return Status Callout Test Binary Exist
277 Run Keyword If ${status} == ${False} Install Tarball
278 Delete All Error Logs
George Keishing95c371a2017-09-14 15:42:33 -0500279
280
281Install Tarball
282 [Documentation] Install tarball on BMC.
283
284 Run Keyword If '${DEBUG_TARBALL_PATH}' == '${EMPTY}' Return from Keyword
285 BMC Execute Command rm -rf /tmp/tarball
286 Install Debug Tarball On BMC ${DEBUG_TARBALL_PATH}
George Keishingaa093502019-07-24 23:32:37 -0500287
288
289Suite Setup Execution
290 [Documentation] Do test case setup tasks.
291
292 Redfish.Login
293
294 Redfish Purge Event Log
295
296 Redfish Power On stack_mode=skip quiet=1
297
298 ${status}= Run Keyword And Return Status Logging Test Binary Exist
299 Run Keyword If ${status} == ${False} Install Tarball
300
301
302Suite Teardown Execution
303 [Documentation] Do the post suite teardown.
304
305 Redfish.Logout