blob: 02a1abb76ded5e5b4cd8b5496ba08941adf27aed [file] [log] [blame]
Chris Austenb29d2e82016-06-07 12:25:35 -05001*** Settings ***
George Keishing85536662017-03-03 10:49:58 -06002Documentation Verify REST services Get/Put/Post/Delete.
Chris Austenb29d2e82016-06-07 12:25:35 -05003
George Keishing97651c72016-10-04 00:44:15 -05004Resource ../lib/rest_client.robot
George Keishingd55a4be2016-08-26 03:28:17 -05005Resource ../lib/openbmc_ffdc.robot
Sandhya Somashekar839a0c22019-01-31 05:05:43 -06006Resource ../lib/resource.robot
Sivas SRRa13eb202017-11-03 10:01:56 -05007Resource ../lib/utils.robot
George Keishing85536662017-03-03 10:49:58 -06008Library Collections
George Keishingb53a37e2018-10-26 11:59:34 -05009
Gunnar Millseac1af22016-11-14 15:30:09 -060010Test Teardown FFDC On Test Case Fail
Chris Austenb29d2e82016-06-07 12:25:35 -050011
Chris Austenb29d2e82016-06-07 12:25:35 -050012*** Variables ***
13
Chris Austenb29d2e82016-06-07 12:25:35 -050014*** Test Cases ***
Chris Austenb29d2e82016-06-07 12:25:35 -050015
George Keishing89f7c1f2017-05-03 16:08:37 -050016REST Login Session To BMC
17 [Documentation] Test REST session log-in.
18 [Tags] REST_Login_Session_To_BMC
19
20 Initialize OpenBMC
21 # Raw GET REST operation to verify session is established.
22 ${resp}= Get Request openbmc /xyz/openbmc_project/
23 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
24
25
26REST Logout Session To BMC
27 [Documentation] Test REST session log-out.
28 [Tags] REST_Logout_Session_To_BMC
29
30 Initialize OpenBMC
31 Log Out OpenBMC
32 # Raw GET REST operation to verify session is logout.
33 ${resp}= Get Request openbmc /xyz/openbmc_project/
34 Should Be Equal As Strings ${resp.status_code} ${HTTP_UNAUTHORIZED}
35
36
George Keishing6715f312017-05-10 03:22:40 -050037REST Delete All Sessions And Expect Error
38 [Documentation] Test REST empty cache using delete operation.
39 [Tags] REST_Delete_All_Sessions_And_Expect_Error
40
41 # Throws exception:
42 # Non-existing index or alias 'openbmc'.
43
44 Initialize OpenBMC
45 Delete All Sessions
46 # Raw GET REST operation and expect exception error.
47 Run Keyword And Expect Error
48 ... Non-existing index or alias 'openbmc'.
49 ... Get Request openbmc /xyz/openbmc_project/
50
51
George Keishing3b1f2772017-07-31 09:44:45 -050052Multiple Requests On BMC Using Single REST Session
53 [Documentation] Trigger multiple REST operations using an active
54 ... connection session.
55 [Tags] Multiple_Requests_On_BMC_Using_Single_REST_Session
56
57 Initialize OpenBMC
58
59 # Session object "openbmc".
60 ${resp}= Get Request openbmc /xyz/openbmc_project/state/
61 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
62
63 ${resp}= Get Request openbmc /xyz/openbmc_project/software/enumerate
64 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
65
66
George Keishing6715f312017-05-10 03:22:40 -050067Verify REST JSON Data On Success
68 [Documentation] Verify JSON data success response messages.
69 [Tags] Verify_REST_JSON_Data_On_Success
70 # Example:
71 # Response code:200, Content:{
72 # "data": [
73 # "/xyz/openbmc_project/sensors",
74 # "/xyz/openbmc_project/inventory",
75 # "/xyz/openbmc_project/software",
76 # "/xyz/openbmc_project/object_mapper",
77 # "/xyz/openbmc_project/logging"
78 # ],
79 # "message": "200 OK",
80 # "status": "ok"
81 # }
82
83 ${resp}= OpenBMC Get Request /xyz/openbmc_project/
84 ${jsondata}= To JSON ${resp.content}
85 Should Not Be Empty ${jsondata["data"]}
86 Should Be Equal As Strings ${jsondata["message"]} 200 OK
87 Should Be Equal As Strings ${jsondata["status"]} ok
88
89
90Verify REST JSON Data On Failure
91 [Documentation] Verify JSON data failure response messages.
92 [Tags] Verify_REST_JSON_Data_On_Failure
93 # Example:
94 # Response code:404, Content:{
95 # "data": {
Andrew Geisslerb4312f32018-11-14 15:57:49 -060096 # "description": "org.freedesktop.DBus.Error.FileNotFound: path or object not found:
97 # /xyz/idont/exist"
George Keishing6715f312017-05-10 03:22:40 -050098 # },
99 # "message": "404 Not Found",
100 # "status": "error"
101 # }
102
103 ${resp}= OpenBMC Get Request /xyz/idont/exist/
104 ${jsondata}= To JSON ${resp.content}
George Keishing0c217642018-11-14 21:10:19 -0600105 Should Contain ${jsondata["data"]["description"]}
106 ... org.freedesktop.DBus.Error.FileNotFound: path or object not found
George Keishing6715f312017-05-10 03:22:40 -0500107 Should Be Equal As Strings ${jsondata["message"]} 404 Not Found
108 Should Be Equal As Strings ${jsondata["status"]} error
109
110
George Keishingadefa262017-07-08 12:54:06 -0500111Verify REST Get Message JSON Compliant
112 [Documentation] Verify REST "GET" message is JSON format compliant.
113 [Tags] Verify_REST_Get_Message_JSON_Compliant
114 # For testing if the REST message is JSON format compliant using a
115 # generic BMC state path /xyz/openbmc_project/state object and path
116 # walking through to ensure the parent object, trailing slash and
117 # attribute message response are intact.
118
119 # Object attribute data.
120 # Example:
121 # Response code:200, Content:{
122 # "data": {
123 # "CurrentBMCState": "xyz.openbmc_project.State.BMC.BMCState.Ready",
124 # "RequestedBMCTransition": "xyz.openbmc_project.State.BMC.Transition.None"
125 # },
126 # "message": "200 OK",
127 # "status": "ok"
128 # }
129
130 Verify JSON Response Content
131 ... /xyz/openbmc_project/state/bmc0 DATA_NOT_EMPTY
132
133 # Object trailing slash attribute data.
134 # Example:
135 # Response code:200, Content:{
136 # "data": [],
137 # "message": "200 OK",
138 # "status": "ok"
139 # }
140
141 Verify JSON Response Content /xyz/openbmc_project/state/bmc0/
142
143 # Attribute data.
144 # Example:
145 # Response code:200, Content:{
146 # "data": "xyz.openbmc_project.State.BMC.BMCState.Ready",
147 # "message": "200 OK",
148 # "status": "ok"
149 # }
150
151 Verify JSON Response Content
152 ... /xyz/openbmc_project/state/bmc0/attr/CurrentBMCState DATA_NOT_EMPTY
153
154
155Verify REST Post Message JSON Compliant
156 [Documentation] Verify REST "POST" message is JSON format compliant.
157 [Tags] Verify_REST_Post_Message_JSON_Compliant
158 # Example:
159 # Response code:200, Content:{
160 # "data": null,
161 # "message": "200 OK",
162 # "status": "ok"
163 # }
164
George Keishingd580a9a2018-04-20 01:17:12 -0500165 # Clear existing gard records, if any.
166 ${data}= Create Dictionary data=@{EMPTY}
167 ${resp}= Openbmc Post Request ${OPENPOWER_CONTROL}gard/action/Reset
168 ... data=${data}
George Keishingadefa262017-07-08 12:54:06 -0500169 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
170 ${jsondata}= To JSON ${resp.content}
171 Should Be Equal ${jsondata["data"]} ${None}
172 Should Be Equal As Strings ${jsondata["message"]} 200 OK
173 Should Be Equal As Strings ${jsondata["status"]} ok
174
George Keishingadefa262017-07-08 12:54:06 -0500175
George Keishingf0c1af92018-04-12 08:10:43 -0500176Verify REST Bad Request Post Message JSON Compliant
177 [Documentation] Verify REST "POST" message is JSON format compliant.
178 [Tags] Verify_REST_Bad_Request_Post_Message_JSON_Compliant
179 # Example:
180 # {
181 # "data": {
182 # "description": "Version already exists or failed to be extracted"
183 # },
184 # "message": "400 Bad Request",
185 # "status": "error"
186 # }
187
188 # Generate 1KB file size
189 Run dd if=/dev/zero of=dummyfile bs=1 count=0 seek=1KB
190 OperatingSystem.File Should Exist dummyfile
191
192 # Get the content of the file and upload to BMC
193 ${image_data}= OperatingSystem.Get Binary File dummyfile
194
195 # Get REST session to BMC
196 Initialize OpenBMC
197
198 # Create the REST payload headers and data
199 ${data}= Create Dictionary data ${image_data}
200 ${headers}= Create Dictionary Content-Type=application/octet-stream
Sridevi Ramesheadeef02019-01-17 08:56:18 -0600201 ... X-Auth-Token=${XAUTH_TOKEN} Accept=application/octet-stream
George Keishingf0c1af92018-04-12 08:10:43 -0500202 Set To Dictionary ${data} headers ${headers}
203
204 ${resp}= Post Request openbmc /upload/image &{data}
205 Should Be Equal As Strings ${resp.status_code} ${HTTP_BAD_REQUEST}
206 ${jsondata}= To JSON ${resp.content}
207 Should Be Equal ${jsondata["data"]["description"]}
208 ... Version already exists or failed to be extracted
209 Should Be Equal As Strings ${jsondata["message"]} 400 Bad Request
210 Should Be Equal As Strings ${jsondata["status"]} error
211 Delete All Error Logs
212
213
George Keishinge6594f22017-07-06 12:10:52 -0500214Check Response Codes HTTP_UNSUPPORTED_MEDIA_TYPE
215 [Documentation] REST "Post" response status test for
216 ... HTTP_UNSUPPORTED_MEDIA_TYPE.
George Keishingac8661e2022-02-10 00:36:12 -0600217 [Tags] Check_Response_Codes_HTTP_UNSUPPORTED_MEDIA_TYPE
George Keishinge6594f22017-07-06 12:10:52 -0500218
219 # Example:
220 # Response code:415, Content:{
221 # "data": {
222 # "description": "Expecting content type 'application/octet-stream', got 'application/json'"
223 # },
224 # "message": "415 Unsupported Media Type",
225 # "status": "error"
226 # }
227
228 Initialize OpenBMC
229
230 # Create the REST payload headers and EMPTY data
231 ${data}= Create Dictionary data ${EMPTY}
Sridevi Ramesheadeef02019-01-17 08:56:18 -0600232 ${headers}= Create Dictionary Content-Type=application/json X-Auth-Token=${XAUTH_TOKEN}
George Keishinge6594f22017-07-06 12:10:52 -0500233 Set To Dictionary ${data} headers ${headers}
234
235 ${resp}= Post Request openbmc /upload/image &{data}
236 Should Be Equal As Strings
237 ... ${resp.status_code} ${HTTP_UNSUPPORTED_MEDIA_TYPE}
238
239 ${jsondata}= To JSON ${resp.content}
240 Should Be Equal As Strings ${jsondata["data"]["description"]}
241 ... Expecting content type 'application/octet-stream', got 'application/json'
242 Should Be Equal As Strings
243 ... ${jsondata["message"]} 415 Unsupported Media Type
244 Should Be Equal As Strings ${jsondata["status"]} error
245
246
George Keishing85536662017-03-03 10:49:58 -0600247Get Response Codes
248 [Documentation] REST "Get" response status test.
George Keishing5abfe602018-07-05 11:54:37 -0500249 [Tags] Get_Response_Codes
250 [Template] Execute Get And Check Response
251
George Keishing85536662017-03-03 10:49:58 -0600252 # Expect status URL Path
George Keishing85536662017-03-03 10:49:58 -0600253 ${HTTP_OK} /xyz/openbmc_project/
George Keishing5cb75f82017-12-11 08:41:34 -0600254 ${HTTP_OK} /xyz/openbmc_project/state/enumerate
Andrew Geissler9796d292019-01-17 10:05:16 -0600255 ${HTTP_NOT_FOUND} /xyz/i/dont/exist/
Chris Austenb29d2e82016-06-07 12:25:35 -0500256
Chris Austenb29d2e82016-06-07 12:25:35 -0500257
George Keishing85536662017-03-03 10:49:58 -0600258Get Data
259 [Documentation] REST "Get" request url and expect the
260 ... response OK and data non empty.
George Keishing5abfe602018-07-05 11:54:37 -0500261 [Tags] Get_Data
262 [Template] Execute Get And Check Data
263
George Keishing85536662017-03-03 10:49:58 -0600264 # URL Path
George Keishing85536662017-03-03 10:49:58 -0600265 /xyz/openbmc_project/
266 /xyz/openbmc_project/list
George Keishing5cb75f82017-12-11 08:41:34 -0600267 /xyz/openbmc_project/state/enumerate
Chris Austenb29d2e82016-06-07 12:25:35 -0500268
Chris Austenb29d2e82016-06-07 12:25:35 -0500269
George Keishing85536662017-03-03 10:49:58 -0600270Get Data Validation
271 [Documentation] REST "Get" request url and expect the
272 ... pre-defined string in response data.
George Keishing85536662017-03-03 10:49:58 -0600273 [Tags] Get_Data_Validation
274 [Template] Execute Get And Verify Data
275
George Keishing5abfe602018-07-05 11:54:37 -0500276 # URL Path Expect Data
277 /xyz/openbmc_project/ /xyz/openbmc_project/logging
Andrew Geissler9796d292019-01-17 10:05:16 -0600278 /org/i/dont/exist/ path or object not found
George Keishing5abfe602018-07-05 11:54:37 -0500279
George Keishing85536662017-03-03 10:49:58 -0600280
281Put Response Codes
282 [Documentation] REST "Put" request url and expect the REST pre-defined
283 ... codes.
George Keishing5abfe602018-07-05 11:54:37 -0500284 [Tags] Put_Response_Codes
285 [Template] Execute Put And Check Response
286
George Keishing85536662017-03-03 10:49:58 -0600287 # Expect status URL Path
George Keishing85536662017-03-03 10:49:58 -0600288 ${HTTP_METHOD_NOT_ALLOWED} /
George Keishing8ec4b7f2019-10-18 11:32:36 -0500289 ${HTTP_NOT_FOUND} /xyz/
290 ${HTTP_FORBIDDEN} /xyz/i/dont/exist/
George Keishing85536662017-03-03 10:49:58 -0600291
George Keishing85536662017-03-03 10:49:58 -0600292
293Put Data Validation
294 [Documentation] REST "Put" request url and expect success.
George Keishing85536662017-03-03 10:49:58 -0600295 [Tags] Put_Data_Validation
296 [Template] Execute Put And Expect Success
297
George Keishing5abfe602018-07-05 11:54:37 -0500298 # URL Path Parm Data
299 /xyz/openbmc_project/state/host0/attr/RequestedHostTransition
300 ... xyz.openbmc_project.State.Host.Transition.Off
301
George Keishing85536662017-03-03 10:49:58 -0600302
303Post Response Code
304 [Documentation] REST Post request url and expect the
305 ... REST response code pre define.
George Keishingac8661e2022-02-10 00:36:12 -0600306 [Tags] Post_Response_Code
George Keishing5abfe602018-07-05 11:54:37 -0500307 [Template] Execute Post And Check Response
308
George Keishing85536662017-03-03 10:49:58 -0600309 # Expect status URL Path
George Keishing85536662017-03-03 10:49:58 -0600310 ${HTTP_METHOD_NOT_ALLOWED} /
George Keishing8ec4b7f2019-10-18 11:32:36 -0500311 ${HTTP_NOT_FOUND} /xyz/
Andrew Geissler9796d292019-01-17 10:05:16 -0600312 ${HTTP_METHOD_NOT_ALLOWED} /xyz/i/dont/exist/
George Keishing5cb75f82017-12-11 08:41:34 -0600313 ${HTTP_METHOD_NOT_ALLOWED} /xyz/login
George Keishing85536662017-03-03 10:49:58 -0600314
George Keishing85536662017-03-03 10:49:58 -0600315
316Delete Response Code
317 [Documentation] REST "Delete" request url and expect the
318 ... REST response code pre define.
George Keishingac8661e2022-02-10 00:36:12 -0600319 [Tags] Delete_Response_Code
George Keishing5abfe602018-07-05 11:54:37 -0500320 [Template] Execute Delete And Check Response
321
George Keishing85536662017-03-03 10:49:58 -0600322 # Expect status URL Path
George Keishing85536662017-03-03 10:49:58 -0600323 ${HTTP_METHOD_NOT_ALLOWED} /
George Keishing8ec4b7f2019-10-18 11:32:36 -0500324 ${HTTP_NOT_FOUND} /xyz/
George Keishing85536662017-03-03 10:49:58 -0600325 ${HTTP_METHOD_NOT_ALLOWED} /xyz/nothere/
George Keishing5cb75f82017-12-11 08:41:34 -0600326 ${HTTP_METHOD_NOT_ALLOWED} /xyz/openbmc_project/state/
George Keishing85536662017-03-03 10:49:58 -0600327
Gunnar Mills56b32892016-11-14 13:56:17 -0600328
manasarm5f76a2d2018-01-11 11:34:41 +0530329Verify All REST Objects Are Accessible
330 [Documentation] Verify all the REST objects are accessible using "GET".
331 [Tags] Verify_All_REST_Objects_Are_Accessible
332
333 ${uri_list}= Get Sub URI List ${OPENBMC_BASE_URI}
George Keishing32e4d172018-10-01 07:41:56 -0500334
335 # URI's which won't support GET request.
336 Remove Values From List ${uri_list}
337 ... /xyz/openbmc_project/certs/client/ldap
338 ... /xyz/openbmc_project/certs/server/https
George Keishing97ab2512018-10-12 01:47:01 -0500339 ... /xyz/openbmc_project/certs/authority/ldap
George Keishinga507a9f2019-01-16 07:14:39 -0600340 ... /xyz/openbmc_project/ipmi
341 ... /xyz/openbmc_project/ipmi/internal
George Keishinga1d86562019-01-18 08:52:37 -0600342 ... /xyz/openbmc_project/ipmi/internal/soft_power_off
George Keishing32e4d172018-10-01 07:41:56 -0500343
manasarm5f76a2d2018-01-11 11:34:41 +0530344 ${error_uri_list}= Create List
Sushil Singhbe97ffc2019-06-04 06:34:24 -0500345 FOR ${uri} IN @{uri_list}
346 ${resp}= Openbmc Get Request ${uri} quiet=${1}
347 Run keyword if '${resp.status_code}' != '${HTTP_OK}'
348 ... Append To List ${error_uri_list} ${uri} : ${resp.status_code}
349 END
manasarm5f76a2d2018-01-11 11:34:41 +0530350 Should Be Empty ${error_uri_list}
351
George Keishing2658dd12019-01-16 01:28:53 -0600352
353Verify REST Put Message JSON Compliant
354 [Documentation] Verify REST "PUT" message is JSON format compliant.
George Keishingac8661e2022-02-10 00:36:12 -0600355 [Tags] Verify_REST_Put_Message_JSON_Compliant
George Keishing2658dd12019-01-16 01:28:53 -0600356 # Example:
357 # Response code:200, Content:{
358 # "data": null,
359 # "message": "200 OK",
360 # "status": "ok"
361 # }
362
363 ${dict_data}= Create Dictionary data=${HOST_POWEROFF_TRANS}
364 ${resp}= Openbmc Put Request
365 ... ${HOST_STATE_URI}attr/RequestedHostTransition data=${dict_data}
366 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
367 ${jsondata}= To JSON ${resp.content}
368 Should Be Equal ${jsondata["data"]} ${None}
369 Should Be Equal As Strings ${jsondata["message"]} 200 OK
370 Should Be Equal As Strings ${jsondata["status"]} ok
371 # Intention is not to test poweroff but to check the REST operation
372 # sink time allowing to kick poweroff.
373 Sleep 10s
374
Gunnar Mills7c8923f2016-12-12 21:19:52 -0600375*** Keywords ***
George Keishing85536662017-03-03 10:49:58 -0600376
manasarm5f76a2d2018-01-11 11:34:41 +0530377Get Sub URI List
378 [Documentation] Return list of sub URIs inside the URI sent by caller.
379 [Arguments] ${uri}
380 # Description of argument(s):
381 # uri The URI for which all the sub URIs are returned.
382 # Example:
383 # "/xyz/openbmc_project/"
384 ${resp}= Openbmc Get Request ${uri}list quiet=${1}
385 ${sub_uris}= Collections.Get From Dictionary ${resp.json()} data
386 [Return] ${sub_uris}
387
George Keishing85536662017-03-03 10:49:58 -0600388Execute Get And Check Response
389 [Documentation] Request "Get" url path and expect REST response code.
390 [Arguments] ${expected_response_code} ${url_path}
391 # Description of arguments:
392 # expected_response_code Expected REST status codes.
393 # url_path URL path.
394 ${resp}= Openbmc Get Request ${url_path}
395 Should Be Equal As Strings ${resp.status_code} ${expected_response_code}
396
397Execute Get And Check Data
398 [Documentation] Request "Get" url path and expect non empty data.
399 [Arguments] ${url_path}
400 # Description of arguments:
401 # url_path URL path.
402 ${resp}= Openbmc Get Request ${url_path}
403 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
404 ${jsondata}= To JSON ${resp.content}
405 Should Not Be Empty ${jsondata["data"]}
406
407Execute Get And Verify Data
408 [Documentation] Request "Get" url path and verify data.
409 [Arguments] ${url_path} ${expected_response_code}
410 # Description of arguments:
411 # expected_response_code Expected REST status codes.
412 # url_path URL path.
413 ${resp}= Openbmc Get Request ${url_path}
414 ${jsondata}= To JSON ${resp.content}
415 Run Keyword If '${resp.status_code}' == '${HTTP_OK}'
416 ... Should Contain ${jsondata["data"]} ${expected_response_code}
417 ... ELSE
418 ... Should Contain ${jsondata["data"]["description"]} ${expected_response_code}
419
420Execute Put And Check Response
421 [Documentation] Request "Put" url path and expect REST response code.
422 [Arguments] ${expected_response_code} ${url_path}
423 # Description of arguments:
424 # expected_response_code Expected REST status codes.
425 # url_path URL path.
426 ${resp}= Openbmc Put Request ${url_path}
427 Should Be Equal As Strings ${resp.status_code} ${expected_response_code}
428
429Execute Put And Expect Success
430 [Documentation] Request "Put" on url path.
431 [Arguments] ${url_path} ${parm}
432 # Description of arguments:
433 # url_path URL path.
434 # parm Value/string to be set.
435 # expected_response_code Expected REST status codes.
436 ${parmDict}= Create Dictionary data=${parm}
437 ${resp}= Openbmc Put Request ${url_path} data=${parmDict}
438 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
439
440Execute Post And Check Response
441 [Documentation] Request Post url path and expect REST response code.
442 [Arguments] ${expected_response_code} ${url_path}
443 # Description of arguments:
444 # expected_response_code Expected REST status codes.
445 # url_path URL path.
446 ${resp}= Openbmc Post Request ${url_path}
447 Should Be Equal As Strings ${resp.status_code} ${expected_response_code}
448
449Execute Post And Check Data
450 [Arguments] ${url_path} ${parm}
451 [Documentation] Request Post on url path and expected non empty data.
452 # Description of arguments:
453 # url_path URL path.
George Keishing4c02e622017-04-17 07:57:10 -0500454 ${data}= Create Dictionary data=@{parm}
George Keishing85536662017-03-03 10:49:58 -0600455 ${resp}= Openbmc Post Request ${url_path} data=${data}
456 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
457 ${jsondata}= To JSON ${resp.content}
458 Should Not Be Empty ${jsondata["data"]}
459
460Execute Delete And Check Response
461 [Documentation] Request "Delete" url path and expected REST response code.
462 [Arguments] ${expected_response_code} ${url_path}
463 # Description of arguments:
464 # expected_response_code Expected REST status codes.
465 # url_path URL path.
George Keishing4c02e622017-04-17 07:57:10 -0500466 ${data}= Create Dictionary data=@{EMPTY}
467 ${resp}= Openbmc Delete Request ${url_path} data=${data}
George Keishing85536662017-03-03 10:49:58 -0600468 Should Be Equal As Strings ${resp.status_code} ${expected_response_code}
George Keishingadefa262017-07-08 12:54:06 -0500469
470Verify JSON Response Content
471 [Documentation] Verify JSON response data is intact.
472 [Arguments] ${url_path} ${data_empty}=${EMPTY}
473
474 # Description of argument(s):
475 # url_path URL path.
476 # data_empty JSON data element.
477
478 ${resp}= OpenBMC Get Request ${url_path}
479 ${jsondata}= To JSON ${resp.content}
480 Run Keyword If '${data_empty}' == '${EMPTY}'
481 ... Should Be Empty ${jsondata["data"]}
482 ... ELSE
483 ... Should Not Be Empty ${jsondata["data"]}
484 Should Be Equal As Strings ${jsondata["message"]} 200 OK
485 Should Be Equal As Strings ${jsondata["status"]} ok