blob: e7446bc71582caa60ed95c92f156e5f864d8c613 [file] [log] [blame]
Chris Austenb29d2e82016-06-07 12:25:35 -05001*** Settings ***
George Keishingf58c4862017-03-28 13:01:03 -05002Documentation Test Error callout association.
Chris Austenb29d2e82016-06-07 12:25:35 -05003
George Keishingf58c4862017-03-28 13:01:03 -05004Resource ../lib/connection_client.robot
5Resource ../lib/openbmc_ffdc.robot
6Resource ../lib/utils.robot
7Resource ../lib/state_manager.robot
George Keishing95c371a2017-09-14 15:42:33 -05008Resource ../lib/boot_utils.robot
Chris Austenb29d2e82016-06-07 12:25:35 -05009
George Keishing95c371a2017-09-14 15:42:33 -050010Test Setup Test Setup Execution
George Keishing19b64552019-01-14 06:56:22 -060011Test Teardown FFDC On Test Case Fail
George Keishingd434c512016-10-07 06:46:29 -050012
Sweta Potthurie27b4392017-05-11 07:27:04 -050013***Variables***
George Keishingf2fe7452017-08-24 09:40:46 -050014${target_device_path} /sys/devices/platform/gpio-fsi/fsi0/slave@00:00/raw
Sweta Potthurie27b4392017-05-11 07:27:04 -050015
George Keishing95c371a2017-09-14 15:42:33 -050016${stack_mode} skip
17
Chris Austenb29d2e82016-06-07 12:25:35 -050018*** Test Cases ***
19
George Keishingf58c4862017-03-28 13:01:03 -050020Create Test Error Callout And Verify
21 [Documentation] Create error log callout and verify via REST.
22 [Tags] Create_Test_Error_Callout_And_Verify
Chris Austenb29d2e82016-06-07 12:25:35 -050023
George Keishingf58c4862017-03-28 13:01:03 -050024 Create Test Error With Callout
25 Verify Test Error Log And Callout
Chris Austenb29d2e82016-06-07 12:25:35 -050026
George Keishingad5817a2017-06-28 10:19:03 -050027
Sweta Potthurie27b4392017-05-11 07:27:04 -050028Create Test Error Callout And Verify AdditionalData
29 [Documentation] Create Test Error Callout And Verify AdditionalData.
30 [Tags] Create_Test_Error_Callout_And_Verify_AdditionalData
31
32 # Test error log entry example:
33 # "/xyz/openbmc_project/logging/entry/1": {
34 # "AdditionalData": [
35 # "CALLOUT_DEVICE_PATH_TEST=/sys/devices/platform/fsi-master/slave@00:00",
36 # "CALLOUT_ERRNO_TEST=0",
37 # "DEV_ADDR=0x0DEADEAD"
38 # ]
39
40 Create Test Error With Callout
George Keishingad5817a2017-06-28 10:19:03 -050041 ${elog_entry}= Get Elog URL List
42 ${resp}= OpenBMC Get Request ${elog_entry[0]}
Sweta Potthurie27b4392017-05-11 07:27:04 -050043 ${jsondata}= To JSON ${resp.content}
George Keishing04f9b8c2019-02-28 13:55:18 -060044 List Should Contain Value
45 ... ${jsondata["data"]["AdditionalData"]} CALLOUT_DEVICE_PATH_TEST=${target_device_path}
46 List Should Contain Value ${jsondata["data"]["AdditionalData"]} DEV_ADDR=0x0DEADEAD
Sweta Potthurie27b4392017-05-11 07:27:04 -050047
George Keishingad5817a2017-06-28 10:19:03 -050048
George Keishingc41eaa72017-07-27 04:04:32 -050049Create Test Error Callout And Verify Associations
50 [Documentation] Create test error callout and verify associations.
51 [Tags] Create_Test_Error_Callout_And_Verify_Associations
52
53 # Test error log association entry example:
54 # "associations": [
55 # [
56 # "callout",
57 # "fault",
58 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0"
59 # ]
60 # ]
61
62 Create Test Error With Callout
63 ${elog_entry}= Get Elog URL List
64 ${resp}= OpenBMC Get Request ${elog_entry[0]}
65 ${jsondata}= To JSON ${resp.content}
George Keishing04f9b8c2019-02-28 13:55:18 -060066 List Should Contain Value ${jsondata["data"]["associations"][0]} callout
67 List Should Contain Value ${jsondata["data"]["associations"][0]} fault
George Keishingc41eaa72017-07-27 04:04:32 -050068 List Should Contain Value
George Keishing04f9b8c2019-02-28 13:55:18 -060069 ... ${jsondata["data"]["associations"][0]}
George Keishingc41eaa72017-07-27 04:04:32 -050070 ... /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0
71
72
Sweta Potthurie27b4392017-05-11 07:27:04 -050073Create Test Error Callout And Delete
74 [Documentation] Create Test Error Callout And Delete.
75 [Tags] Create_Test_Error_Callout_And_Delete
76
77 # Test error log entry example:
78 # "/xyz/openbmc_project/logging/entry/1": {
79 # "AdditionalData": [
80 # "CALLOUT_DEVICE_PATH_TEST=/sys/devices/platform/fsi-master/slave@00:00",
81 # "CALLOUT_ERRNO_TEST=0",
82 # "DEV_ADDR=0x0DEADEAD"
83 # ],
84 # "Id": 1,
85 # "Message": "example.xyz.openbmc_project.Example.Elog.TestCallout",
86 # "Resolved": 0,
87 # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error",
88 # "Timestamp": 1487747332528,
89 # "associations": [
90 # [
91 # "callout",
92 # "fault",
93 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0"
94 # ]
95 # ]
96 # },
97 # "/xyz/openbmc_project/logging/entry/1/callout": {
98 # "endpoints": [
99 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0"
100 # ]
101 # },
102
103 Create Test Error With Callout
George Keishingad5817a2017-06-28 10:19:03 -0500104 ${elog_entry}= Get Elog URL List
105 Delete Error Log Entry ${elog_entry[0]}
106 ${resp}= OpenBMC Get Request ${elog_entry[0]}/callout
Sweta Potthurie27b4392017-05-11 07:27:04 -0500107 Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND}
108
George Keishingad5817a2017-06-28 10:19:03 -0500109
Sweta Potthurie27b4392017-05-11 07:27:04 -0500110Create Two Test Error Callout And Delete
111 [Documentation] Create Two Test Error Callout And Delete.
112 [Tags] Create_Two_Test_Error_Callout_And_Delete
113
114 # Test error log entry example:
115 # "/xyz/openbmc_project/logging/entry/1": {
116 # "AdditionalData": [
117 # "CALLOUT_DEVICE_PATH_TEST=/sys/devices/platform/fsi-master/slave@00:00",
118 # "CALLOUT_ERRNO_TEST=0",
119 # "DEV_ADDR=0x0DEADEAD"
120 # ],
121 # "Id": 1,
122 # "Message": "example.xyz.openbmc_project.Example.Elog.TestCallout",
123 # "Resolved": 0,
124 # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error",
125 # "Timestamp": 1487747332528,
126 # "associations": [
127 # [
128 # "callout",
129 # "fault",
130 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0"
131 # ]
132 # ]
133 # },
134 # "/xyz/openbmc_project/logging/entry/1/callout": {
135 # "endpoints": [
136 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0"
137 # ]
138 # },
139 # "/xyz/openbmc_project/logging/entry/2": {
140 # "AdditionalData": [
141 # "CALLOUT_DEVICE_PATH_TEST=/sys/devices/platform/fsi-master/slave@00:00",
142 # "CALLOUT_ERRNO_TEST=0",
143 # "DEV_ADDR=0x0DEADEAD"
144 # ],
145 # "Id": 2,
146 # "Message": "example.xyz.openbmc_project.Example.Elog.TestCallout",
147 # "Resolved": 0,
148 # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error",
149 # "Timestamp": 1487747332528,
150 # "associations": [
151 # [
152 # "callout",
153 # "fault",
154 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0"
155 # ]
156 # ]
157 # },
158 # "/xyz/openbmc_project/logging/entry/2/callout": {
159 # "endpoints": [
160 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0"
161 # ]
162 # },
163
164 # Create two error logs.
165 Create Test Error With Callout
166 Create Test Error With Callout
167
168 # Delete entry/2 elog entry.
George Keishingad5817a2017-06-28 10:19:03 -0500169 ${elog_entry}= Get Elog URL List
170 Delete Error Log Entry ${elog_entry[1]}
Sweta Potthurie27b4392017-05-11 07:27:04 -0500171
172 # Verify if entry/1 exist and entry/2 is deleted.
George Keishingad5817a2017-06-28 10:19:03 -0500173 ${resp}= OpenBMC Get Request ${elog_entry[0]}
174 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
175 ${resp}= OpenBMC Get Request ${elog_entry[1]}
176 Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND}
Chris Austenb29d2e82016-06-07 12:25:35 -0500177
Rahul Maheshwari43be6932017-05-01 02:37:06 -0500178Create Test Error Callout And Verify LED
179 [Documentation] Create an error log callout and verify respective
180 ... LED state.
181 [Tags] Create_Test_Error_Callout_And_Verify_LED
182
183 Create Test Error With Callout
184
185 ${resp}= Get LED State XYZ cpu0_fault
186 Should Be Equal ${resp} ${1}
187
Sweta Potthuriab73f9a2017-07-07 05:33:42 -0500188Set Resolved Field And Verify Callout Deletion
189 [Documentation] Set the "Resolved" error log and verify callout is deleted
190 [Tags] Set_Resolved_Field_And_Verify_Callout_Deletion
191
George Keishingcc71c3c2017-09-20 09:38:03 -0500192 Delete All Error Logs
Sweta Potthuriab73f9a2017-07-07 05:33:42 -0500193 Create Test Error With Callout
194 ${elog_entry}= Get URL List ${BMC_LOGGING_ENTRY}
195 ${resp}= OpenBMC Get Request ${elog_entry[0]}
196 ${jsondata}= To JSON ${resp.content}
George Keishing04f9b8c2019-02-28 13:55:18 -0600197 Should Contain ${jsondata["data"]["associations"][0]} callout
Sweta Potthuriab73f9a2017-07-07 05:33:42 -0500198
199 # Set the error log field "Resolved".
200 # By doing so, the callout object should get deleted automatically.
201 ${valueDict}= Create Dictionary data=${1}
202 OpenBMC Put Request ${elog_entry[0]}/attr/Resolved data=${valueDict}
203
204 # Verify if the callout entry is deleted.
205 ${resp}= OpenBMC Get Request ${elog_entry[0]}/callout
206 Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND}
Rahul Maheshwari43be6932017-05-01 02:37:06 -0500207
Chris Austenb29d2e82016-06-07 12:25:35 -0500208*** Keywords ***
209
George Keishing95c371a2017-09-14 15:42:33 -0500210Callout Test Binary Exist
George Keishingf58c4862017-03-28 13:01:03 -0500211 [Documentation] Verify existence of prerequisite callout-test.
Chris Austenb29d2e82016-06-07 12:25:35 -0500212
George Keishingd434c512016-10-07 06:46:29 -0500213 Open Connection And Log In
George Keishing95c371a2017-09-14 15:42:33 -0500214 ${out} ${stderr}= Execute Command
215 ... which /tmp/tarball/bin/callout-test return_stderr=True
George Keishingf58c4862017-03-28 13:01:03 -0500216 Should Be Empty ${stderr}
217 Should Contain ${out} callout-test
218
George Keishingf58c4862017-03-28 13:01:03 -0500219
George Keishingf58c4862017-03-28 13:01:03 -0500220Create Test Error With Callout
221 [Documentation] Generate test error log with callout for CPU0.
222
223 # Test error log entry example:
224 # "/xyz/openbmc_project/logging/entry/4": {
225 # "AdditionalData": [
226 # "CALLOUT_DEVICE_PATH_TEST=/sys/devices/platform/fsi-master/slave@00:00",
227 # "CALLOUT_ERRNO_TEST=0",
228 # "DEV_ADDR=0x0DEADEAD"
229 # ],
230 # "Id": 4,
231 # "Message": "example.xyz.openbmc_project.Example.Elog.TestCallout",
232 # "Resolved": 0,
233 # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error",
234 # "Timestamp": 1487747332528,
235 # "associations": [
236 # [
237 # "callout",
238 # "fault",
239 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0"
240 # ]
241 # ]
242 # },
243 # "/xyz/openbmc_project/logging/entry/4/callout": {
244 # "endpoints": [
245 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0"
246 # ]
247 # },
248
Joy Onyerikwu2ef965a2018-05-24 15:23:27 -0500249 BMC Execute Command
George Keishing95c371a2017-09-14 15:42:33 -0500250 ... /tmp/tarball/bin/callout-test ${target_device_path}
George Keishingf58c4862017-03-28 13:01:03 -0500251
252Verify Test Error Log And Callout
253 [Documentation] Verify test error log entries.
George Keishingad5817a2017-06-28 10:19:03 -0500254 ${elog_entry}= Get Elog URL List
255 ${resp}= OpenBMC Get Request ${elog_entry[0]}
256 ${json}= To JSON ${resp.content}
257
258 Should Be Equal ${json["data"]["Message"]}
George Keishingf58c4862017-03-28 13:01:03 -0500259 ... example.xyz.openbmc_project.Example.Elog.TestCallout
George Keishingad5817a2017-06-28 10:19:03 -0500260
261 Should Be Equal ${json["data"]["Severity"]}
George Keishingf58c4862017-03-28 13:01:03 -0500262 ... xyz.openbmc_project.Logging.Entry.Level.Error
George Keishingad5817a2017-06-28 10:19:03 -0500263
264 ${content}= Read Attribute ${elog_entry[0]}/callout endpoints
George Keishingf58c4862017-03-28 13:01:03 -0500265 Should Be Equal ${content[0]}
266 ... /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0
267
George Keishing95c371a2017-09-14 15:42:33 -0500268
269Test Setup Execution
Sweta Potthuri04c68d72017-07-19 06:06:50 -0500270 [Documentation] Do test case setup tasks.
George Keishing95c371a2017-09-14 15:42:33 -0500271
George Keishing5ee22d62018-05-07 02:23:09 -0500272 REST Power On stack_mode=skip quiet=1
Sweta Potthuri04c68d72017-07-19 06:06:50 -0500273 ${status}= Run Keyword And Return Status Callout Test Binary Exist
274 Run Keyword If ${status} == ${False} Install Tarball
275 Delete All Error Logs
George Keishing95c371a2017-09-14 15:42:33 -0500276
277
278Install Tarball
279 [Documentation] Install tarball on BMC.
280
281 Run Keyword If '${DEBUG_TARBALL_PATH}' == '${EMPTY}' Return from Keyword
282 BMC Execute Command rm -rf /tmp/tarball
283 Install Debug Tarball On BMC ${DEBUG_TARBALL_PATH}