blob: 89c347ac723ca7b09c200bd909ac9499ee1c51fc [file] [log] [blame]
BjornMagnussonXA70e878f2020-05-11 14:11:30 +02001#!/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
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +010020TC_ONELINE_DESCR="Repeatedly create and delete policies in each RICs for 24h (or configured number of days). Via a1pms REST/DMAAP/DMAAP_BATCH and SDNC using http or https"
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020021
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010022#App names to include in the test when running docker, space separated list
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +010023DOCKER_INCLUDED_IMAGES="CBS CONSUL CP CR MR A1PMS RICSIM SDNC NGW KUBEPROXY"
BjornMagnussonXA70e878f2020-05-11 14:11:30 +020024
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010025#App names to include in the test when running kubernetes, space separated list
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +010026KUBE_INCLUDED_IMAGES="CP CR MR A1PMS RICSIM SDNC KUBEPROXY NGW"
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010027#Prestarted app (not started by script) to include in the test when running kubernetes, space separated list
28KUBE_PRESTARTED_IMAGES=""
29
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010030#Ignore image in DOCKER_INCLUDED_IMAGES, KUBE_INCLUDED_IMAGES if
31#the image is not configured in the supplied env_file
32#Used for images not applicable to all supported profile
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +010033CONDITIONALLY_IGNORED_IMAGES="CBS CONSUL NGW"
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010034
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010035#Supported test environment profiles
BjornMagnussonXAe60d04e2021-12-27 13:38:01 +010036SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ONAP-ISTANBUL ONAP-JAKARTA ORAN-CHERRY ORAN-D-RELEASE ORAN-E-RELEASE ORAN-F-RELEASE"
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010037#Supported run modes
38SUPPORTED_RUNMODES="DOCKER KUBE"
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +010039
BjornMagnussonXA79e37002021-11-22 13:36:04 +010040. ../common/testcase_common.sh $@
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010041
42setup_testenvironment
BjornMagnussonXA70e878f2020-05-11 14:11:30 +020043
44#### TEST BEGIN ####
45
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010046generate_policy_uuid
BjornMagnussonXAad047782020-06-08 15:54:11 +020047
BjornMagnussonXA70e878f2020-05-11 14:11:30 +020048#Local vars in test script
49##########################
BjornMagnussonXA496156d2020-08-10 14:16:24 +020050
BjornMagnussonXA70e878f2020-05-11 14:11:30 +020051# Number of RICs per interface type (OSC and STD)
52NUM_RICS=30
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +010053if [ "$A1PMS_VERSION" == "V2" ]; then
BjornMagnussonXA2791e082020-11-12 00:52:08 +010054 NUM_RICS=20 # 3 A1 interfaces test, less sims per interface. total sims will be same
55fi
56
BjornMagnussonXA70e878f2020-05-11 14:11:30 +020057# Number of policy instances per RIC
58NUM_INSTANCES=5
59
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020060DAYS=3
61
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010062clean_environment
BjornMagnussonXA70e878f2020-05-11 14:11:30 +020063
BjornMagnussonXA663566c2021-11-08 10:25:07 +010064start_kube_proxy
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010065
BjornMagnussonXA496156d2020-08-10 14:16:24 +020066# use HTTP or HTTPS for all apis
67HTTPX=HTTPS
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020068
BjornMagnussonXA496156d2020-08-10 14:16:24 +020069if [ $HTTPX == "HTTP" ]; then
BjornMagnussonXA496156d2020-08-10 14:16:24 +020070 use_cr_http
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +010071 use_a1pms_rest_http
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020072 use_sdnc_http
73 use_simulator_http
74else
BjornMagnussonXA496156d2020-08-10 14:16:24 +020075 use_cr_https
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +010076 use_a1pms_rest_https
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020077 use_sdnc_https
78 use_simulator_https
79fi
80
BjornMagnussonXA70e878f2020-05-11 14:11:30 +020081start_ric_simulators ricsim_g1 $NUM_RICS OSC_2.1.0
82
83start_ric_simulators ricsim_g2 $NUM_RICS STD_1.1.3
84
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +010085if [ "$A1PMS_VERSION" == "V2" ]; then
BjornMagnussonXA2791e082020-11-12 00:52:08 +010086 start_ric_simulators ricsim_g3 $NUM_RICS STD_2.0.0
87fi
88
BjornMagnussonXA70e878f2020-05-11 14:11:30 +020089start_mr
90
BjornMagnussonXA79e37002021-11-22 13:36:04 +010091start_cr 1
BjornMagnussonXA70e878f2020-05-11 14:11:30 +020092
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010093start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/$CONTROL_PANEL_CONFIG_FILE
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010094
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010095if [ ! -z "$NRT_GATEWAY_APP_NAME" ]; then
96 start_gateway $SIM_GROUP/$NRT_GATEWAY_COMPOSE_DIR/$NRT_GATEWAY_CONFIG_FILE
97fi
98
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +010099start_a1pms NORPOXY $SIM_GROUP/$A1PMS_COMPOSE_DIR/$A1PMS_CONFIG_FILE
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100100
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200101prepare_consul_config SDNC ".consul_config.json"
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100102
103if [ $RUNMODE == "KUBE" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100104 a1pms_load_config ".consul_config.json"
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100105else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100106 if [[ "$A1PMS_FEATURE_LEVEL" == *"NOCONSUL"* ]]; then
107 a1pms_api_put_configuration 200 ".consul_config.json"
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100108 else
109 start_consul_cbs
110 consul_config_app ".consul_config.json"
111 fi
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100112fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200113
114start_sdnc
115
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200116
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100117a1pms_api_get_status 200
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200118
119echo "Print the interface for group 1 simulators, shall be OSC"
120for ((i=1; i<=$NUM_RICS; i++))
121do
122 sim_print ricsim_g1_$i interface
123done
124
125echo "Print the interface for group 2 simulators, shall be STD"
126for ((i=1; i<=$NUM_RICS; i++))
127do
128 sim_print ricsim_g2_$i interface
129done
130
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100131if [ "$A1PMS_VERSION" == "V2" ]; then
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100132 echo "Print the interface for group 2 simulators, shall be STD 2"
133 for ((i=1; i<=$NUM_RICS; i++))
134 do
135 sim_print ricsim_g3_$i interface
136 done
137fi
138
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200139echo "Load policy type in group 1 simulators"
140for ((i=1; i<=$NUM_RICS; i++))
141do
142 sim_put_policy_type 201 ricsim_g1_$i 1 testdata/OSC/sim_1.json
143done
144
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100145if [ "$A1PMS_VERSION" == "V2" ]; then
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100146 echo "Load policy type in group 3 simulators"
147 for ((i=1; i<=$NUM_RICS; i++))
148 do
149 sim_put_policy_type 201 ricsim_g3_$i STD_QOS2_0.1.0 testdata/STD2/sim_qos2.json
150 done
151fi
152
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200153echo "Check the number of instances in group 1 simulators, shall be 0"
154for ((i=1; i<=$NUM_RICS; i++))
155do
156 sim_equal ricsim_g1_$i num_instances 0
157done
158
159echo "Check the number of instances in group 2 simulators, shall be 0"
160for ((i=1; i<=$NUM_RICS; i++))
161do
162 sim_equal ricsim_g2_$i num_instances 0
163done
164
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100165if [ "$A1PMS_VERSION" == "V2" ]; then
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100166 echo "Check the number of instances in group 3 simulators, shall be 0"
167 for ((i=1; i<=$NUM_RICS; i++))
168 do
169 sim_equal ricsim_g3_$i num_instances 0
170 done
171fi
172
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100173echo "Wait for the a1pms to refresh types from the simulator"
174if [ "$A1PMS_VERSION" == "V2" ]; then
175 a1pms_equal json:policy-types 3 300
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100176else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100177 a1pms_equal json:policy_types 2 300
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100178fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200179
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100180echo "Check the number of types in the a1pms for each ric is 1"
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200181for ((i=1; i<=$NUM_RICS; i++))
182do
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100183 if [ "$A1PMS_VERSION" == "V2" ]; then
184 a1pms_equal json:policy-types?ric_id=ricsim_g1_$i 1 120
185 a1pms_equal json:policy-types?ric_id=ricsim_g3_$i 1 120
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100186 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100187 a1pms_equal json:policy_types?ric=ricsim_g1_$i 1 120
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100188 fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200189done
190
191echo "Register a service"
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100192a1pms_api_put_service 201 "serv1" 0 "$CR_SERVICE_APP_PATH_0/1"
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200193
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200194TEST_DURATION=$((24*3600*$DAYS))
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200195TEST_START=$SECONDS
196
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100197A1PMS_INTERFACES="REST REST_PARALLEL DMAAP DMAAP-BATCH"
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200198
199MR_MESSAGES=0
200
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100201if [ "$A1PMS_VERSION" == "V2" ]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100202 notificationurl=$CR_SERVICE_APP_PATH_0"/test"
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100203else
204 notificationurl=""
205fi
206
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200207while [ $(($SECONDS-$TEST_START)) -lt $TEST_DURATION ]; do
208
209 echo ""
210 echo "#########################################################################################################"
211 echo -e $BOLD"INFO: Test executed for: "$(($SECONDS-$TEST_START)) "seconds. Target is: "$TEST_DURATION" seconds."$EBOLD
212 echo "#########################################################################################################"
213 echo ""
214
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100215 for interface in $A1PMS_INTERFACES ; do
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200216
217 echo "############################################"
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100218 echo "## Testing using a1pms interface: $interface ##"
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200219 echo "############################################"
220
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200221 if [ $interface == "REST" ] || [ $interface == "REST_PARALLEL" ]; then
BjornMagnussonXA496156d2020-08-10 14:16:24 +0200222 if [ $HTTPX == "HTTP" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100223 use_a1pms_rest_http
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200224 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100225 use_a1pms_rest_https
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200226 fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200227 else
BjornMagnussonXA496156d2020-08-10 14:16:24 +0200228 if [ $HTTPX == "HTTPS" ]; then
229 echo "Using secure ports towards dmaap"
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100230 use_a1pms_dmaap_https
BjornMagnussonXA496156d2020-08-10 14:16:24 +0200231 else
232 echo "Using non-secure ports towards dmaap"
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100233 use_a1pms_dmaap_http
BjornMagnussonXA496156d2020-08-10 14:16:24 +0200234 fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200235 fi
236
237 echo "Create $NUM_INSTANCES instances in each OSC RIC"
238 INSTANCE_ID=200000
239 INSTANCES=0
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200240 if [ $interface == "REST_PARALLEL" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100241 a1pms_api_put_policy_parallel 201 "serv1" ricsim_g1_ $NUM_RICS 1 $INSTANCE_ID NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json $NUM_INSTANCES 3
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200242 fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200243 for ((i=1; i<=$NUM_RICS; i++))
244 do
245 if [ $interface == "DMAAP-BATCH" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100246 a1pms_api_put_policy_batch 201 "serv1" ricsim_g1_$i 1 $INSTANCE_ID NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json $NUM_INSTANCES
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200247 elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100248 a1pms_api_put_policy 201 "serv1" ricsim_g1_$i 1 $INSTANCE_ID NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json $NUM_INSTANCES
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200249 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200250 if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200251 MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES))
252 fi
253 sim_equal ricsim_g1_$i num_instances $NUM_INSTANCES
254 INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES))
255 INSTANCES=$(($INSTANCES+$NUM_INSTANCES))
256 done
257
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100258 if [ "$A1PMS_VERSION" == "V2" ]; then
259 a1pms_equal json:policy-instances $INSTANCES
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100260 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100261 a1pms_equal json:policy_ids $INSTANCES
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100262 fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200263
264 echo "Create $NUM_INSTANCES instances in each STD RIC"
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200265 if [ $interface == "REST_PARALLEL" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100266 a1pms_api_put_policy_parallel 201 "serv1" ricsim_g2_ $NUM_RICS NOTYPE $INSTANCE_ID NOTRANSIENT $notificationurl testdata/STD/pi1_template.json $NUM_INSTANCES 3
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200267 fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200268 for ((i=1; i<=$NUM_RICS; i++))
269 do
270 if [ $interface == "DMAAP-BATCH" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100271 a1pms_api_put_policy_batch 201 "serv1" ricsim_g2_$i NOTYPE $INSTANCE_ID NOTRANSIENT $notificationurl testdata/STD/pi1_template.json $NUM_INSTANCES
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200272 elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100273 a1pms_api_put_policy 201 "serv1" ricsim_g2_$i NOTYPE $INSTANCE_ID NOTRANSIENT $notificationurl testdata/STD/pi1_template.json $NUM_INSTANCES
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200274 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200275 if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200276 MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES))
277 fi
278 sim_equal ricsim_g2_$i num_instances $NUM_INSTANCES
279 INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES))
280 INSTANCES=$(($INSTANCES+$NUM_INSTANCES))
281 done
282
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100283 if [ "$A1PMS_VERSION" == "V2" ]; then
284 a1pms_equal json:policy-instances $INSTANCES
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100285 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100286 a1pms_equal json:policy_ids $INSTANCES
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100287 fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200288
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100289 if [ "$A1PMS_VERSION" == "V2" ]; then
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100290 echo "Create $NUM_INSTANCES instances in each STD 2 RIC"
291 if [ $interface == "REST_PARALLEL" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100292 a1pms_api_put_policy_parallel 201 "serv1" ricsim_g3_ $NUM_RICS STD_QOS2_0.1.0 $INSTANCE_ID NOTRANSIENT $notificationurl testdata/STD2/pi_qos2_template.json $NUM_INSTANCES 3
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100293 fi
294 for ((i=1; i<=$NUM_RICS; i++))
295 do
296 if [ $interface == "DMAAP-BATCH" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100297 a1pms_api_put_policy_batch 201 "serv1" ricsim_g3_$i STD_QOS2_0.1.0 $INSTANCE_ID NOTRANSIENT $notificationurl testdata/STD2/pi_qos2_template.json $NUM_INSTANCES
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100298 elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100299 a1pms_api_put_policy 201 "serv1" ricsim_g3_$i STD_QOS2_0.1.0 $INSTANCE_ID NOTRANSIENT $notificationurl testdata/STD2/pi_qos2_template.json $NUM_INSTANCES
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100300 fi
301 if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then
302 MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES))
303 fi
304 sim_equal ricsim_g3_$i num_instances $NUM_INSTANCES
305 INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES))
306 INSTANCES=$(($INSTANCES+$NUM_INSTANCES))
307 done
308
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100309 if [ "$A1PMS_VERSION" == "V2" ]; then
310 a1pms_equal json:policy-instances $INSTANCES
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100311 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100312 a1pms_equal json:policy_ids $INSTANCES
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100313 fi
314 fi
315
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200316
317 echo "Delete all instances in each OSC RIC"
318
319 INSTANCE_ID=200000
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200320 if [ $interface == "REST_PARALLEL" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100321 a1pms_api_delete_policy_parallel 204 $NUM_RICS $INSTANCE_ID $NUM_INSTANCES 3
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200322 fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200323 for ((i=1; i<=$NUM_RICS; i++))
324 do
325 if [ $interface == "DMAAP-BATCH" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100326 a1pms_api_delete_policy_batch 204 $INSTANCE_ID $NUM_INSTANCES
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200327 elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100328 a1pms_api_delete_policy 204 $INSTANCE_ID $NUM_INSTANCES
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200329 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200330 if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200331 MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES))
332 fi
333 INSTANCES=$(($INSTANCES-$NUM_INSTANCES))
334 sim_equal ricsim_g1_$i num_instances 0
335 INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES))
336 done
337
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100338 if [ "$A1PMS_VERSION" == "V2" ]; then
339 a1pms_equal json:policy-instances $INSTANCES
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100340 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100341 a1pms_equal json:policy_ids $INSTANCES
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100342 fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200343
344 echo "Delete all instances in each STD RIC"
345
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200346 if [ $interface == "REST_PARALLEL" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100347 a1pms_api_delete_policy_parallel 204 $NUM_RICS $INSTANCE_ID $NUM_INSTANCES 3
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200348 fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200349 for ((i=1; i<=$NUM_RICS; i++))
350 do
351 if [ $interface == "DMAAP-BATCH" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100352 a1pms_api_delete_policy_batch 204 $INSTANCE_ID $NUM_INSTANCES
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200353 elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100354 a1pms_api_delete_policy 204 $INSTANCE_ID $NUM_INSTANCES
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200355 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200356 if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200357 MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES))
358 fi
359 INSTANCES=$(($INSTANCES-$NUM_INSTANCES))
360 sim_equal ricsim_g2_$i num_instances 0
361 INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES))
362 done
363
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100364 if [ "$A1PMS_VERSION" == "V2" ]; then
365 a1pms_equal json:policy-instances $INSTANCES
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100366 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100367 a1pms_equal json:policy_ids $INSTANCES
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100368 fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200369
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100370 if [ "$A1PMS_VERSION" == "V2" ]; then
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100371 echo "Delete all instances in each STD 2 RIC"
372
373 if [ $interface == "REST_PARALLEL" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100374 a1pms_api_delete_policy_parallel 204 $NUM_RICS $INSTANCE_ID $NUM_INSTANCES 3
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100375 fi
376 for ((i=1; i<=$NUM_RICS; i++))
377 do
378 if [ $interface == "DMAAP-BATCH" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100379 a1pms_api_delete_policy_batch 204 $INSTANCE_ID $NUM_INSTANCES
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100380 elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100381 a1pms_api_delete_policy 204 $INSTANCE_ID $NUM_INSTANCES
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100382 fi
383 if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then
384 MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES))
385 fi
386 INSTANCES=$(($INSTANCES-$NUM_INSTANCES))
387 sim_equal ricsim_g3_$i num_instances 0
388 INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES))
389 done
390
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100391 if [ "$A1PMS_VERSION" == "V2" ]; then
392 a1pms_equal json:policy-instances $INSTANCES
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100393 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100394 a1pms_equal json:policy_ids $INSTANCES
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100395 fi
396 fi
397
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200398 mr_equal requests_submitted $MR_MESSAGES
399 mr_equal requests_fetched $MR_MESSAGES
400 mr_equal responses_submitted $MR_MESSAGES
401 mr_equal responses_fetched $MR_MESSAGES
402 mr_equal current_requests 0
403 mr_equal current_responses 0
404
405
406 for ((i=1; i<=$NUM_RICS; i++))
407 do
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100408 sim_contains_str ricsim_g1_$i remote_hosts $SDNC_APP_NAME
409 sim_contains_str ricsim_g2_$i remote_hosts $SDNC_APP_NAME
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100410
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100411 if [ "$A1PMS_VERSION" == "V2" ]; then
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100412 sim_contains_str ricsim_g3_$i remote_hosts $SDNC_APP_NAME
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100413 fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200414 done
415
416 done
417
418done
419
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100420check_a1pms_logs
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100421check_sdnc_logs
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200422
423#### TEST COMPLETE ####
424
425store_logs END
426
427print_result
428
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100429auto_clean_environment