Merge "NONRTRIC - Implement DMaaP mediator producer service in Java"
[nonrtric.git] / test / auto-test / FTC100.sh
1 #!/bin/bash
2
3 #  ============LICENSE_START===============================================
4 #  Copyright (C) 2020 Nordix Foundation. All rights reserved.
5 #  ========================================================================
6 #  Licensed under the Apache License, Version 2.0 (the "License");
7 #  you may not use this file except in compliance with the License.
8 #  You may obtain a copy of the License at
9 #
10 #       http://www.apache.org/licenses/LICENSE-2.0
11 #
12 #  Unless required by applicable law or agreed to in writing, software
13 #  distributed under the License is distributed on an "AS IS" BASIS,
14 #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 #  See the License for the specific language governing permissions and
16 #  limitations under the License.
17 #  ============LICENSE_END=================================================
18 #
19
20
21 TC_ONELINE_DESCR="Full agent API walkthrough using agent REST/DMAAP and with/without SDNC A1 Controller"
22
23 #App names to include in the test when running docker, space separated list
24 DOCKER_INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC NGW KUBEPROXY"
25
26 #App names to include in the test when running kubernetes, space separated list
27 KUBE_INCLUDED_IMAGES="CP CR MR PA RICSIM SDNC KUBEPROXY NGW"
28 #Prestarted app (not started by script) to include in the test when running kubernetes, space separated list
29 KUBE_PRESTARTED_IMAGES=""
30
31 #Ignore image in DOCKER_INCLUDED_IMAGES, KUBE_INCLUDED_IMAGES if
32 #the image is not configured in the supplied env_file
33 #Used for images not applicable to all supported profile
34 CONDITIONALLY_IGNORED_IMAGES="NGW"
35
36 #Supported test environment profiles
37 SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-D-RELEASE ORAN-E-RELEASE"
38 #Supported run modes
39 SUPPORTED_RUNMODES="DOCKER KUBE"
40
41 . ../common/testcase_common.sh  $@
42 . ../common/agent_api_functions.sh
43 . ../common/consul_cbs_functions.sh
44 . ../common/control_panel_api_functions.sh
45 . ../common/controller_api_functions.sh
46 . ../common/cr_api_functions.sh
47 . ../common/mr_api_functions.sh
48 . ../common/ricsimulator_api_functions.sh
49 . ../common/kube_proxy_api_functions.sh
50 . ../common/gateway_api_functions.sh
51
52 setup_testenvironment
53
54 #### TEST BEGIN ####
55
56 generate_policy_uuid
57
58 # Tested variants of REST/DMAAP/SDNC config
59 TESTED_VARIANTS="REST   DMAAP   REST+SDNC   DMAAP+SDNC"
60
61 #Test agent and simulator protocol versions (others are http only)
62 TESTED_PROTOCOLS="HTTP HTTPS"
63
64 for __httpx in $TESTED_PROTOCOLS ; do
65     for interface in $TESTED_VARIANTS ; do
66
67         echo "#####################################################################"
68         echo "#####################################################################"
69         echo "### Testing agent: $interface using $__httpx"
70         echo "#####################################################################"
71         echo "#####################################################################"
72
73         # Clean container and start all needed containers #
74         clean_environment
75
76         start_kube_proxy
77
78         if [ $__httpx == "HTTPS" ]; then
79             use_cr_https
80             use_agent_rest_https
81         else
82             use_agent_rest_http
83             use_cr_http
84         fi
85
86         start_policy_agent NORPOXY $SIM_GROUP/$POLICY_AGENT_COMPOSE_DIR/$POLICY_AGENT_CONFIG_FILE
87
88         set_agent_debug
89
90         # Create service to be able to receive events when rics becomes available
91         # Must use rest towards the agent since dmaap is not configured yet
92         api_put_service 201 "ric-registration" 0 "$CR_SERVICE_APP_PATH/ric-registration"
93
94
95         if [ $__httpx == "HTTPS" ]; then
96             use_simulator_https
97             use_mr_https
98             if [[ $interface = *"SDNC"* ]]; then
99                 use_sdnc_https
100             fi
101             if [[ $interface = *"DMAAP"* ]]; then
102                 use_agent_dmaap_https
103             else
104                 use_agent_rest_https
105             fi
106         else
107             use_simulator_http
108             use_mr_http
109             if [[ $interface = *"SDNC"* ]]; then
110                 use_sdnc_http
111             fi
112             if [[ $interface = *"DMAAP"* ]]; then
113                 use_agent_dmaap_http
114             else
115                 use_agent_rest_http
116             fi
117         fi
118
119         start_ric_simulators ricsim_g1 1  OSC_2.1.0
120         start_ric_simulators ricsim_g2 1  STD_1.1.3
121         if [ "$PMS_VERSION" == "V2" ]; then
122             start_ric_simulators ricsim_g3 1  STD_2.0.0
123         fi
124
125         start_mr
126
127         start_cr
128
129         start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/$CONTROL_PANEL_CONFIG_FILE
130
131         if [ ! -z "$NRT_GATEWAY_APP_NAME" ]; then
132             start_gateway $SIM_GROUP/$NRT_GATEWAY_COMPOSE_DIR/$NRT_GATEWAY_CONFIG_FILE
133         fi
134
135         if [ $RUNMODE == "DOCKER" ]; then
136             start_consul_cbs
137         fi
138
139         if [[ $interface = *"SDNC"* ]]; then
140             start_sdnc
141             prepare_consul_config      SDNC    ".consul_config.json"
142         else
143             prepare_consul_config      NOSDNC  ".consul_config.json"
144         fi
145
146         if [ $RUNMODE == "KUBE" ]; then
147             agent_load_config                       ".consul_config.json"
148         else
149             consul_config_app                      ".consul_config.json"
150         fi
151
152         sim_put_policy_type 201 ricsim_g1_1 1 testdata/OSC/sim_1.json
153         sim_put_policy_type 201 ricsim_g1_1 2 testdata/OSC/sim_2.json
154
155         if [ "$PMS_VERSION" == "V2" ]; then
156             sim_put_policy_type 201 ricsim_g3_1 STD_QOS_0_2_0 testdata/STD2/sim_qos.json
157             sim_put_policy_type 201 ricsim_g3_1 STD_QOS2_0.1.0 testdata/STD2/sim_qos2.json
158
159             api_equal json:rics 3 300
160
161             api_equal json:policy-types 5 120
162
163             api_equal json:policies 0
164
165             api_equal json:policy-instances 0
166         else
167             api_equal json:rics 2 300
168
169             api_equal json:policy_schemas 3 120
170
171             api_equal json:policy_types 3
172
173             api_equal json:policies 0
174
175             api_equal json:policy_ids 0
176         fi
177
178         if [ "$PMS_VERSION" == "V2" ]; then
179             cr_equal received_callbacks 3 120
180             cr_api_check_all_sync_events 200 ric-registration ricsim_g1_1 ricsim_g2_1 ricsim_g3_1
181         fi
182         mr_equal requests_submitted 0
183
184
185         echo "############################################"
186         echo "############## Health check ################"
187         echo "############################################"
188
189         api_get_status 200
190
191         echo "############################################"
192         echo "##### Service registry and supervision #####"
193         echo "############################################"
194
195         api_get_services 404 "service1"
196
197         api_put_service 201 "service1" 1000 "$CR_SERVICE_APP_PATH/1"
198
199         api_put_service 200 "service1" 2000 "$CR_SERVICE_APP_PATH/1"
200
201
202         api_put_service 400 "service2" -1 "$CR_SERVICE_APP_PATH/2"
203
204         api_put_service 400 "service2" "wrong" "$CR_SERVICE_APP_PATH/2"
205
206         api_put_service 400 "service2" 100 "/test"
207
208         api_put_service 400 "service2" 100 "test-path"
209
210         api_put_service 201 "service2" 300 "ftp://localhost:80/test"
211
212         api_get_services 200 "service1" "service1" 2000 "$CR_SERVICE_APP_PATH/1"
213
214         api_get_service_ids 200 "service1" "service2" "ric-registration"
215
216
217         api_put_service 201 "service3" 5000 "$CR_SERVICE_APP_PATH/3"
218
219
220         api_get_service_ids 200 "service1" "service2" "service3" "ric-registration"
221
222
223         api_get_services 200 "service1" "service1" 2000 "$CR_SERVICE_APP_PATH/1"
224
225         api_get_services 200 NOSERVICE "service1" 2000 "$CR_SERVICE_APP_PATH/1" "service2" 300 "ftp://localhost:80/test" "service3" 5000 "$CR_SERVICE_APP_PATH/3"  "ric-registration" 0 "$CR_SERVICE_APP_PATH/ric-registration"
226
227         api_get_services 200
228
229         deviation "TR2 - Keep alive shall return 200/201 according to doc, only 200 works - test combo $interface and $__httpx"
230         #The below should work, keept here until fixed or other decision made
231         #api_put_services_keepalive 201 "service1"
232         #Using the below until decision
233         api_put_services_keepalive 200 "service1"
234
235         deviation "TR2 - Keep alive shall return 200/201 according to doc, only 200 works - test combo $interface and $__httpx"
236         #The below should work, keept here until fixed or other decision made
237         #api_put_services_keepalive 201 "service3"
238         #Using the below until decision
239         api_put_services_keepalive 200 "service3"
240
241         api_put_services_keepalive 200 "service1"
242
243         api_put_services_keepalive 200 "service3"
244
245         api_put_services_keepalive 404 "service5"
246
247         api_get_service_ids 200 "service1" "service2" "service3"  "ric-registration"
248
249         api_delete_services 204 "service1"
250
251         api_get_service_ids 200 "service2" "service3" "ric-registration"
252
253
254         api_put_service 201 "service1" 50 "$CR_SERVICE_APP_PATH/1"
255
256         api_get_service_ids 200 "service1" "service2" "service3"  "ric-registration"
257
258
259         api_delete_services 204 "service1"
260         api_delete_services 204 "service3"
261
262         api_equal json:services 2
263
264         api_delete_services 204 "service2"
265
266         api_equal json:services 1
267
268
269         echo "############################################"
270         echo "############## RIC Repository ##############"
271         echo "############################################"
272
273         if [ "$PMS_VERSION" == "V2" ]; then
274             api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2:AVAILABLE  ricsim_g2_1:me1_ricsim_g2_1,me2_ricsim_g2_1:EMPTYTYPE:AVAILABLE ricsim_g3_1:me1_ricsim_g3_1,me2_ricsim_g3_1:STD_QOS_0_2_0,STD_QOS2_0.1.0:AVAILABLE"
275         else
276             api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2:AVAILABLE  ricsim_g2_1:me1_ricsim_g2_1,me2_ricsim_g2_1:EMPTYTYPE:AVAILABLE"
277         fi
278         api_get_rics 200 1 "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2:AVAILABLE"
279
280         api_get_rics 404 47
281
282         api_get_rics 404 "test"
283
284         if [ "$PMS_VERSION" == "V2" ]; then
285             api_get_ric 200 me1_ricsim_g1_1 NORIC "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2:AVAILABLE"
286
287             api_get_ric 200 me2_ricsim_g1_1 NORIC "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2:AVAILABLE"
288
289             api_get_ric 200 me1_ricsim_g2_1 NORIC "ricsim_g2_1:me1_ricsim_g2_1,me2_ricsim_g2_1:EMPTYTYPE:AVAILABLE"
290
291             api_get_ric 200 me2_ricsim_g2_1 NORIC "ricsim_g2_1:me1_ricsim_g2_1,me2_ricsim_g2_1:EMPTYTYPE:AVAILABLE"
292
293             api_get_ric 200 me1_ricsim_g3_1 NORIC "ricsim_g3_1:me1_ricsim_g3_1,me2_ricsim_g3_1:STD_QOS_0_2_0,STD_QOS2_0.1.0:AVAILABLE"
294
295             api_get_ric 200 me2_ricsim_g3_1 NORIC "ricsim_g3_1:me1_ricsim_g3_1,me2_ricsim_g3_1:STD_QOS_0_2_0,STD_QOS2_0.1.0:AVAILABLE"
296
297             api_get_ric 200 NOME      ricsim_g1_1 "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2:AVAILABLE"
298
299             api_get_ric 200 NOME      ricsim_g2_1 "ricsim_g2_1:me1_ricsim_g2_1,me2_ricsim_g2_1:EMPTYTYPE:AVAILABLE"
300
301             api_get_ric 200 NOME      ricsim_g3_1 "ricsim_g3_1:me1_ricsim_g3_1,me2_ricsim_g3_1:STD_QOS_0_2_0,STD_QOS2_0.1.0:AVAILABLE"
302
303             api_get_ric 404 NOME test1
304
305             api_get_ric 404 test NORIC
306
307             api_get_ric 400 me1_ricsim_g1_1 ricsim_g1_1
308
309             api_get_ric 400 me1_ricsim_g1_1 TESTRIC
310
311             api_get_ric 400 TESTME ricsim_g1_1
312
313         else
314             api_get_ric 200 me1_ricsim_g1_1 ricsim_g1_1
315
316             api_get_ric 200 me2_ricsim_g1_1 ricsim_g1_1
317
318             api_get_ric 200 me1_ricsim_g2_1 ricsim_g2_1
319
320             api_get_ric 200 me2_ricsim_g2_1 ricsim_g2_1
321
322             api_get_ric 404 test
323         fi
324
325         echo "############################################"
326         echo "########### A1 Policy Management ###########"
327         echo "############################################"
328
329         if [ "$PMS_VERSION" == "V2" ]; then
330             deviation "TR9 - agent modify the type with type id - test combo $interface and $__httpx"
331             #Behaviour accepted for now
332             api_get_policy_type 200 1 testdata/OSC/1-agent-modified.json
333             deviation "TR9 - agent modify the type with type id - test combo $interface and $__httpx"
334             #Behaviour accepted for now
335             api_get_policy_type 200 2 testdata/OSC/2-agent-modified.json
336             deviation "TR9 - agent modify the type with type id - test combo $interface and $__httpx"
337             #Behaviour accepted for now
338             api_get_policy_type 200 STD_QOS_0_2_0 testdata/STD2/qos-agent-modified.json
339             deviation "TR9 - agent modify the type with type id - test combo $interface and $__httpx"
340             #Behaviour accepted for now
341             api_get_policy_type 200 STD_QOS2_0.1.0 testdata/STD2/qos2-agent-modified.json
342
343             api_get_policy_type 404 3
344         else
345             deviation "TR9 - agent modify the type with type id - test combo $interface and $__httpx"
346             #Behaviour accepted for now
347             api_get_policy_schema 200 1 testdata/OSC/1-agent-modified.json
348             deviation "TR9 - agent modify the type with type id - test combo $interface and $__httpx"
349             #Behaviour accepted for now
350             api_get_policy_schema 200 2 testdata/OSC/2-agent-modified.json
351
352             api_get_policy_schema 404 3
353         fi
354
355         if [ "$PMS_VERSION" == "V2" ]; then
356             api_get_policy_schemas 404
357         else
358             deviation "TR9 - agent modify the type with type id - test combo $interface and $__httpx"
359             #Behaviour accepted for now
360             api_get_policy_schemas 200 NORIC testdata/OSC/1-agent-modified.json testdata/OSC/2-agent-modified.json NOFILE
361             deviation "TR9 - agent modify the type with type id - test combo $interface and $__httpx"
362             #Behaviour accepted for now
363             api_get_policy_schemas 200 ricsim_g1_1 testdata/OSC/1-agent-modified.json testdata/OSC/2-agent-modified.json
364
365             api_get_policy_schemas 200 ricsim_g2_1 NOFILE
366
367             api_get_policy_schemas 404 test
368         fi
369
370
371         if [ "$PMS_VERSION" == "V2" ]; then
372             api_get_policy_types 200 NORIC 1 2 EMPTY STD_QOS_0_2_0 STD_QOS2_0.1.0
373         else
374             api_get_policy_types 200 NORIC 1 2 EMPTY
375         fi
376
377         api_get_policy_types 200 ricsim_g1_1 1 2
378
379         api_get_policy_types 200 ricsim_g2_1 EMPTY
380
381         if [ "$PMS_VERSION" == "V2" ]; then
382             api_get_policy_types 200 ricsim_g3_1 STD_QOS_0_2_0 STD_QOS2_0.1.0
383         fi
384
385         api_get_policy_types 404 dummy-ric
386
387
388
389         api_put_service 201 "service10" 3600 "$CR_SERVICE_APP_PATH/1"
390
391         if [ "$PMS_VERSION" == "V2" ]; then
392             notificationurl=$CR_SERVICE_APP_PATH"/test"
393         else
394             notificationurl=""
395         fi
396         deviation "TR10 - agent allows policy creation on unregistered service (orig problem) - test combo $interface and $__httpx"
397         #Kept until decison
398         #api_put_policy 400 "unregistered-service" ricsim_g1_1 1 2000 NOTRANSIENT testdata/OSC/pi1_template.json
399         #Allow 201 for now
400         api_put_policy 201 "unregistered-service" ricsim_g1_1 1 2000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json
401
402         api_put_policy 201 "service10" ricsim_g1_1 1 5000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json
403         api_put_policy 200 "service10" ricsim_g1_1 1 5000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json
404
405         api_put_policy 200 "service10" ricsim_g1_1 1 5000 true $notificationurl testdata/OSC/pi1_template.json
406         api_put_policy 200 "service10" ricsim_g1_1 1 5000 false $notificationurl testdata/OSC/pi1_template.json
407
408         api_put_policy 201 "service10" ricsim_g2_1 NOTYPE 5100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json
409         api_put_policy 200 "service10" ricsim_g2_1 NOTYPE 5100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json
410
411         api_put_policy 200 "service10" ricsim_g2_1 NOTYPE 5100 true $notificationurl testdata/STD/pi1_template.json
412         api_put_policy 200 "service10" ricsim_g2_1 NOTYPE 5100 false $notificationurl testdata/STD/pi1_template.json
413
414         if [ "$PMS_VERSION" == "V2" ]; then
415             api_put_policy 201 "service10" ricsim_g3_1 STD_QOS2_0.1.0 5200 NOTRANSIENT $notificationurl testdata/STD2/pi_qos2_template.json
416             api_put_policy 200 "service10" ricsim_g3_1 STD_QOS2_0.1.0 5200 NOTRANSIENT $notificationurl testdata/STD2/pi_qos2_template.json
417
418             api_put_policy 200 "service10" ricsim_g3_1 STD_QOS2_0.1.0 5200 true $notificationurl testdata/STD2/pi_qos2_template.json
419             api_put_policy 200 "service10" ricsim_g3_1 STD_QOS2_0.1.0 5200 false $notificationurl testdata/STD2/pi_qos2_template.json
420         fi
421
422         VAL='NOT IN EFFECT'
423         api_get_policy_status 200 5000 OSC "$VAL" "false"
424         api_get_policy_status 200 5100 STD "UNDEFINED"
425         if [ "$PMS_VERSION" == "V2" ]; then
426             api_get_policy_status 200 5200 STD2 EMPTY EMPTY
427         fi
428
429
430         deviation "TR10 - agent allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx"
431         #kept until decision
432         #api_equal json:policies 2
433         #Allow 3 for now
434         if [ "$PMS_VERSION" == "V2" ]; then
435             api_equal json:policies 4
436         else
437             api_equal json:policies 3
438         fi
439
440         deviation "TR10 - agent allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx"
441         #kept until decision
442         #api_equal json:policy_ids 2
443         #Allow 3 for now
444         if [ "$PMS_VERSION" == "V2" ]; then
445             api_equal json:policy-instances 4
446         else
447             api_equal json:policy_ids 3
448         fi
449
450         deviation "TR10 - agent allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx"
451         #kept until decision
452         #api_get_policy_ids 200 NORIC NOSERVICE NOTYPE 5000 5100
453         #Allow policy create with unregistered service for now
454         if [ "$PMS_VERSION" == "V2" ]; then
455             api_get_policy_ids 200 NORIC NOSERVICE NOTYPE 5000 5100 2000 5200
456         else
457             api_get_policy_ids 200 NORIC NOSERVICE NOTYPE 5000 5100 2000
458         fi
459
460         deviation "TR10 - agent allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx"
461         #kept until decision
462         #api_get_policy_ids 200 ricsim_g1_1 NOSERVICE NOTYPE 5000
463         #Allow policy create with unregistered service for now
464         if [ "$PMS_VERSION" == "V2" ]; then
465             api_get_policy_ids 200 ricsim_g1_1 NOSERVICE NOTYPE 5000 2000
466
467             api_get_policy_ids 200 ricsim_g2_1 NOSERVICE NOTYPE 5100
468
469             api_get_policy_ids 200 ricsim_g3_1 NOSERVICE NOTYPE 5200
470
471             api_get_policy_ids 200 NORIC "service10" NOTYPE 5000 5100 5200
472         else
473             api_get_policy_ids 200 ricsim_g1_1 NOSERVICE NOTYPE 5000 2000
474
475             api_get_policy_ids 200 ricsim_g2_1 NOSERVICE NOTYPE 5100
476
477
478             api_get_policy_ids 200 NORIC "service10" NOTYPE 5000 5100
479         fi
480
481         deviation "TR10 - agent allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx"
482         #kept until decision
483         #api_get_policy_ids 200 NORIC NOSERVICE 1 5000
484         #Allow policy create with unregistered service for now
485
486         api_get_policy_ids 200 NORIC NOSERVICE 1 5000 2000
487
488         api_get_policy_ids 200 NORIC NOSERVICE 2 NOID
489
490         if [ "$PMS_VERSION" == "V2" ]; then
491             api_get_policy_ids 200 NORIC NOSERVICE STD_QOS2_0.1.0 5200
492         fi
493
494         api_get_policy_ids 200 ricsim_g2_1 NOSERVICE 1 NOID
495
496         if [ "$PMS_VERSION" == "V2" ]; then
497             api_get_policy 200 5000 testdata/OSC/pi1_template.json "service10" ricsim_g1_1 1 false $notificationurl
498
499             api_get_policy 200 5100 testdata/STD/pi1_template.json "service10" ricsim_g2_1 NOTYPE false $notificationurl
500
501             api_get_policy 200 5200 testdata/STD2/pi_qos2_template.json "service10" ricsim_g3_1 STD_QOS2_0.1.0 false $notificationurl
502
503             api_get_policies 200 ricsim_g1_1 "service10" 1 5000 ricsim_g1_1 "service10" 1 false $notificationurl testdata/OSC/pi1_template.json
504         else
505             api_get_policy 200 5000 testdata/OSC/pi1_template.json
506
507             api_get_policy 200 5100 testdata/STD/pi1_template.json
508
509             api_get_policies 200 ricsim_g1_1 "service10" 1 5000 ricsim_g1_1 "service10" 1 testdata/OSC/pi1_template.json
510         fi
511
512         deviation "TR10 - agent allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx"
513         #kept until decision
514         #api_delete_policy 404 2000
515         #Allow policy create with unregistered service for now
516         api_delete_policy 204 2000
517
518         api_delete_policy 404 1500
519
520         api_delete_policy 204 5000
521
522         if [ "$PMS_VERSION" == "V2" ]; then
523
524             api_delete_policy 204 5200
525         fi
526
527         api_equal json:policies 1
528
529
530         if [ "$PMS_VERSION" == "V2" ]; then
531             api_equal json:policy-instances 1
532         else
533             api_equal json:policy_ids 1
534         fi
535
536         api_delete_policy 204 5100
537
538         api_equal json:policies 0
539
540         if [ "$PMS_VERSION" == "V2" ]; then
541             api_equal json:policy-instances 0
542         else
543             api_equal json:policy_ids 0
544         fi
545
546         if [ "$PMS_VERSION" == "V2" ]; then
547             cr_equal received_callbacks 3
548         fi
549
550         if [[ $interface = *"DMAAP"* ]]; then
551             mr_greater requests_submitted 0
552             VAL=$(mr_read requests_submitted)
553             mr_equal requests_fetched $VAL
554             mr_equal responses_submitted $VAL
555             mr_equal responses_fetched $VAL
556             mr_equal current_requests 0
557             mr_equal current_responses 0
558         else
559             mr_equal requests_submitted 0
560         fi
561
562         if [[ $interface = *"SDNC"* ]]; then
563             sim_contains_str ricsim_g1_1 remote_hosts $SDNC_APP_NAME
564             sim_contains_str ricsim_g2_1 remote_hosts $SDNC_APP_NAME
565             if [ "$PMS_VERSION" == "V2" ]; then
566                 sim_contains_str ricsim_g3_1 remote_hosts $SDNC_APP_NAME
567             fi
568         else
569             sim_contains_str ricsim_g1_1 remote_hosts $POLICY_AGENT_APP_NAME
570             sim_contains_str ricsim_g2_1 remote_hosts $POLICY_AGENT_APP_NAME
571             if [ "$PMS_VERSION" == "V2" ]; then
572                 sim_contains_str ricsim_g3_1 remote_hosts $POLICY_AGENT_APP_NAME
573             fi
574         fi
575
576         check_policy_agent_logs
577
578         if [[ $interface = *"SDNC"* ]]; then
579             check_sdnc_logs
580         fi
581
582         store_logs          "${__httpx}__${interface}"
583
584     done
585
586 done
587
588 #### TEST COMPLETE ####
589
590
591 print_result
592
593 auto_clean_environment