blob: 450394c3f8832f6f25053dd1ab572bcb5f9afa0c [file] [log] [blame]
Alex Shatov9a4d3c52019-04-01 11:32:06 -04001# ============LICENSE_START=======================================================
2# Copyright (c) 2018-2019 AT&T Intellectual Property. All rights reserved.
3# ================================================================================
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15# ============LICENSE_END=========================================================
16#
17"""expected message history per test for pdp API 2019 and after"""
18
19
20HISTORY_EXPECTED = {
21 "tests/main/test_policy_rest.py::test_get_policy_latest" : [
22 {
23 "request": {
24 "headers": {
25 "Accept": "application/json",
26 "Authorization": "Basic auth",
27 "ClientAuth": "Basic user",
28 "Content-Type": "application/json",
29 "Environment": "TEST",
30 "X-ECOMP-RequestID": "*"
31 },
32 "json": {
33 "ONAPComponent": "policy_handler",
34 "ONAPInstance": "*",
35 "ONAPName": "DCAE",
36 "action": "configure",
37 "resource": {
38 "policy-id": [
39 "test_scope_prefix.pdp_desition_sit"
40 ]
41 }
42 },
43 "method": "post",
44 "params": None,
45 "uri": "https://unit-test-pdp-server:8081000/decision/v1/"
46 },
47 "res": "*",
48 "status_code": 200
49 }
50 ],
51 "tests/main/test_policyhandler.py::WebServerTest::test_web_all_policies_latest": [
52 {
53 "request": {
54 "headers": {
55 "X-ECOMP-RequestID": "*"
56 },
57 "json": None,
58 "method": "get",
59 "params": {
60 "cfy_tenant_name": "default_tenant"
61 },
62 "uri": "http://unit-test-deployment_handler:8188000/policy"
63 },
64 "res": "*",
65 "status_code": 200
66 },
67 {
68 "request": {
69 "headers": {
70 "Accept": "application/json",
71 "Authorization": "Basic auth",
72 "ClientAuth": "Basic user",
73 "Content-Type": "application/json",
74 "Environment": "TEST",
75 "X-ECOMP-RequestID": "*"
76 },
77 "json": {
78 "policyName": "test_scope_prefix.Config_.*"
79 },
80 "method": "post",
81 "params": None,
82 "uri": "https://unit-test-pdp-server:8081000/pdp/api/getConfig"
83 },
84 "res": "*",
85 "status_code": 200
86 }
87 ],
88 "tests/main/test_policyhandler.py::WebServerTest::test_web_policies_latest": [
89 {
90 "request": {
91 "headers": {
92 "Accept": "application/json",
93 "Authorization": "Basic auth",
94 "ClientAuth": "Basic user",
95 "Content-Type": "application/json",
96 "Environment": "TEST",
97 "X-ECOMP-RequestID": "*"
98 },
99 "json": {
100 "policyName": "test_scope_prefix.Config_amet.*"
101 },
102 "method": "post",
103 "params": None,
104 "uri": "https://unit-test-pdp-server:8081000/pdp/api/getConfig"
105 },
106 "res": "*",
107 "status_code": 200
108 }
109 ],
110 "tests/main/test_policyhandler.py::WebServerTest::test_web_policy_latest": [
111 {
112 "request": {
113 "headers": {
114 "Accept": "application/json",
115 "Authorization": "Basic auth",
116 "ClientAuth": "Basic user",
117 "Content-Type": "application/json",
118 "Environment": "TEST",
119 "X-ECOMP-RequestID": "*"
120 },
121 "json": {
122 "ONAPComponent": "policy_handler",
123 "ONAPInstance": "*",
124 "ONAPName": "DCAE",
125 "action": "configure",
126 "resource": {
127 "policy-id": [
128 "test_scope_prefix.pdp_desition_sit"
129 ]
130 }
131 },
132 "method": "post",
133 "params": None,
134 "uri": "https://unit-test-pdp-server:8081000/decision/v1/"
135 },
136 "res": "*",
137 "status_code": 200
138 }
139 ],
140 "tests/main/test_policyhandler.py::WebServerTest::test_zzzzz_shutdown": [
141 {
142 "request": {
143 "headers": {
144 "X-ECOMP-RequestID": "*"
145 },
146 "json": None,
147 "method": "get",
148 "params": {
149 "cfy_tenant_name": "default_tenant"
150 },
151 "uri": "http://unit-test-deployment_handler:8188000/policy"
152 },
153 "res": "*",
154 "status_code": 200
155 },
156 {
157 "request": {
158 "headers": {
159 "Accept": "application/json",
160 "Authorization": "Basic auth",
161 "ClientAuth": "Basic user",
162 "Content-Type": "application/json",
163 "Environment": "TEST",
164 "X-ECOMP-RequestID": "*"
165 },
166 "json": {
167 "policyName": "test_scope_prefix.Config_.*"
168 },
169 "method": "post",
170 "params": None,
171 "uri": "https://unit-test-pdp-server:8081000/pdp/api/getConfig"
172 },
173 "res": "*",
174 "status_code": 200
175 },
176 {
177 "request": {
178 "headers": {
179 "X-ECOMP-RequestID": "*"
180 },
181 "json": {
182 "catch_up": True,
183 "latest_policies": {
184 "test_scope_prefix.Config_Lorem": {
185 "policy_body": {
186 "config": {
187 "policy_hello": "world!",
188 "policy_updated_from_ver": "0",
189 "policy_updated_to_ver": "1",
190 "updated_policy_id": "test_scope_prefix.Config_Lorem"
191 },
192 "matchingConditions": {
193 "ConfigName": "alex_config_name",
194 "ONAPName": "DCAE"
195 },
196 "policyConfigMessage": "Config Retrieved! ",
197 "policyConfigStatus": "CONFIG_RETRIEVED",
198 "policyName": "test_scope_prefix.Config_Lorem.1.xml",
199 "policyVersion": "1",
200 "property": None,
201 "responseAttributes": {},
202 "type": "JSON"
203 },
204 "policy_id": "test_scope_prefix.Config_Lorem"
205 },
206 "test_scope_prefix.Config_amet": {
207 "policy_body": {
208 "config": {
209 "policy_hello": "world!",
210 "policy_updated_from_ver": "4",
211 "policy_updated_to_ver": "5",
212 "updated_policy_id": "test_scope_prefix.Config_amet"
213 },
214 "matchingConditions": {
215 "ConfigName": "alex_config_name",
216 "ONAPName": "DCAE"
217 },
218 "policyConfigMessage": "Config Retrieved! ",
219 "policyConfigStatus": "CONFIG_RETRIEVED",
220 "policyName": "test_scope_prefix.Config_amet.5.xml",
221 "policyVersion": "5",
222 "property": None,
223 "responseAttributes": {},
224 "type": "JSON"
225 },
226 "policy_id": "test_scope_prefix.Config_amet"
227 },
228 "test_scope_prefix.Config_ametist": {
229 "policy_body": {
230 "config": {
231 "policy_hello": "world!",
232 "policy_updated_from_ver": "6",
233 "policy_updated_to_ver": "7",
234 "updated_policy_id": "test_scope_prefix.Config_ametist"
235 },
236 "matchingConditions": {
237 "ConfigName": "alex_config_name",
238 "ONAPName": "DCAE"
239 },
240 "policyConfigMessage": "Config Retrieved! ",
241 "policyConfigStatus": "CONFIG_RETRIEVED",
242 "policyName": "test_scope_prefix.Config_ametist.7.xml",
243 "policyVersion": "7",
244 "property": None,
245 "responseAttributes": {},
246 "type": "JSON"
247 },
248 "policy_id": "test_scope_prefix.Config_ametist"
249 },
250 "test_scope_prefix.Config_consectetur": {
251 "policy_body": {
252 "config": {
253 "policy_hello": "world!",
254 "policy_updated_from_ver": "5",
255 "policy_updated_to_ver": "6",
256 "updated_policy_id": "test_scope_prefix.Config_consectetur"
257 },
258 "matchingConditions": {
259 "ConfigName": "alex_config_name",
260 "ONAPName": "DCAE"
261 },
262 "policyConfigMessage": "Config Retrieved! ",
263 "policyConfigStatus": "CONFIG_RETRIEVED",
264 "policyName": "test_scope_prefix.Config_consectetur.6.xml",
265 "policyVersion": "6",
266 "property": None,
267 "responseAttributes": {},
268 "type": "JSON"
269 },
270 "policy_id": "test_scope_prefix.Config_consectetur"
271 },
272 "test_scope_prefix.Config_dolor": {
273 "policy_body": {
274 "config": {
275 "policy_hello": "world!",
276 "policy_updated_from_ver": "2",
277 "policy_updated_to_ver": "3",
278 "updated_policy_id": "test_scope_prefix.Config_dolor"
279 },
280 "matchingConditions": {
281 "ConfigName": "alex_config_name",
282 "ONAPName": "DCAE"
283 },
284 "policyConfigMessage": "Config Retrieved! ",
285 "policyConfigStatus": "CONFIG_RETRIEVED",
286 "policyName": "test_scope_prefix.Config_dolor.3.xml",
287 "policyVersion": "3",
288 "property": None,
289 "responseAttributes": {},
290 "type": "JSON"
291 },
292 "policy_id": "test_scope_prefix.Config_dolor"
293 },
294 "test_scope_prefix.Config_ipsum": {
295 "policy_body": {
296 "config": {
297 "policy_hello": "world!",
298 "policy_updated_from_ver": "1",
299 "policy_updated_to_ver": "2",
300 "updated_policy_id": "test_scope_prefix.Config_ipsum"
301 },
302 "matchingConditions": {
303 "ConfigName": "alex_config_name",
304 "ONAPName": "DCAE"
305 },
306 "policyConfigMessage": "Config Retrieved! ",
307 "policyConfigStatus": "CONFIG_RETRIEVED",
308 "policyName": "test_scope_prefix.Config_ipsum.2.xml",
309 "policyVersion": "2",
310 "property": None,
311 "responseAttributes": {},
312 "type": "JSON"
313 },
314 "policy_id": "test_scope_prefix.Config_ipsum"
315 },
316 "test_scope_prefix.Config_sit": {
317 "policy_body": {
318 "config": {
319 "policy_hello": "world!",
320 "policy_updated_from_ver": "3",
321 "policy_updated_to_ver": "4",
322 "updated_policy_id": "test_scope_prefix.Config_sit"
323 },
324 "matchingConditions": {
325 "ConfigName": "alex_config_name",
326 "ONAPName": "DCAE"
327 },
328 "policyConfigMessage": "Config Retrieved! ",
329 "policyConfigStatus": "CONFIG_RETRIEVED",
330 "policyName": "test_scope_prefix.Config_sit.4.xml",
331 "policyVersion": "4",
332 "property": None,
333 "responseAttributes": {},
334 "type": "JSON"
335 },
336 "policy_id": "test_scope_prefix.Config_sit"
337 }
338 },
339 "policy_filter_matches": {
340 "test_scope_prefix.Config_Lorem": {},
341 "test_scope_prefix.Config_amet": {},
342 "test_scope_prefix.Config_ametist": {},
343 "test_scope_prefix.Config_consectetur": {},
344 "test_scope_prefix.Config_dolor": {},
345 "test_scope_prefix.Config_ipsum": {},
346 "test_scope_prefix.Config_sit": {}
347 },
348 "removed_policies": {}
349 },
350 "method": "put",
351 "params": {
352 "cfy_tenant_name": "default_tenant"
353 },
354 "uri": "http://unit-test-deployment_handler:8188000/policy"
355 },
356 "res": "*",
357 "status_code": 200
358 },
359 {
360 "request": {
361 "headers": {
362 "X-ECOMP-RequestID": "*"
363 },
364 "json": None,
365 "method": "get",
366 "params": {
367 "cfy_tenant_name": "default_tenant"
368 },
369 "uri": "http://unit-test-deployment_handler:8188000/policy"
370 },
371 "res": "*",
372 "status_code": 200
373 },
374 {
375 "request": {
376 "headers": {
377 "Accept": "application/json",
378 "Authorization": "Basic auth",
379 "ClientAuth": "Basic user",
380 "Content-Type": "application/json",
381 "Environment": "TEST",
382 "X-ECOMP-RequestID": "*"
383 },
384 "json": {
385 "policyName": "test_scope_prefix.Config_ipsum"
386 },
387 "method": "post",
388 "params": None,
389 "uri": "https://unit-test-pdp-server:8081000/pdp/api/getConfig"
390 },
391 "res": "*",
392 "status_code": 200
393 },
394 {
395 "request": {
396 "headers": {
397 "Accept": "application/json",
398 "Authorization": "Basic auth",
399 "ClientAuth": "Basic user",
400 "Content-Type": "application/json",
401 "Environment": "TEST",
402 "X-ECOMP-RequestID": "*"
403 },
404 "json": {
405 "policyName": "test_scope_prefix.Config_sit"
406 },
407 "method": "post",
408 "params": None,
409 "uri": "https://unit-test-pdp-server:8081000/pdp/api/getConfig"
410 },
411 "res": "*",
412 "status_code": 200
413 },
414 {
415 "request": {
416 "headers": {
417 "Accept": "application/json",
418 "Authorization": "Basic auth",
419 "ClientAuth": "Basic user",
420 "Content-Type": "application/json",
421 "Environment": "TEST",
422 "X-ECOMP-RequestID": "*"
423 },
424 "json": {
425 "policyName": "test_scope_prefix.Config_consectetur"
426 },
427 "method": "post",
428 "params": None,
429 "uri": "https://unit-test-pdp-server:8081000/pdp/api/getConfig"
430 },
431 "res": "*",
432 "status_code": 200
433 },
434 {
435 "request": {
436 "headers": {
437 "X-ECOMP-RequestID": "*"
438 },
439 "json": {
440 "catch_up": False,
441 "latest_policies": {
442 "test_scope_prefix.Config_consectetur": {
443 "policy_body": {
444 "config": {
445 "policy_hello": "world!",
446 "policy_updated_from_ver": "5",
447 "policy_updated_to_ver": "6",
448 "updated_policy_id": "test_scope_prefix.Config_consectetur"
449 },
450 "matchingConditions": {
451 "ConfigName": "alex_config_name",
452 "ONAPName": "DCAE"
453 },
454 "policyConfigMessage": "Config Retrieved! ",
455 "policyConfigStatus": "CONFIG_RETRIEVED",
456 "policyName": "test_scope_prefix.Config_consectetur.6.xml",
457 "policyVersion": "6",
458 "property": None,
459 "responseAttributes": {},
460 "type": "JSON"
461 },
462 "policy_id": "test_scope_prefix.Config_consectetur"
463 },
464 "test_scope_prefix.Config_ipsum": {
465 "policy_body": {
466 "config": {
467 "policy_hello": "world!",
468 "policy_updated_from_ver": "1",
469 "policy_updated_to_ver": "2",
470 "updated_policy_id": "test_scope_prefix.Config_ipsum"
471 },
472 "matchingConditions": {
473 "ConfigName": "alex_config_name",
474 "ONAPName": "DCAE"
475 },
476 "policyConfigMessage": "Config Retrieved! ",
477 "policyConfigStatus": "CONFIG_RETRIEVED",
478 "policyName": "test_scope_prefix.Config_ipsum.2.xml",
479 "policyVersion": "2",
480 "property": None,
481 "responseAttributes": {},
482 "type": "JSON"
483 },
484 "policy_id": "test_scope_prefix.Config_ipsum"
485 },
486 "test_scope_prefix.Config_sit": {
487 "policy_body": {
488 "config": {
489 "policy_hello": "world!",
490 "policy_updated_from_ver": "3",
491 "policy_updated_to_ver": "4",
492 "updated_policy_id": "test_scope_prefix.Config_sit"
493 },
494 "matchingConditions": {
495 "ConfigName": "alex_config_name",
496 "ONAPName": "DCAE"
497 },
498 "policyConfigMessage": "Config Retrieved! ",
499 "policyConfigStatus": "CONFIG_RETRIEVED",
500 "policyName": "test_scope_prefix.Config_sit.4.xml",
501 "policyVersion": "4",
502 "property": None,
503 "responseAttributes": {},
504 "type": "JSON"
505 },
506 "policy_id": "test_scope_prefix.Config_sit"
507 }
508 },
509 "policy_filter_matches": {
510 "test_scope_prefix.Config_consectetur": {},
511 "test_scope_prefix.Config_ipsum": {},
512 "test_scope_prefix.Config_sit": {}
513 },
514 "removed_policies": {}
515 },
516 "method": "put",
517 "params": {
518 "cfy_tenant_name": "default_tenant"
519 },
520 "uri": "http://unit-test-deployment_handler:8188000/policy"
521 },
522 "res": "*",
523 "status_code": 200
524 }
525 ]
526}