3 # ============LICENSE_START===============================================
4 # Copyright (C) 2020-2023 Nordix Foundation. All rights reserved.
5 # Copyright (C) 2023 OpenInfra Foundation Europe. All rights reserved.
6 # ========================================================================
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
11 # http://www.apache.org/licenses/LICENSE-2.0
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 # ============LICENSE_END=================================================
22 TC_ONELINE_DESCR="Full a1pms API walkthrough using a1pms REST and with/without SDNC A1 Controller"
26 #App names to include in the test when running docker, space separated list
27 DOCKER_INCLUDED_IMAGES="CP CR MR A1PMS RICSIM SDNC NGW KUBEPROXY"
29 #App names to include in the test when running kubernetes, space separated list
30 if [ $USE_ISTIO -eq 0 ]; then
31 KUBE_INCLUDED_IMAGES="CP CR MR A1PMS RICSIM SDNC KUBEPROXY NGW"
33 KUBE_INCLUDED_IMAGES="CP CR MR A1PMS RICSIM SDNC KUBEPROXY NGW KEYCLOAK ISTIO AUTHSIDECAR"
35 #Pre-started app (not started by script) to include in the test when running kubernetes, space separated list
36 KUBE_PRESTARTED_IMAGES=""
38 #Ignore image in DOCKER_INCLUDED_IMAGES, KUBE_INCLUDED_IMAGES if
39 #the image is not configured in the supplied env_file
40 #Used for images not applicable to all supported profile
41 CONDITIONALLY_IGNORED_IMAGES="NGW"
43 #Supported test environment profiles
44 SUPPORTED_PROFILES="ONAP-KOHN ONAP-LONDON ONAP-MONTREAL ORAN-G-RELEASE ORAN-H-RELEASE ORAN-I-RELEASE"
46 SUPPORTED_RUNMODES="DOCKER KUBE"
48 . ../common/testcase_common.sh $@
54 sim_generate_policy_uuid
56 if [ $USE_ISTIO -eq 0 ]; then
57 # Tested variants of REST/DMAAP/SDNC config
58 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
59 TESTED_VARIANTS="REST REST+SDNC"
61 TESTED_VARIANTS="REST DMAAP REST+SDNC DMAAP+SDNC"
64 #Test a1pms and simulator protocol versions (others are http only)
65 TESTED_PROTOCOLS="HTTP HTTPS"
67 if [ $USE_ISTIO -eq 1 ]; then
68 echo -e $RED"#########################################"$ERED
69 echo -e $RED"# No test of https when running with istio"$ERED
70 echo -e $RED"# No test of SDNC when running with istio"$ERED
71 echo -e $RED"#########################################"$ERED
73 # Tested variants of REST/DMAAP/SDNC config
74 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
75 TESTED_VARIANTS="REST DMAAP"
77 TESTED_VARIANTS="REST"
80 #Test a1pms and simulator protocol versions (others are http only)
81 TESTED_PROTOCOLS="HTTP"
84 for __httpx in $TESTED_PROTOCOLS ; do
85 for interface in $TESTED_VARIANTS ; do
87 echo "#####################################################################"
88 echo "#####################################################################"
89 echo "### Testing a1pms: $interface using $__httpx"
90 echo "#####################################################################"
91 echo "#####################################################################"
93 # Clean container and start all needed containers #
96 if [ $RUNMODE != "KUBE" ]; then
98 echo "ISTIO not supported by docker - setting USE-ISTIO=0"
101 if [ $USE_ISTIO -eq 1 ]; then
102 echo -e $RED"#########################################"$ERED
103 echo -e $RED"# Work around istio jwks cache"$ERED
104 echo -e $RED"# Cycle istiod down and up to clear cache"$ERED
106 __kube_scale deployment istiod istio-system 0
107 __kube_scale deployment istiod istio-system 1
108 echo -e $RED"# Cycle istiod done"
109 echo -e $RED"#########################################"$ERED
111 istio_enable_istio_namespace $KUBE_SIM_NAMESPACE
112 istio_enable_istio_namespace $KUBE_NONRTRIC_NAMESPACE
113 istio_enable_istio_namespace $KUBE_A1SIM_NAMESPACE
119 if [ $USE_ISTIO -eq 1 ]; then
122 keycloak_api_obtain_admin_token
124 keycloak_api_create_realm nrtrealm true 60
125 keycloak_api_create_confidential_client nrtrealm a1pmsc
126 keycloak_api_generate_client_secret nrtrealm a1pmsc
127 keycloak_api_get_client_secret nrtrealm a1pmsc
128 keycloak_api_create_client_roles nrtrealm a1pmsc nrtrole
129 keycloak_api_map_client_roles nrtrealm a1pmsc nrtrole
131 keycloak_api_get_client_token nrtrealm a1pmsc
133 CLIENT_TOKEN=$(keycloak_api_read_client_token nrtrealm a1pmsc)
134 echo "CLIENT_TOKEN: "$CLIENT_TOKEN
136 A1PMS_SEC=$(keycloak_api_read_client_secret nrtrealm a1pmsc)
137 echo "A1PMS_SEC: "$A1PMS_SEC
140 istio_req_auth_by_jwks ricsim-g1 $KUBE_A1SIM_NAMESPACE KUBEPROXY "$KUBE_PROXY_ISTIO_JWKS_KEYS"
141 istio_auth_policy_by_issuer ricsim-g1 $KUBE_A1SIM_NAMESPACE KUBEPROXY
143 istio_req_auth_by_jwksuri ricsim-g1 $KUBE_A1SIM_NAMESPACE nrtrealm
144 istio_auth_policy_by_realm ricsim-g1 $KUBE_A1SIM_NAMESPACE nrtrealm a1pmsc nrtrole
147 istio_req_auth_by_jwks ricsim-g2 $KUBE_A1SIM_NAMESPACE KUBEPROXY "$KUBE_PROXY_ISTIO_JWKS_KEYS"
148 istio_auth_policy_by_issuer ricsim-g2 $KUBE_A1SIM_NAMESPACE KUBEPROXY
150 istio_req_auth_by_jwksuri ricsim-g2 $KUBE_A1SIM_NAMESPACE nrtrealm
151 istio_auth_policy_by_realm ricsim-g2 $KUBE_A1SIM_NAMESPACE nrtrealm a1pmsc nrtrole
154 istio_req_auth_by_jwks ricsim-g3 $KUBE_A1SIM_NAMESPACE KUBEPROXY "$KUBE_PROXY_ISTIO_JWKS_KEYS"
155 istio_auth_policy_by_issuer ricsim-g3 $KUBE_A1SIM_NAMESPACE KUBEPROXY
157 istio_req_auth_by_jwksuri ricsim-g3 $KUBE_A1SIM_NAMESPACE nrtrealm
158 istio_auth_policy_by_realm ricsim-g3 $KUBE_A1SIM_NAMESPACE nrtrealm a1pmsc nrtrole
161 istio_req_auth_by_jwks $CR_APP_NAME $KUBE_SIM_NAMESPACE KUBEPROXY "$KUBE_PROXY_ISTIO_JWKS_KEYS"
162 istio_auth_policy_by_issuer $CR_APP_NAME $KUBE_SIM_NAMESPACE KUBEPROXY
164 istio_req_auth_by_jwksuri $CR_APP_NAME $KUBE_SIM_NAMESPACE nrtrealm
165 istio_auth_policy_by_realm $CR_APP_NAME $KUBE_SIM_NAMESPACE nrtrealm a1pmsc nrtrole
167 a1pms_configure_sec nrtrealm a1pmsc $A1PMS_SEC
170 if [ $__httpx == "HTTPS" ]; then
178 start_a1pms NORPOXY $SIM_GROUP/$A1PMS_COMPOSE_DIR/$A1PMS_CONFIG_FILE
182 # Create service to be able to receive events when rics becomes available
183 # Must use rest towards the a1pms since dmaap is not configured yet
184 a1pms_api_put_service 201 "ric-registration" 0 "$CR_SERVICE_APP_PATH_0/ric-registration"
187 if [ $__httpx == "HTTPS" ]; then
190 if [[ $interface = *"SDNC"* ]]; then
191 if [[ "$SDNC_FEATURE_LEVEL" == *"NO_NB_HTTPS"* ]]; then
192 deviation "SDNC does not support NB https"
198 if [[ $interface = *"DMAAP"* ]]; then
199 use_a1pms_dmaap_https
206 if [[ $interface = *"SDNC"* ]]; then
209 if [[ $interface = *"DMAAP"* ]]; then
216 start_ric_simulators ricsim_g1 1 OSC_2.1.0
217 start_ric_simulators ricsim_g2 1 STD_1.1.3
219 sim_put_policy_type 201 ricsim_g1_1 1 testdata/OSC/sim_1.json
220 sim_put_policy_type 201 ricsim_g1_1 2 testdata/OSC/sim_2.json
222 start_ric_simulators ricsim_g3 1 STD_2.0.0
223 sim_put_policy_type 201 ricsim_g3_1 STD_QOS_0_2_0 testdata/STD2/sim_qos.json
224 sim_put_policy_type 201 ricsim_g3_1 STD_QOS2_0.1.0 testdata/STD2/sim_qos2.json
226 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
234 start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/$CONTROL_PANEL_CONFIG_FILE
236 if [ ! -z "$NRT_GATEWAY_APP_NAME" ]; then
237 start_gateway $SIM_GROUP/$NRT_GATEWAY_COMPOSE_DIR/$NRT_GATEWAY_CONFIG_FILE
241 if [[ $interface = *"SDNC"* ]]; then
243 controller_api_wait_for_status_ok 200 ricsim_g1_1
244 prepare_a1pms_config SDNC ".a1pms_config.json"
246 prepare_a1pms_config NOSDNC ".a1pms_config.json"
249 if [ $RUNMODE == "KUBE" ]; then
250 a1pms_load_config ".a1pms_config.json"
252 #Temporary switch to http/https if dmaap use. Otherwise it is not possible to push config
253 if [ $__httpx == "HTTPS" ]; then
259 if [[ $interface != *"DMAAP"* ]]; then
260 echo "{}" > ".a1pms_config_incorrect.json"
261 a1pms_api_put_configuration 400 ".a1pms_config_incorrect.json"
264 a1pms_api_put_configuration 200 ".a1pms_config.json"
265 a1pms_api_get_configuration 200 ".a1pms_config.json"
266 if [ $__httpx == "HTTPS" ]; then
267 if [[ $interface = *"DMAAP"* ]]; then
268 use_a1pms_dmaap_https
273 if [[ $interface = *"DMAAP"* ]]; then
281 a1pms_equal json:rics 3 300
283 a1pms_equal json:policy-types 5 120
285 a1pms_equal json:policies 0
287 a1pms_equal json:policy-instances 0
289 cr_equal 0 received_callbacks 3 120
290 cr_api_check_all_sync_events 200 0 ric-registration ricsim_g1_1 ricsim_g2_1 ricsim_g3_1
292 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
295 mr_equal requests_submitted 0
299 echo "############################################"
300 echo "############## Health check ################"
301 echo "############################################"
303 sleep_wait 120 "Let A1PMS configuration take effect"
305 a1pms_api_get_status 200
307 a1pms_api_get_status_root 200
309 echo "############################################"
310 echo "##### Service registry and supervision #####"
311 echo "############################################"
313 a1pms_api_get_services 404 "service1"
315 a1pms_api_put_service 201 "service1" 1000 "$CR_SERVICE_APP_PATH_0/1"
317 a1pms_api_put_service 200 "service1" 2000 "$CR_SERVICE_APP_PATH_0/1"
320 a1pms_api_put_service 400 "service2" -1 "$CR_SERVICE_APP_PATH_0/2"
322 a1pms_api_put_service 400 "service2" "wrong" "$CR_SERVICE_APP_PATH_0/2"
324 a1pms_api_put_service 400 "service2" 100 "/test"
326 a1pms_api_put_service 400 "service2" 100 "test-path"
328 a1pms_api_put_service 201 "service2" 300 "ftp://localhost:80/test"
330 a1pms_api_get_services 200 "service1" "service1" 2000 "$CR_SERVICE_APP_PATH_0/1"
332 a1pms_api_get_service_ids 200 "service1" "service2" "ric-registration"
335 a1pms_api_put_service 201 "service3" 5000 "$CR_SERVICE_APP_PATH_0/3"
338 a1pms_api_get_service_ids 200 "service1" "service2" "service3" "ric-registration"
341 a1pms_api_get_services 200 "service1" "service1" 2000 "$CR_SERVICE_APP_PATH_0/1"
343 a1pms_api_get_services 200 NOSERVICE "service1" 2000 "$CR_SERVICE_APP_PATH_0/1" "service2" 300 "ftp://localhost:80/test" "service3" 5000 "$CR_SERVICE_APP_PATH_0/3" "ric-registration" 0 "$CR_SERVICE_APP_PATH_0/ric-registration"
345 a1pms_api_get_services 200
347 deviation "TR2 - Keep alive shall return 200/201 according to doc, only 200 works - test combo $interface and $__httpx"
348 #The below should work, keept here until fixed or other decision made
349 #a1pms_api_put_services_keepalive 201 "service1"
350 #Using the below until decision
351 a1pms_api_put_services_keepalive 200 "service1"
353 deviation "TR2 - Keep alive shall return 200/201 according to doc, only 200 works - test combo $interface and $__httpx"
354 #The below should work, keept here until fixed or other decision made
355 #a1pms_api_put_services_keepalive 201 "service3"
356 #Using the below until decision
357 a1pms_api_put_services_keepalive 200 "service3"
359 a1pms_api_put_services_keepalive 200 "service1"
361 a1pms_api_put_services_keepalive 200 "service3"
363 a1pms_api_put_services_keepalive 404 "service5"
365 a1pms_api_get_service_ids 200 "service1" "service2" "service3" "ric-registration"
367 a1pms_api_delete_services 204 "service1"
369 a1pms_api_get_service_ids 200 "service2" "service3" "ric-registration"
372 a1pms_api_put_service 201 "service1" 50 "$CR_SERVICE_APP_PATH_0/1"
374 a1pms_api_get_service_ids 200 "service1" "service2" "service3" "ric-registration"
377 a1pms_api_delete_services 204 "service1"
378 a1pms_api_delete_services 204 "service3"
380 a1pms_equal json:services 2
382 a1pms_api_delete_services 204 "service2"
384 a1pms_equal json:services 1
387 echo "############################################"
388 echo "############## RIC Repository ##############"
389 echo "############################################"
391 a1pms_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"
393 a1pms_api_get_rics 200 1 "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2:AVAILABLE"
395 a1pms_api_get_rics 404 47
397 a1pms_api_get_rics 404 "test"
399 a1pms_api_get_ric 200 me1_ricsim_g1_1 NORIC "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2:AVAILABLE"
401 a1pms_api_get_ric 200 me2_ricsim_g1_1 NORIC "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2:AVAILABLE"
403 a1pms_api_get_ric 200 me1_ricsim_g2_1 NORIC "ricsim_g2_1:me1_ricsim_g2_1,me2_ricsim_g2_1:EMPTYTYPE:AVAILABLE"
405 a1pms_api_get_ric 200 me2_ricsim_g2_1 NORIC "ricsim_g2_1:me1_ricsim_g2_1,me2_ricsim_g2_1:EMPTYTYPE:AVAILABLE"
407 a1pms_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"
409 a1pms_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"
411 a1pms_api_get_ric 200 NOME ricsim_g1_1 "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2:AVAILABLE"
413 a1pms_api_get_ric 200 NOME ricsim_g2_1 "ricsim_g2_1:me1_ricsim_g2_1,me2_ricsim_g2_1:EMPTYTYPE:AVAILABLE"
415 a1pms_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"
417 a1pms_api_get_ric 404 NOME test1
419 a1pms_api_get_ric 404 test NORIC
421 a1pms_api_get_ric 400 me1_ricsim_g1_1 ricsim_g1_1
423 a1pms_api_get_ric 400 me1_ricsim_g1_1 TESTRIC
425 a1pms_api_get_ric 400 TESTME ricsim_g1_1
427 echo "############################################"
428 echo "########### A1 Policy Management ###########"
429 echo "############################################"
431 deviation "TR9 - a1pms modify the type with type id - test combo $interface and $__httpx"
432 #Behaviour accepted for now
433 a1pms_api_get_policy_type 200 1 testdata/OSC/1-a1pms-modified.json
434 deviation "TR9 - a1pms modify the type with type id - test combo $interface and $__httpx"
435 #Behaviour accepted for now
436 a1pms_api_get_policy_type 200 2 testdata/OSC/2-a1pms-modified.json
437 deviation "TR9 - a1pms modify the type with type id - test combo $interface and $__httpx"
438 #Behaviour accepted for now
439 a1pms_api_get_policy_type 200 STD_QOS_0_2_0 testdata/STD2/qos-a1pms-modified.json
440 deviation "TR9 - a1pms modify the type with type id - test combo $interface and $__httpx"
441 #Behaviour accepted for now
442 a1pms_api_get_policy_type 200 STD_QOS2_0.1.0 testdata/STD2/qos2-a1pms-modified.json
444 a1pms_api_get_policy_type 404 3
446 a1pms_api_get_policy_schemas 404
449 a1pms_api_get_policy_types 200 NORIC 1 2 EMPTY STD_QOS_0_2_0 STD_QOS2_0.1.0
451 a1pms_api_get_policy_types 200 ricsim_g1_1 1 2
453 a1pms_api_get_policy_types 200 ricsim_g2_1 EMPTY
455 a1pms_api_get_policy_types 200 ricsim_g3_1 STD_QOS_0_2_0 STD_QOS2_0.1.0
457 a1pms_api_get_policy_types 404 dummy-ric
461 a1pms_api_put_service 201 "service10" 3600 "$CR_SERVICE_APP_PATH_0/1"
463 notificationurl=$CR_SERVICE_APP_PATH_0"/test"
465 if [[ $interface != *"DMAAP"* ]]; then
466 # Badly formatted json is not possible to send via dmaap
467 a1pms_api_put_policy 400 "unregistered-service" ricsim_g1_1 1 2000 NOTRANSIENT $notificationurl testdata/OSC/pi_bad_template.json
469 deviation "TR10 - a1pms allows policy creation on unregistered service (orig problem) - test combo $interface and $__httpx"
471 #a1pms_api_put_policy 400 "unregistered-service" ricsim_g1_1 1 2000 NOTRANSIENT testdata/OSC/pi1_template.json
473 a1pms_api_put_policy 201 "unregistered-service" ricsim_g1_1 1 2000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json
475 a1pms_api_put_policy 201 "service10" ricsim_g1_1 1 5000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json
476 a1pms_api_put_policy 200 "service10" ricsim_g1_1 1 5000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json
478 a1pms_api_put_policy 200 "service10" ricsim_g1_1 1 5000 true $notificationurl testdata/OSC/pi1_template.json
479 a1pms_api_put_policy 200 "service10" ricsim_g1_1 1 5000 false $notificationurl testdata/OSC/pi1_template.json
481 a1pms_api_put_policy 201 "service10" ricsim_g2_1 NOTYPE 5100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json
482 a1pms_api_put_policy 200 "service10" ricsim_g2_1 NOTYPE 5100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json
484 a1pms_api_put_policy 200 "service10" ricsim_g2_1 NOTYPE 5100 true $notificationurl testdata/STD/pi1_template.json
485 a1pms_api_put_policy 200 "service10" ricsim_g2_1 NOTYPE 5100 false $notificationurl testdata/STD/pi1_template.json
487 a1pms_api_put_policy 201 "service10" ricsim_g3_1 STD_QOS2_0.1.0 5200 NOTRANSIENT $notificationurl testdata/STD2/pi_qos2_template.json
488 a1pms_api_put_policy 200 "service10" ricsim_g3_1 STD_QOS2_0.1.0 5200 NOTRANSIENT $notificationurl testdata/STD2/pi_qos2_template.json
490 a1pms_api_put_policy 200 "service10" ricsim_g3_1 STD_QOS2_0.1.0 5200 true $notificationurl testdata/STD2/pi_qos2_template.json
491 a1pms_api_put_policy 200 "service10" ricsim_g3_1 STD_QOS2_0.1.0 5200 false $notificationurl testdata/STD2/pi_qos2_template.json
493 a1pms_api_get_policy_status 404 1
494 a1pms_api_get_policy_status 404 2
495 if [[ $TEST_ENV_PROFILE =~ ^ORAN-[A-H] ]] || [[ $TEST_ENV_PROFILE =~ ^ONAP-[A-L] ]]; then
506 a1pms_api_get_policy_status 200 5000 OSC "$VAL" "$VAL2"
507 a1pms_api_get_policy_status 200 5100 STD "UNDEFINED"
508 a1pms_api_get_policy_status 200 5200 STD2 $VAL3 $VAL4
511 deviation "TR10 - a1pms allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx"
513 #a1pms_equal json:policies 2
515 a1pms_equal json:policies 4
517 deviation "TR10 - a1pms allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx"
519 #a1pms_equal json:policy_ids 2
521 a1pms_equal json:policy-instances 4
523 deviation "TR10 - a1pms allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx"
525 #a1pms_api_get_policy_ids 200 NORIC NOSERVICE NOTYPE 5000 5100
526 #Allow policy create with unregistered service for now
527 a1pms_api_get_policy_ids 200 NORIC NOSERVICE NOTYPE 5000 5100 2000 5200
529 deviation "TR10 - a1pms allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx"
531 #a1pms_api_get_policy_ids 200 ricsim_g1_1 NOSERVICE NOTYPE 5000
532 #Allow policy create with unregistered service for now
533 a1pms_api_get_policy_ids 200 ricsim_g1_1 NOSERVICE NOTYPE 5000 2000
535 a1pms_api_get_policy_ids 200 ricsim_g2_1 NOSERVICE NOTYPE 5100
537 a1pms_api_get_policy_ids 200 ricsim_g3_1 NOSERVICE NOTYPE 5200
539 a1pms_api_get_policy_ids 200 NORIC "service10" NOTYPE 5000 5100 5200
541 deviation "TR10 - a1pms allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx"
543 #a1pms_api_get_policy_ids 200 NORIC NOSERVICE 1 5000
544 #Allow policy create with unregistered service for now
546 a1pms_api_get_policy_ids 200 NORIC NOSERVICE 1 5000 2000
548 a1pms_api_get_policy_ids 200 NORIC NOSERVICE 2 NOID
550 a1pms_api_get_policy_ids 200 NORIC NOSERVICE STD_QOS2_0.1.0 5200
552 a1pms_api_get_policy_ids 200 ricsim_g2_1 NOSERVICE 1 NOID
554 a1pms_api_get_policy 200 5000 testdata/OSC/pi1_template.json "service10" ricsim_g1_1 1 false $notificationurl
556 a1pms_api_get_policy 200 5100 testdata/STD/pi1_template.json "service10" ricsim_g2_1 NOTYPE false $notificationurl
558 a1pms_api_get_policy 200 5200 testdata/STD2/pi_qos2_template.json "service10" ricsim_g3_1 STD_QOS2_0.1.0 false $notificationurl
560 a1pms_api_get_policies 200 ricsim_g1_1 "service10" 1 5000 ricsim_g1_1 "service10" 1 false $notificationurl testdata/OSC/pi1_template.json
562 deviation "TR10 - a1pms allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx"
564 #a1pms_api_delete_policy 404 2000
565 #Allow policy create with unregistered service for now
566 a1pms_api_delete_policy 204 2000
568 a1pms_api_delete_policy 404 1500
570 a1pms_api_delete_policy 204 5000
572 a1pms_api_delete_policy 204 5200
574 a1pms_equal json:policies 1
577 a1pms_equal json:policy-instances 1
579 a1pms_api_delete_policy 204 5100
581 a1pms_equal json:policies 0
583 a1pms_equal json:policy-instances 0
585 cr_equal 0 received_callbacks 3
587 if [[ $interface = *"DMAAP"* ]]; then
588 mr_greater requests_submitted 0
589 VAL=$(mr_read requests_submitted)
590 mr_equal requests_fetched $VAL
591 mr_equal responses_submitted $VAL
592 mr_equal responses_fetched $VAL
593 mr_equal current_requests 0
594 mr_equal current_responses 0
596 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
599 mr_equal requests_submitted 0
602 if [ $USE_ISTIO -eq 0 ]; then
603 if [[ $interface = *"SDNC"* ]]; then
604 sim_contains_str ricsim_g1_1 remote_hosts $SDNC_APP_NAME
605 sim_contains_str ricsim_g2_1 remote_hosts $SDNC_APP_NAME
606 sim_contains_str ricsim_g3_1 remote_hosts $SDNC_APP_NAME
608 sim_contains_str ricsim_g1_1 remote_hosts $A1PMS_APP_NAME
609 sim_contains_str ricsim_g2_1 remote_hosts $A1PMS_APP_NAME
610 sim_contains_str ricsim_g3_1 remote_hosts $A1PMS_APP_NAME
616 if [[ $interface = *"SDNC"* ]]; then
620 store_logs "${__httpx}__${interface}"
626 #### TEST COMPLETE ####
631 auto_clean_environment