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=================================================
21 TC_ONELINE_DESCR="Resync 10000 policies using OSC and STD interface"
23 #App names to include in the test when running docker, space separated list
24 DOCKER_INCLUDED_IMAGES="CP CR MR A1PMS RICSIM SDNC NGW KUBEPROXY"
26 #App names to include in the test when running kubernetes, space separated list
27 KUBE_INCLUDED_IMAGES="CP CR MR A1PMS RICSIM SDNC KUBEPROXY NGW"
28 #Pre-started app (not started by script) to include in the test when running kubernetes, space separated list
29 KUBE_PRESTARTED_IMAGES=""
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"
36 #Supported test environment profiles
37 SUPPORTED_PROFILES="ONAP-KOHN ONAP-LONDON ONAP-MONTREAL ORAN-G-RELEASE ORAN-H-RELEASE ORAN-I-RELEASE"
39 SUPPORTED_RUNMODES="DOCKER KUBE"
41 . ../common/testcase_common.sh $@
47 sim_generate_policy_uuid
49 # Tested variants of REST/DMAAP/SDNC config
50 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
51 TESTED_VARIANTS="REST REST+SDNC"
53 TESTED_VARIANTS="REST DMAAP REST+SDNC DMAAP+SDNC DMAAP_BATCH DMAAP_BATCH+SDNC"
55 #Test a1pms and simulator protocol versions (others are http only)
56 TESTED_PROTOCOLS="HTTP HTTPS"
58 for __httpx in $TESTED_PROTOCOLS ; do
59 for interface in $TESTED_VARIANTS ; do
61 echo "#####################################################################"
62 echo "#####################################################################"
63 echo "### Testing a1pms: "$interface" and "$__httpx
64 echo "#####################################################################"
65 echo "#####################################################################"
67 if [ $__httpx == "HTTPS" ]; then
70 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
75 if [[ $interface = *"SDNC"* ]]; then
76 if [[ "$SDNC_FEATURE_LEVEL" == *"NO_NB_HTTPS"* ]]; then
77 deviation "SDNC does not support NB https"
83 if [[ $interface = *"DMAAP"* ]]; then
91 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
96 if [[ $interface = *"SDNC"* ]]; then
99 if [[ $interface = *"DMAAP"* ]]; then
106 # Clean container and start all needed containers #
111 start_ric_simulators ricsim_g1 4 OSC_2.1.0
113 start_ric_simulators ricsim_g2 4 STD_1.1.3
115 start_ric_simulators ricsim_g3 4 STD_2.0.0
117 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
125 start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/$CONTROL_PANEL_CONFIG_FILE
127 if [ ! -z "$NRT_GATEWAY_APP_NAME" ]; then
128 start_gateway $SIM_GROUP/$NRT_GATEWAY_COMPOSE_DIR/$NRT_GATEWAY_CONFIG_FILE
131 start_a1pms NORPOXY $SIM_GROUP/$A1PMS_COMPOSE_DIR/$A1PMS_CONFIG_FILE
136 if [[ $interface = *"SDNC"* ]]; then
138 controller_api_wait_for_status_ok 200 ricsim_g1_1
139 prepare_a1pms_config SDNC ".a1pms_config.json"
141 prepare_a1pms_config NOSDNC ".a1pms_config.json"
144 if [ $RUNMODE == "KUBE" ]; then
145 a1pms_load_config ".a1pms_config.json"
147 #Temporary switch to http/https if dmaap use. Otherwise it is not possible to push config
148 if [ $__httpx == "HTTPS" ]; then
153 a1pms_api_put_configuration 200 ".a1pms_config.json"
154 if [ $__httpx == "HTTPS" ]; then
155 if [[ $interface = *"DMAAP"* ]]; then
156 use_a1pms_dmaap_https
161 if [[ $interface = *"DMAAP"* ]]; then
169 sleep_wait 120 "Let A1PMS configuration take effect"
171 a1pms_api_get_status 200
173 sim_print ricsim_g1_1 interface
175 sim_print ricsim_g2_1 interface
177 sim_print ricsim_g3_1 interface
179 sim_put_policy_type 201 ricsim_g1_1 1 testdata/OSC/sim_1.json
181 a1pms_equal json:policy-types 2 120 #Wait for the a1pms to refresh types from the simulator
183 a1pms_api_put_service 201 "serv1" 3600 "$CR_SERVICE_APP_PATH_0/1"
186 NUM_POLICIES=10000 # Must be at least 100
188 notificationurl=$CR_SERVICE_APP_PATH_0"/test"
190 if [[ $interface == *"BATCH"* ]]; then
191 a1pms_api_put_policy_batch 201 "serv1" ricsim_g1_1 1 $START_ID NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json $NUM_POLICIES
193 a1pms_api_put_policy 201 "serv1" ricsim_g1_1 1 $START_ID NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json $NUM_POLICIES
196 sim_equal ricsim_g1_1 num_instances $NUM_POLICIES
198 sim_post_delete_instances 200 ricsim_g1_1
200 sim_equal ricsim_g1_1 num_instances 0
202 if [[ $interface = *"SDNC"* ]]; then
203 deviation "Sync over SDNC seem to be slower from Jakarta version..."
204 sim_equal ricsim_g1_1 num_instances $NUM_POLICIES 2000
206 sim_equal ricsim_g1_1 num_instances $NUM_POLICIES 300
209 START_ID2=$(($START_ID+$NUM_POLICIES))
211 if [[ $interface == *"BATCH"* ]]; then
212 a1pms_api_put_policy_batch 201 "serv1" ricsim_g2_1 NOTYPE $START_ID2 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json $NUM_POLICIES
214 a1pms_api_put_policy 201 "serv1" ricsim_g2_1 NOTYPE $START_ID2 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json $NUM_POLICIES
216 sim_equal ricsim_g2_1 num_instances $NUM_POLICIES
218 sim_post_delete_instances 200 ricsim_g2_1
220 sim_equal ricsim_g2_1 num_instances 0
221 if [[ $interface = *"SDNC"* ]]; then
222 deviation "Sync over SDNC seem to be slower from Jakarta version..."
223 sim_equal ricsim_g2_1 num_instances $NUM_POLICIES 2000
225 sim_equal ricsim_g2_1 num_instances $NUM_POLICIES 300
228 a1pms_api_delete_policy 204 $(($START_ID+47))
230 a1pms_api_delete_policy 204 $(($START_ID+$NUM_POLICIES-39))
232 sim_post_delete_instances 200 ricsim_g1_1
234 if [[ $interface = *"SDNC"* ]]; then
235 deviation "Sync over SDNC seem to be slower from Jakarta version..."
236 sim_equal ricsim_g1_1 num_instances $(($NUM_POLICIES-2)) 2000
238 sim_equal ricsim_g1_1 num_instances $(($NUM_POLICIES-2)) 300
241 a1pms_api_delete_policy 204 $(($START_ID2+37))
243 a1pms_api_delete_policy 204 $(($START_ID2+$NUM_POLICIES-93))
245 a1pms_api_delete_policy 204 $(($START_ID2+$NUM_POLICIES-91))
247 sim_post_delete_instances 200 ricsim_g2_1
249 if [[ $interface = *"SDNC"* ]]; then
250 deviation "Sync over SDNC seem to be slower from Jakarta version..."
251 sim_equal ricsim_g1_1 num_instances $(($NUM_POLICIES-2)) 2000
253 sim_equal ricsim_g2_1 num_instances $(($NUM_POLICIES-3)) 2000
255 sim_equal ricsim_g1_1 num_instances $(($NUM_POLICIES-2)) 300
257 sim_equal ricsim_g2_1 num_instances $(($NUM_POLICIES-3)) 300
260 a1pms_equal json:policies $(($NUM_POLICIES-2+$NUM_POLICIES-3))
263 if [[ $interface = *"SDNC"* ]]; then
269 store_logs "${__httpx}__${interface}"
276 #### TEST COMPLETE ####
281 auto_clean_environment