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"
86 if [ -n "$A1PMS_V3_FLAG" ] && [ "${A1PMS_V3_FLAG,,}" == "true" ]; then
90 for version in $(seq 2 $VERSIONS_TO_RUN); do
91 if [ "$version" == "3" ]; then
92 if [ -n "$A1PMS_V3" ] && [ -n "$A1PMS_API_PREFIX_V3" ] && [ -n "$A1PMS_ALIVE_URL_V3" ]; then
93 export A1PMS_VERSION="$A1PMS_V3"
94 export A1PMS_API_PREFIX="$A1PMS_API_PREFIX_V3"
95 export A1PMS_ALIVE_URL="$A1PMS_API_PREFIX$A1PMS_ALIVE_URL_V3"
97 echo "One/All parameters not set in env file (<A1PMS_V3>, <A1PMS_API_PREFIX_V3>, <A1PMS_ALIVE_URL_V3>)"
101 for __httpx in $TESTED_PROTOCOLS ; do
102 for interface in $TESTED_VARIANTS ; do
104 echo "#####################################################################"
105 echo "#####################################################################"
106 echo "### Testing a1pms: ${interface} and ${__httpx} with a1pms V${version} "
107 echo "#####################################################################"
108 echo "#####################################################################"
110 # Clean container and start all needed containers #
113 if [ $RUNMODE != "KUBE" ]; then
115 echo "ISTIO not supported by docker - setting USE-ISTIO=0"
118 if [ $USE_ISTIO -eq 1 ]; then
119 echo -e $RED"#########################################"$ERED
120 echo -e $RED"# Work around istio jwks cache"$ERED
121 echo -e $RED"# Cycle istiod down and up to clear cache"$ERED
123 __kube_scale deployment istiod istio-system 0
124 __kube_scale deployment istiod istio-system 1
125 echo -e $RED"# Cycle istiod done"
126 echo -e $RED"#########################################"$ERED
128 istio_enable_istio_namespace $KUBE_SIM_NAMESPACE
129 istio_enable_istio_namespace $KUBE_NONRTRIC_NAMESPACE
130 istio_enable_istio_namespace $KUBE_A1SIM_NAMESPACE
136 if [ $USE_ISTIO -eq 1 ]; then
139 keycloak_api_obtain_admin_token
141 keycloak_api_create_realm nrtrealm true 60
142 keycloak_api_create_confidential_client nrtrealm a1pmsc
143 keycloak_api_generate_client_secret nrtrealm a1pmsc
144 keycloak_api_get_client_secret nrtrealm a1pmsc
145 keycloak_api_create_client_roles nrtrealm a1pmsc nrtrole
146 keycloak_api_map_client_roles nrtrealm a1pmsc nrtrole
148 keycloak_api_get_client_token nrtrealm a1pmsc
150 CLIENT_TOKEN=$(keycloak_api_read_client_token nrtrealm a1pmsc)
151 echo "CLIENT_TOKEN: "$CLIENT_TOKEN
153 A1PMS_SEC=$(keycloak_api_read_client_secret nrtrealm a1pmsc)
154 echo "A1PMS_SEC: "$A1PMS_SEC
157 istio_req_auth_by_jwks ricsim-g1 $KUBE_A1SIM_NAMESPACE KUBEPROXY "$KUBE_PROXY_ISTIO_JWKS_KEYS"
158 istio_auth_policy_by_issuer ricsim-g1 $KUBE_A1SIM_NAMESPACE KUBEPROXY
160 istio_req_auth_by_jwksuri ricsim-g1 $KUBE_A1SIM_NAMESPACE nrtrealm
161 istio_auth_policy_by_realm ricsim-g1 $KUBE_A1SIM_NAMESPACE nrtrealm a1pmsc nrtrole
164 istio_req_auth_by_jwks ricsim-g2 $KUBE_A1SIM_NAMESPACE KUBEPROXY "$KUBE_PROXY_ISTIO_JWKS_KEYS"
165 istio_auth_policy_by_issuer ricsim-g2 $KUBE_A1SIM_NAMESPACE KUBEPROXY
167 istio_req_auth_by_jwksuri ricsim-g2 $KUBE_A1SIM_NAMESPACE nrtrealm
168 istio_auth_policy_by_realm ricsim-g2 $KUBE_A1SIM_NAMESPACE nrtrealm a1pmsc nrtrole
171 istio_req_auth_by_jwks ricsim-g3 $KUBE_A1SIM_NAMESPACE KUBEPROXY "$KUBE_PROXY_ISTIO_JWKS_KEYS"
172 istio_auth_policy_by_issuer ricsim-g3 $KUBE_A1SIM_NAMESPACE KUBEPROXY
174 istio_req_auth_by_jwksuri ricsim-g3 $KUBE_A1SIM_NAMESPACE nrtrealm
175 istio_auth_policy_by_realm ricsim-g3 $KUBE_A1SIM_NAMESPACE nrtrealm a1pmsc nrtrole
178 istio_req_auth_by_jwks $CR_APP_NAME $KUBE_SIM_NAMESPACE KUBEPROXY "$KUBE_PROXY_ISTIO_JWKS_KEYS"
179 istio_auth_policy_by_issuer $CR_APP_NAME $KUBE_SIM_NAMESPACE KUBEPROXY
181 istio_req_auth_by_jwksuri $CR_APP_NAME $KUBE_SIM_NAMESPACE nrtrealm
182 istio_auth_policy_by_realm $CR_APP_NAME $KUBE_SIM_NAMESPACE nrtrealm a1pmsc nrtrole
184 a1pms_configure_sec nrtrealm a1pmsc $A1PMS_SEC
187 if [ $__httpx == "HTTPS" ]; then
195 start_a1pms NORPOXY $SIM_GROUP/$A1PMS_COMPOSE_DIR/$A1PMS_CONFIG_FILE
199 # Create service to be able to receive events when rics becomes available
200 # Must use rest towards the a1pms since dmaap is not configured yet
201 a1pms_api_put_service 201 "ric-registration" 0 "$CR_SERVICE_APP_PATH_0/ric-registration"
204 if [ $__httpx == "HTTPS" ]; then
207 if [[ $interface = *"SDNC"* ]]; then
208 if [[ "$SDNC_FEATURE_LEVEL" == *"NO_NB_HTTPS"* ]]; then
209 deviation "SDNC does not support NB https"
215 if [[ $interface = *"DMAAP"* ]]; then
216 use_a1pms_dmaap_https
223 if [[ $interface = *"SDNC"* ]]; then
226 if [[ $interface = *"DMAAP"* ]]; then
233 start_ric_simulators ricsim_g1 1 OSC_2.1.0
234 start_ric_simulators ricsim_g2 1 STD_1.1.3
236 sim_put_policy_type 201 ricsim_g1_1 1 testdata/OSC/sim_1.json
237 sim_put_policy_type 201 ricsim_g1_1 2 testdata/OSC/sim_2.json
239 start_ric_simulators ricsim_g3 1 STD_2.0.0
240 sim_put_policy_type 201 ricsim_g3_1 STD_QOS_0_2_0 testdata/STD2/sim_qos.json
241 sim_put_policy_type 201 ricsim_g3_1 STD_QOS2_0.1.0 testdata/STD2/sim_qos2.json
243 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
251 start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/$CONTROL_PANEL_CONFIG_FILE
253 if [ ! -z "$NRT_GATEWAY_APP_NAME" ]; then
254 start_gateway $SIM_GROUP/$NRT_GATEWAY_COMPOSE_DIR/$NRT_GATEWAY_CONFIG_FILE
258 if [[ $interface = *"SDNC"* ]]; then
260 controller_api_wait_for_status_ok 200 ricsim_g1_1
261 prepare_a1pms_config SDNC ".a1pms_config.json"
263 prepare_a1pms_config NOSDNC ".a1pms_config.json"
266 if [ $RUNMODE == "KUBE" ]; then
267 a1pms_load_config ".a1pms_config.json"
269 #Temporary switch to http/https if dmaap use. Otherwise it is not possible to push config
270 if [ $__httpx == "HTTPS" ]; then
276 if [[ $interface != *"DMAAP"* ]]; then
277 echo "{}" > ".a1pms_config_incorrect.json"
278 a1pms_api_put_configuration 400 ".a1pms_config_incorrect.json"
281 a1pms_api_put_configuration 200 ".a1pms_config.json"
282 a1pms_api_get_configuration 200 ".a1pms_config.json"
283 if [ $__httpx == "HTTPS" ]; then
284 if [[ $interface = *"DMAAP"* ]]; then
285 use_a1pms_dmaap_https
290 if [[ $interface = *"DMAAP"* ]]; then
298 a1pms_equal json:rics 3 300
300 if [ "$A1PMS_VERSION" == "V2" ]; then
301 a1pms_equal json:policy-types 5 120 #Wait for the a1pms to refresh types from the simulator
302 elif [ "$A1PMS_VERSION" == "V3" ]; then
303 a1pms_equal json:policytypes 5 120 #Wait for the a1pms to refresh types from the simulator
306 a1pms_equal json:policies 0
308 if [ "$A1PMS_VERSION" == "V2" ]; then
309 a1pms_equal json:policy-instances 0
312 cr_equal 0 received_callbacks 3 120
313 cr_api_check_all_sync_events 200 0 ric-registration ricsim_g1_1 ricsim_g2_1 ricsim_g3_1
315 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
318 mr_equal requests_submitted 0
322 echo "############################################"
323 echo "############## Health check ################"
324 echo "############################################"
326 sleep_wait 120 "Let A1PMS configuration take effect"
328 a1pms_api_get_status 200
330 a1pms_api_get_status_root 200
332 echo "############################################"
333 echo "##### Service registry and supervision #####"
334 echo "############################################"
336 a1pms_api_get_services 404 "service1"
338 a1pms_api_put_service 201 "service1" 1000 "$CR_SERVICE_APP_PATH_0/1"
340 a1pms_api_put_service 200 "service1" 2000 "$CR_SERVICE_APP_PATH_0/1"
343 a1pms_api_put_service 400 "service2" -1 "$CR_SERVICE_APP_PATH_0/2"
345 a1pms_api_put_service 400 "service2" "wrong" "$CR_SERVICE_APP_PATH_0/2"
347 a1pms_api_put_service 400 "service2" 100 "/test"
349 a1pms_api_put_service 400 "service2" 100 "test-path"
351 a1pms_api_put_service 201 "service2" 300 "ftp://localhost:80/test"
353 a1pms_api_get_services 200 "service1" "service1" 2000 "$CR_SERVICE_APP_PATH_0/1"
355 a1pms_api_get_service_ids 200 "service1" "service2" "ric-registration"
357 a1pms_api_put_service 201 "service3" 5000 "$CR_SERVICE_APP_PATH_0/3"
360 a1pms_api_get_service_ids 200 "service1" "service2" "service3" "ric-registration"
363 a1pms_api_get_services 200 "service1" "service1" 2000 "$CR_SERVICE_APP_PATH_0/1"
365 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"
367 a1pms_api_get_services 200
369 if [ "$A1PMS_VERSION" == "V2" ]; then
370 deviation "TR2 - Keep alive shall return 200/201 according to doc, only 200 works - test combo $interface and $__httpx"
371 #The below should work, kept here until fixed or other decision made
372 #a1pms_api_put_services_keepalive 201 "service1"
373 #Using the below until decision
374 a1pms_api_put_services_keepalive 200 "service1"
376 deviation "TR2 - Keep alive shall return 200/201 according to doc, only 200 works - test combo $interface and $__httpx"
377 #The below should work, keept here until fixed or other decision made
378 #a1pms_api_put_services_keepalive 201 "service3"
379 #Using the below until decision
380 a1pms_api_put_services_keepalive 200 "service3"
382 a1pms_api_put_services_keepalive 200 "service1"
384 a1pms_api_put_services_keepalive 200 "service3"
386 a1pms_api_put_services_keepalive 404 "service5"
389 a1pms_api_get_service_ids 200 "service1" "service2" "service3" "ric-registration"
391 a1pms_api_delete_services 204 "service1"
393 a1pms_api_get_service_ids 200 "service2" "service3" "ric-registration"
396 a1pms_api_put_service 201 "service1" 50 "$CR_SERVICE_APP_PATH_0/1"
398 a1pms_api_get_service_ids 200 "service1" "service2" "service3" "ric-registration"
401 a1pms_api_delete_services 204 "service1"
402 a1pms_api_delete_services 204 "service3"
404 a1pms_equal json:services 2
406 a1pms_api_delete_services 204 "service2"
408 a1pms_equal json:services 1
410 echo "############################################"
411 echo "############## RIC Repository ##############"
412 echo "############################################"
414 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"
416 a1pms_api_get_rics 200 1 "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2:AVAILABLE"
418 a1pms_api_get_rics 404 47
420 a1pms_api_get_rics 404 "test"
422 a1pms_api_get_ric 200 me1_ricsim_g1_1 NORIC "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2:AVAILABLE"
424 a1pms_api_get_ric 200 me2_ricsim_g1_1 NORIC "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2:AVAILABLE"
426 a1pms_api_get_ric 200 me1_ricsim_g2_1 NORIC "ricsim_g2_1:me1_ricsim_g2_1,me2_ricsim_g2_1:EMPTYTYPE:AVAILABLE"
428 a1pms_api_get_ric 200 me2_ricsim_g2_1 NORIC "ricsim_g2_1:me1_ricsim_g2_1,me2_ricsim_g2_1:EMPTYTYPE:AVAILABLE"
430 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"
432 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"
434 a1pms_api_get_ric 200 NOME ricsim_g1_1 "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2:AVAILABLE"
436 a1pms_api_get_ric 200 NOME ricsim_g2_1 "ricsim_g2_1:me1_ricsim_g2_1,me2_ricsim_g2_1:EMPTYTYPE:AVAILABLE"
438 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"
440 a1pms_api_get_ric 404 NOME test1
442 a1pms_api_get_ric 404 test NORIC
444 a1pms_api_get_ric 400 me1_ricsim_g1_1 ricsim_g1_1
446 a1pms_api_get_ric 400 me1_ricsim_g1_1 TESTRIC
448 a1pms_api_get_ric 400 TESTME ricsim_g1_1
450 echo "############################################"
451 echo "########### A1 Policy Management ###########"
452 echo "############################################"
454 deviation "TR9 - a1pms modify the type with type id - test combo $interface and $__httpx"
455 #Behaviour accepted for now
456 a1pms_api_get_policy_type 200 1 testdata/OSC/1-a1pms-modified.json
457 deviation "TR9 - a1pms modify the type with type id - test combo $interface and $__httpx"
458 #Behaviour accepted for now
459 a1pms_api_get_policy_type 200 2 testdata/OSC/2-a1pms-modified.json
460 deviation "TR9 - a1pms modify the type with type id - test combo $interface and $__httpx"
461 #Behaviour accepted for now
462 a1pms_api_get_policy_type 200 STD_QOS_0_2_0 testdata/STD2/qos-a1pms-modified.json
463 deviation "TR9 - a1pms modify the type with type id - test combo $interface and $__httpx"
464 #Behaviour accepted for now
465 a1pms_api_get_policy_type 200 STD_QOS2_0.1.0 testdata/STD2/qos2-a1pms-modified.json
467 a1pms_api_get_policy_type 404 3
468 if [ "$A1PMS_VERSION" != "V3" ]; then
469 a1pms_api_get_policy_schemas 404
471 a1pms_api_get_policy_types 200 NORIC 1 2 EMPTY STD_QOS_0_2_0 STD_QOS2_0.1.0
473 a1pms_api_get_policy_types 200 ricsim_g1_1 1 2
475 a1pms_api_get_policy_types 200 ricsim_g2_1 EMPTY
477 a1pms_api_get_policy_types 200 ricsim_g3_1 STD_QOS_0_2_0 STD_QOS2_0.1.0
479 a1pms_api_get_policy_types 404 dummy-ric
482 if [ "$A1PMS_VERSION" == "V3" ]; then
484 a1pms_api_get_policy_types_v3 200 NORIC 1:ricsim_g1_1 2:ricsim_g1_1 EMPTY:ricsim_g2_1 STD_QOS_0_2_0:ricsim_g3_1 STD_QOS2_0.1.0:ricsim_g3_1
486 a1pms_api_get_policy_types_v3 200 ricsim_g1_1 1:ricsim_g1_1 2:ricsim_g1_1
488 a1pms_api_get_policy_types_v3 200 ricsim_g2_1 EMPTY:ricsim_g2_1
490 a1pms_api_get_policy_types_v3 200 ricsim_g3_1 STD_QOS_0_2_0:ricsim_g3_1 STD_QOS2_0.1.0:ricsim_g3_1
492 a1pms_api_get_policy_types_v3 404 dummy-ric
494 a1pms_api_post_policy_v3 201 "unregistered-service" ricsim_g1_1 1 2000 NOTRANSIENT NONOTIFYURL testdata/OSC/pi1_template.json
496 a1pms_api_post_policy_v3 201 "service10" ricsim_g1_1 1 5000 NOTRANSIENT NONOTIFYURL testdata/OSC/pi1_template.json
498 a1pms_api_post_policy_v3 201 NOSERVICE ricsim_g2_1 NOTYPE 5100 NOTRANSIENT NONOTIFYURL testdata/STD/pi1_template.json
500 a1pms_api_post_policy_v3 201 NOSERVICE ricsim_g3_1 STD_QOS2_0.1.0 5200 NOTRANSIENT NONOTIFYURL testdata/STD2/pi_qos2_template.json
503 a1pms_api_put_service 201 "service10" 3600 "$CR_SERVICE_APP_PATH_0/1"
505 notificationurl=$CR_SERVICE_APP_PATH_0"/test"
506 deviation "TR10 - a1pms allows policy creation on unregistered service (orig problem) - test combo $interface and $__httpx"
508 if [ "$A1PMS_VERSION" != "V3" ]; then
510 if [[ $interface != *"DMAAP"* ]]; then
511 # Badly formatted json is not possible to send via dmaap
512 a1pms_api_put_policy 400 "unregistered-service" ricsim_g1_1 1 2000 NOTRANSIENT $notificationurl testdata/OSC/pi_bad_template.json
514 a1pms_api_put_policy 201 "unregistered-service" ricsim_g1_1 1 2000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json
516 a1pms_api_put_policy 201 "service10" ricsim_g1_1 1 5000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json
517 a1pms_api_put_policy 200 "service10" ricsim_g1_1 1 5000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json
519 a1pms_api_put_policy 200 "service10" ricsim_g1_1 1 5000 true $notificationurl testdata/OSC/pi1_template.json
520 a1pms_api_put_policy 200 "service10" ricsim_g1_1 1 5000 false $notificationurl testdata/OSC/pi1_template.json
522 a1pms_api_put_policy 201 "service10" ricsim_g2_1 NOTYPE 5100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json
523 a1pms_api_put_policy 200 "service10" ricsim_g2_1 NOTYPE 5100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json
525 a1pms_api_put_policy 200 "service10" ricsim_g2_1 NOTYPE 5100 true $notificationurl testdata/STD/pi1_template.json
526 a1pms_api_put_policy 200 "service10" ricsim_g2_1 NOTYPE 5100 false $notificationurl testdata/STD/pi1_template.json
528 a1pms_api_put_policy 201 "service10" ricsim_g3_1 STD_QOS2_0.1.0 5200 NOTRANSIENT $notificationurl testdata/STD2/pi_qos2_template.json
529 a1pms_api_put_policy 200 "service10" ricsim_g3_1 STD_QOS2_0.1.0 5200 NOTRANSIENT $notificationurl testdata/STD2/pi_qos2_template.json
531 a1pms_api_put_policy 200 "service10" ricsim_g3_1 STD_QOS2_0.1.0 5200 true $notificationurl testdata/STD2/pi_qos2_template.json
532 a1pms_api_put_policy 200 "service10" ricsim_g3_1 STD_QOS2_0.1.0 5200 false $notificationurl testdata/STD2/pi_qos2_template.json
534 a1pms_api_get_policy_status 404 1
535 a1pms_api_get_policy_status 404 2
536 if [[ $TEST_ENV_PROFILE =~ ^ORAN-[A-H] ]] || [[ $TEST_ENV_PROFILE =~ ^ONAP-[A-L] ]]; then
547 a1pms_api_get_policy_status 200 5000 OSC "$VAL" "$VAL2"
548 a1pms_api_get_policy_status 200 5100 STD "UNDEFINED"
549 a1pms_api_get_policy_status 200 5200 STD2 $VAL3 $VAL4
551 deviation "TR10 - a1pms allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx"
553 #a1pms_equal json:policy_ids 2
555 a1pms_equal json:policy-instances 4
558 deviation "TR10 - a1pms allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx"
560 #a1pms_equal json:policies 2
562 a1pms_equal json:policies 4
564 deviation "TR10 - a1pms allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx"
566 #a1pms_api_get_policy_ids 200 NORIC NOSERVICE NOTYPE 5000 5100
567 #Allow policy create with unregistered service for now
569 if [ "$A1PMS_VERSION" != "V3" ]; then
570 a1pms_api_get_policy_ids 200 NORIC NOSERVICE NOTYPE 5000 5100 2000 5200
572 deviation "TR10 - a1pms allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx"
574 #a1pms_api_get_policy_ids 200 ricsim_g1_1 NOSERVICE NOTYPE 5000
575 #Allow policy create with unregistered service for now
576 a1pms_api_get_policy_ids 200 ricsim_g1_1 NOSERVICE NOTYPE 5000 2000
578 a1pms_api_get_policy_ids 200 ricsim_g2_1 NOSERVICE NOTYPE 5100
580 a1pms_api_get_policy_ids 200 ricsim_g3_1 NOSERVICE NOTYPE 5200
582 a1pms_api_get_policy_ids 200 NORIC "service10" NOTYPE 5000 5100 5200
584 deviation "TR10 - a1pms allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx"
586 #a1pms_api_get_policy_ids 200 NORIC NOSERVICE 1 5000
587 #Allow policy create with unregistered service for now
589 a1pms_api_get_policy_ids 200 NORIC NOSERVICE 1 5000 2000
591 a1pms_api_get_policy_ids 200 NORIC NOSERVICE 2 NOID
593 a1pms_api_get_policy_ids 200 NORIC NOSERVICE STD_QOS2_0.1.0 5200
595 a1pms_api_get_policy_ids 200 ricsim_g2_1 NOSERVICE 1 NOID
598 if [ "$A1PMS_VERSION" == "V3" ]; then
599 a1pms_api_get_all_policies_v3 200 NORIC NOSERVICE NOTYPE 5000:ricsim_g1_1 5100:ricsim_g2_1 2000:ricsim_g1_1 5200:ricsim_g3_1
601 deviation "TR10 - a1pms allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx"
603 #a1pms_api_get_policy_ids 200 ricsim_g1_1 NOSERVICE NOTYPE 5000
604 #Allow policy create with unregistered service for now
605 a1pms_api_get_all_policies_v3 200 ricsim_g1_1 NOSERVICE NOTYPE 5000:ricsim_g1_1 2000:ricsim_g1_1
607 a1pms_api_get_all_policies_v3 200 ricsim_g2_1 NOSERVICE NOTYPE 5100:ricsim_g2_1
609 a1pms_api_get_all_policies_v3 200 ricsim_g3_1 NOSERVICE NOTYPE 5200:ricsim_g3_1
611 a1pms_api_get_all_policies_v3 200 NORIC "service10" NOTYPE 5000:ricsim_g1_1
613 deviation "TR10 - a1pms allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx"
615 #a1pms_api_get_policy_ids 200 NORIC NOSERVICE 1 5000
616 #Allow policy create with unregistered service for now
618 a1pms_api_get_all_policies_v3 200 NORIC NOSERVICE 1 5000:ricsim_g1_1 2000:ricsim_g1_1
620 a1pms_api_get_all_policies_v3 200 NORIC NOSERVICE 2 NOID
622 a1pms_api_get_all_policies_v3 200 NORIC NOSERVICE STD_QOS2_0.1.0 5200:ricsim_g3_1
624 a1pms_api_get_all_policies_v3 200 ricsim_g2_1 NOSERVICE 1 NOID
627 a1pms_api_get_policy 200 5000 testdata/OSC/pi1_template.json "service10" ricsim_g1_1 1 false $notificationurl
629 a1pms_api_get_policy 200 5100 testdata/STD/pi1_template.json "service10" ricsim_g2_1 NOTYPE false $notificationurl
631 a1pms_api_get_policy 200 5200 testdata/STD2/pi_qos2_template.json "service10" ricsim_g3_1 STD_QOS2_0.1.0 false $notificationurl
633 if [ "$A1PMS_VERSION" != "V3" ]; then
634 a1pms_api_get_policies 200 ricsim_g1_1 "service10" 1 5000 ricsim_g1_1 "service10" 1 false $notificationurl testdata/OSC/pi1_template.json
637 if [ "$A1PMS_VERSION" == "V3" ]; then
638 a1pms_api_put_policy_v3 200 5100 testdata/STD/pi1_template.json
640 a1pms_api_put_policy_v3 200 5200 testdata/STD2/pi_qos2_template.json
642 if [[ $interface != *"DMAAP"* ]]; then
643 a1pms_api_put_policy_v3 400 2000 testdata/OSC/pi_bad_template.json
646 deviation "TR10 - a1pms allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx"
648 #a1pms_api_delete_policy 404 2000
649 #Allow policy create with unregistered service for now
650 a1pms_api_delete_policy 204 2000
652 a1pms_api_delete_policy 404 1500
654 a1pms_api_delete_policy 204 5000
656 a1pms_api_delete_policy 204 5200
658 a1pms_equal json:policies 1
660 if [ "$A1PMS_VERSION" != "V3" ]; then
661 a1pms_equal json:policy-instances 1
664 a1pms_api_delete_policy 204 5100
666 a1pms_equal json:policies 0
668 if [ "$A1PMS_VERSION" != "V3" ]; then
669 a1pms_equal json:policy-instances 0
672 cr_equal 0 received_callbacks 3
674 if [[ $interface = *"DMAAP"* ]]; then
675 mr_greater requests_submitted 0
676 VAL=$(mr_read requests_submitted)
677 mr_equal requests_fetched $VAL
678 mr_equal responses_submitted $VAL
679 mr_equal responses_fetched $VAL
680 mr_equal current_requests 0
681 mr_equal current_responses 0
683 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
686 mr_equal requests_submitted 0
689 if [ $USE_ISTIO -eq 0 ]; then
690 if [[ $interface = *"SDNC"* ]]; then
691 sim_contains_str ricsim_g1_1 remote_hosts $SDNC_APP_NAME
692 sim_contains_str ricsim_g2_1 remote_hosts $SDNC_APP_NAME
693 sim_contains_str ricsim_g3_1 remote_hosts $SDNC_APP_NAME
695 sim_contains_str ricsim_g1_1 remote_hosts $A1PMS_APP_NAME
696 sim_contains_str ricsim_g2_1 remote_hosts $A1PMS_APP_NAME
697 sim_contains_str ricsim_g3_1 remote_hosts $A1PMS_APP_NAME
703 if [[ $interface = *"SDNC"* ]]; then
707 store_logs "${__httpx}__${interface}"
714 #### TEST COMPLETE ####
719 auto_clean_environment