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="Create 10000 policies in sequence using http/https and a1pms REST with/without SDNC controller"
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 #Local vars in test script
50 ##########################
51 # Number of policies in each sequence
54 # Tested variants of SDNC config
55 TESTED_VARIANTS="NOSDNC SDNC"
57 #Test a1pms and simulator protocol versions (others are http only)
58 TESTED_PROTOCOLS="HTTP HTTPS"
60 for __httpx in $TESTED_PROTOCOLS ; do
61 for interface in $TESTED_VARIANTS ; do
63 echo "#####################################################################"
64 echo "#####################################################################"
65 echo "### Testing a1pms via $interface using $__httpx"
66 echo "#####################################################################"
67 echo "#####################################################################"
69 if [ $__httpx == "HTTPS" ]; then
81 # Policy instance start id
88 start_ric_simulators ricsim_g1 1 OSC_2.1.0
89 start_ric_simulators ricsim_g2 1 STD_1.1.3
90 start_ric_simulators ricsim_g3 1 STD_2.0.0
92 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
100 start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/$CONTROL_PANEL_CONFIG_FILE
102 if [ ! -z "$NRT_GATEWAY_APP_NAME" ]; then
103 start_gateway $SIM_GROUP/$NRT_GATEWAY_COMPOSE_DIR/$NRT_GATEWAY_CONFIG_FILE
106 start_a1pms NORPOXY $SIM_GROUP/$A1PMS_COMPOSE_DIR/$A1PMS_CONFIG_FILE
110 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
113 mr_equal requests_submitted 0
116 sim_put_policy_type 201 ricsim_g1_1 1 testdata/OSC/sim_1.json
117 sim_put_policy_type 201 ricsim_g3_1 STD_QOS2_0.1.0 testdata/STD2/sim_qos2.json
120 if [[ $interface == "SDNC" ]]; then
122 controller_api_wait_for_status_ok 200 ricsim_g1_1
123 prepare_a1pms_config SDNC ".a1pms_config.json"
125 prepare_a1pms_config NOSDNC ".a1pms_config.json"
128 if [ $RUNMODE == "KUBE" ]; then
129 a1pms_load_config ".a1pms_config.json"
131 a1pms_api_put_configuration 200 ".a1pms_config.json"
134 sleep_wait 120 "Let A1PMS configuration take effect"
136 a1pms_api_get_status 200
138 sim_print ricsim_g1_1 interface
139 sim_print ricsim_g2_1 interface
140 sim_print ricsim_g3_1 interface
142 a1pms_equal json:policy-types 3 300 #Wait for the a1pms to refresh types from the simulators
144 a1pms_api_put_service 201 "serv1" 3600 "$CR_SERVICE_APP_PATH_0/1"
146 notificationurl=$CR_SERVICE_APP_PATH_0"/test"
148 start_timer "Create polices in OSC via a1pms REST and $interface using "$__httpx
149 a1pms_api_put_policy 201 "serv1" ricsim_g1_1 1 $START_ID NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json $NUM_POLICIES
150 print_timer "Create polices in OSC via a1pms REST and $interface using "$__httpx
152 sim_equal ricsim_g1_1 num_instances $NUM_POLICIES
154 START_ID=$(($START_ID+$NUM_POLICIES))
156 start_timer "Create polices in STD via a1pms REST and $interface using "$__httpx
157 a1pms_api_put_policy 201 "serv1" ricsim_g2_1 NOTYPE $START_ID NOTRANSIENT $notificationurl testdata/STD/pi1_template.json $NUM_POLICIES
158 print_timer "Create polices in STD via a1pms REST and $interface using "$__httpx
160 sim_equal ricsim_g2_1 num_instances $NUM_POLICIES
164 START_ID=$(($START_ID+$NUM_POLICIES))
166 start_timer "Create polices in STD 2 via a1pms REST and $interface using "$__httpx
167 a1pms_api_put_policy 201 "serv1" ricsim_g3_1 STD_QOS2_0.1.0 $START_ID NOTRANSIENT $notificationurl testdata/STD2/pi_qos2_template.json $NUM_POLICIES
168 print_timer "Create polices in STD via a1pms REST and $interface using "$__httpx
170 sim_equal ricsim_g3_1 num_instances $NUM_POLICIES
174 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
175 INTERFACE_VARIANT=REST
176 if [ $__httpx == "HTTPS" ]; then
182 INTERFACE_VARIANT=DMAAP
183 if [ $__httpx == "HTTPS" ]; then
184 echo "Using secure ports towards dmaap"
185 use_a1pms_dmaap_https
187 echo "Using non-secure ports towards dmaap"
192 START_ID=$(($START_ID+$NUM_POLICIES))
194 start_timer "Create polices in OSC via a1pms $INTERFACE_VARIANT, one by one, and $interface using "$__httpx
195 a1pms_api_put_policy 201 "serv1" ricsim_g1_1 1 $START_ID NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json $NUM_POLICIES
196 print_timer "Create polices in OSC via a1pms $INTERFACE_VARIANT, one by one, and $interface using "$__httpx
198 sim_equal ricsim_g1_1 num_instances $((2*$NUM_POLICIES))
200 START_ID=$(($START_ID+$NUM_POLICIES))
202 start_timer "Create polices in STD via a1pms $INTERFACE_VARIANT, one by one, and $interface using "$__httpx
203 a1pms_api_put_policy 201 "serv1" ricsim_g2_1 NOTYPE $START_ID NOTRANSIENT $notificationurl testdata/STD/pi1_template.json $NUM_POLICIES
204 print_timer "Create polices in STD via a1pms $INTERFACE_VARIANT, one by one, and $interface using "$__httpx
206 sim_equal ricsim_g2_1 num_instances $((2*$NUM_POLICIES))
209 START_ID=$(($START_ID+$NUM_POLICIES))
211 start_timer "Create polices in STD 2 via a1pms $INTERFACE_VARIANT, one by one, and $interface using "$__httpx
212 a1pms_api_put_policy 201 "serv1" ricsim_g3_1 STD_QOS2_0.1.0 $START_ID NOTRANSIENT $notificationurl testdata/STD2/pi_qos2_template.json $NUM_POLICIES
213 print_timer "Create polices in STD via a1pms $INTERFACE_VARIANT, one by one, and $interface using "$__httpx
215 sim_equal ricsim_g3_1 num_instances $((2*$NUM_POLICIES))
217 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
220 START_ID=$(($START_ID+$NUM_POLICIES))
221 start_timer "Create polices in OSC via a1pms $INTERFACE_VARIANT in batch and $interface using "$__httpx
222 a1pms_api_put_policy_batch 201 "serv1" ricsim_g1_1 1 $START_ID NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json $NUM_POLICIES
223 print_timer "Create polices in OSC via a1pms $INTERFACE_VARIANT in batch and $interface using "$__httpx
225 sim_equal ricsim_g1_1 num_instances $((3*$NUM_POLICIES))
227 START_ID=$(($START_ID+$NUM_POLICIES))
229 start_timer "Create polices in STD via a1pms $INTERFACE_VARIANT in batch and $interface using "$__httpx
230 a1pms_api_put_policy_batch 201 "serv1" ricsim_g2_1 NOTYPE $START_ID NOTRANSIENT $notificationurl testdata/STD/pi1_template.json $NUM_POLICIES
231 print_timer "Create polices in STD via a1pms $INTERFACE_VARIANT in batch and $interface using "$__httpx
233 sim_equal ricsim_g2_1 num_instances $((3*$NUM_POLICIES))
236 START_ID=$(($START_ID+$NUM_POLICIES))
238 start_timer "Create polices in STD via a1pms $INTERFACE_VARIANT in batch and $interface using "$__httpx
239 a1pms_api_put_policy_batch 201 "serv1" ricsim_g3_1 STD_QOS2_0.1.0 $START_ID NOTRANSIENT $notificationurl testdata/STD2/pi_qos2_template.json $NUM_POLICIES
240 print_timer "Create polices in STD via a1pms $INTERFACE_VARIANT in batch and $interface using "$__httpx
242 sim_equal ricsim_g3_1 num_instances $((3*$NUM_POLICIES))
245 if [ $interface == "SDNC" ]; then
246 sim_contains_str ricsim_g1_1 remote_hosts $SDNC_APP_NAME
247 sim_contains_str ricsim_g2_1 remote_hosts $SDNC_APP_NAME
248 sim_contains_str ricsim_g3_1 remote_hosts $SDNC_APP_NAME
250 sim_contains_str ricsim_g1_1 remote_hosts $A1PMS_APP_NAME
251 sim_contains_str ricsim_g2_1 remote_hosts $A1PMS_APP_NAME
252 sim_contains_str ricsim_g3_1 remote_hosts $A1PMS_APP_NAME
256 if [[ $interface = *"SDNC"* ]]; then
260 store_logs "${__httpx}__${interface}"
264 #### TEST COMPLETE ####
268 auto_clean_environment