blob: 2d0430d42e5c1ab0b336f9ba128d1e476dd38ad0 [file] [log] [blame]
BjornMagnussonXA70e878f2020-05-11 14:11:30 +02001#!/bin/bash
2
3# ============LICENSE_START===============================================
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +02004# Copyright (C) 2020-2023 Nordix Foundation. All rights reserved.
rohithrajneesh927c17e2023-12-01 14:26:03 +00005# Copyright (C) 2023 OpenInfra Foundation Europe. All rights reserved.
BjornMagnussonXA70e878f2020-05-11 14:11:30 +02006# ========================================================================
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
10#
11# http://www.apache.org/licenses/LICENSE-2.0
12#
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=================================================
19#
20
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +020021TC_ONELINE_DESCR="Repeatedly create and delete policies in each RICs for 24h (or configured number of days). Via a1pms REST and with SDNC using http or https"
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020022
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010023#App names to include in the test when running docker, space separated list
BjornMagnussonXAf83c3622023-02-28 10:05:51 +010024DOCKER_INCLUDED_IMAGES="CP CR MR A1PMS RICSIM SDNC NGW KUBEPROXY"
BjornMagnussonXA70e878f2020-05-11 14:11:30 +020025
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010026#App names to include in the test when running kubernetes, space separated list
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +010027KUBE_INCLUDED_IMAGES="CP CR MR A1PMS RICSIM SDNC KUBEPROXY NGW"
BjornMagnussonXAd54225b2023-04-19 14:03:49 +020028#Pre-started app (not started by script) to include in the test when running kubernetes, space separated list
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010029KUBE_PRESTARTED_IMAGES=""
30
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010031#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
BjornMagnussonXAf83c3622023-02-28 10:05:51 +010034CONDITIONALLY_IGNORED_IMAGES="NGW"
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010035
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010036#Supported test environment profiles
rohithrajneesh927c17e2023-12-01 14:26:03 +000037SUPPORTED_PROFILES="ONAP-KOHN ONAP-LONDON ONAP-MONTREAL ORAN-G-RELEASE ORAN-H-RELEASE ORAN-I-RELEASE"
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010038#Supported run modes
39SUPPORTED_RUNMODES="DOCKER KUBE"
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +010040
BjornMagnussonXA79e37002021-11-22 13:36:04 +010041. ../common/testcase_common.sh $@
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010042
43setup_testenvironment
BjornMagnussonXA70e878f2020-05-11 14:11:30 +020044
45#### TEST BEGIN ####
46
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +020047sim_generate_policy_uuid
BjornMagnussonXAad047782020-06-08 15:54:11 +020048
BjornMagnussonXA70e878f2020-05-11 14:11:30 +020049#Local vars in test script
50##########################
BjornMagnussonXA496156d2020-08-10 14:16:24 +020051
BjornMagnussonXAf83c3622023-02-28 10:05:51 +010052# Number of RICs per interface type (OSC and STD x 2)
53NUM_RICS=20
BjornMagnussonXA2791e082020-11-12 00:52:08 +010054
BjornMagnussonXA70e878f2020-05-11 14:11:30 +020055# Number of policy instances per RIC
56NUM_INSTANCES=5
57
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020058DAYS=3
59
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010060clean_environment
BjornMagnussonXA70e878f2020-05-11 14:11:30 +020061
BjornMagnussonXA663566c2021-11-08 10:25:07 +010062start_kube_proxy
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010063
BjornMagnussonXA496156d2020-08-10 14:16:24 +020064# use HTTP or HTTPS for all apis
65HTTPX=HTTPS
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020066
BjornMagnussonXA496156d2020-08-10 14:16:24 +020067if [ $HTTPX == "HTTP" ]; then
BjornMagnussonXA496156d2020-08-10 14:16:24 +020068 use_cr_http
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +010069 use_a1pms_rest_http
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020070 use_sdnc_http
71 use_simulator_http
72else
BjornMagnussonXA496156d2020-08-10 14:16:24 +020073 use_cr_https
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +010074 use_a1pms_rest_https
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +020075 if [[ "$SDNC_FEATURE_LEVEL" == *"NO_NB_HTTPS"* ]]; then
76 deviation "SDNC does not support NB https"
77 use_sdnc_http
78 else
79 use_sdnc_https
80 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020081 use_simulator_https
82fi
83
BjornMagnussonXA70e878f2020-05-11 14:11:30 +020084start_ric_simulators ricsim_g1 $NUM_RICS OSC_2.1.0
85
86start_ric_simulators ricsim_g2 $NUM_RICS STD_1.1.3
87
BjornMagnussonXAf83c3622023-02-28 10:05:51 +010088start_ric_simulators ricsim_g3 $NUM_RICS STD_2.0.0
BjornMagnussonXA2791e082020-11-12 00:52:08 +010089
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +020090if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
91 :
92else
93 start_mr
94fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +020095
BjornMagnussonXA79e37002021-11-22 13:36:04 +010096start_cr 1
BjornMagnussonXA70e878f2020-05-11 14:11:30 +020097
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010098start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/$CONTROL_PANEL_CONFIG_FILE
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010099
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +0100100if [ ! -z "$NRT_GATEWAY_APP_NAME" ]; then
101 start_gateway $SIM_GROUP/$NRT_GATEWAY_COMPOSE_DIR/$NRT_GATEWAY_CONFIG_FILE
102fi
103
BjornMagnussonXAf4a7e422022-09-01 16:35:17 +0200104A1PMS_RETRY_CODES=423
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100105start_a1pms NORPOXY $SIM_GROUP/$A1PMS_COMPOSE_DIR/$A1PMS_CONFIG_FILE
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100106
BjornMagnussonXAf81090f2022-08-24 09:17:44 +0200107
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100108
109prepare_a1pms_config SDNC ".a1pms_config.json"
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100110
111if [ $RUNMODE == "KUBE" ]; then
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100112 a1pms_load_config ".a1pms_config.json"
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100113else
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100114 a1pms_api_put_configuration 200 ".a1pms_config.json"
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100115fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200116
117start_sdnc
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200118controller_api_wait_for_status_ok 200 ricsim_g1_1
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200119
BjornMagnussonXAd54225b2023-04-19 14:03:49 +0200120sleep_wait 120 "Let A1PMS configuration take effect"
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200121
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100122a1pms_api_get_status 200
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200123
124echo "Print the interface for group 1 simulators, shall be OSC"
125for ((i=1; i<=$NUM_RICS; i++))
126do
127 sim_print ricsim_g1_$i interface
128done
129
130echo "Print the interface for group 2 simulators, shall be STD"
131for ((i=1; i<=$NUM_RICS; i++))
132do
133 sim_print ricsim_g2_$i interface
134done
135
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100136echo "Print the interface for group 2 simulators, shall be STD 2"
137for ((i=1; i<=$NUM_RICS; i++))
138do
139 sim_print ricsim_g3_$i interface
140done
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100141
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200142echo "Load policy type in group 1 simulators"
143for ((i=1; i<=$NUM_RICS; i++))
144do
145 sim_put_policy_type 201 ricsim_g1_$i 1 testdata/OSC/sim_1.json
146done
147
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100148echo "Load policy type in group 3 simulators"
149for ((i=1; i<=$NUM_RICS; i++))
150do
151 sim_put_policy_type 201 ricsim_g3_$i STD_QOS2_0.1.0 testdata/STD2/sim_qos2.json
152done
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100153
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200154echo "Check the number of instances in group 1 simulators, shall be 0"
155for ((i=1; i<=$NUM_RICS; i++))
156do
157 sim_equal ricsim_g1_$i num_instances 0
158done
159
160echo "Check the number of instances in group 2 simulators, shall be 0"
161for ((i=1; i<=$NUM_RICS; i++))
162do
163 sim_equal ricsim_g2_$i num_instances 0
164done
165
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100166echo "Check the number of instances in group 3 simulators, shall be 0"
167for ((i=1; i<=$NUM_RICS; i++))
168do
169 sim_equal ricsim_g3_$i num_instances 0
170done
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100171
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100172echo "Wait for the a1pms to refresh types from the simulator"
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100173a1pms_equal json:policy-types 3 300
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200174
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100175echo "Check the number of types in the a1pms for each ric is 1"
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200176for ((i=1; i<=$NUM_RICS; i++))
177do
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100178 a1pms_equal json:policy-types?ric_id=ricsim_g1_$i 1 120
179 a1pms_equal json:policy-types?ric_id=ricsim_g3_$i 1 120
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200180done
181
182echo "Register a service"
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100183a1pms_api_put_service 201 "serv1" 0 "$CR_SERVICE_APP_PATH_0/1"
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200184
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200185TEST_DURATION=$((24*3600*$DAYS))
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200186
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200187TEST_START=$SECONDS
188
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200189if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
190 A1PMS_INTERFACES="REST REST_PARALLEL"
191else
192 A1PMS_INTERFACES="REST REST_PARALLEL DMAAP DMAAP-BATCH"
193fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200194
195MR_MESSAGES=0
196
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100197notificationurl=$CR_SERVICE_APP_PATH_0"/test"
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100198
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200199while [ $(($SECONDS-$TEST_START)) -lt $TEST_DURATION ]; do
200
201 echo ""
202 echo "#########################################################################################################"
203 echo -e $BOLD"INFO: Test executed for: "$(($SECONDS-$TEST_START)) "seconds. Target is: "$TEST_DURATION" seconds."$EBOLD
204 echo "#########################################################################################################"
205 echo ""
206
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100207 for interface in $A1PMS_INTERFACES ; do
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200208
209 echo "############################################"
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100210 echo "## Testing using a1pms interface: $interface ##"
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200211 echo "############################################"
212
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200213 if [ $interface == "REST" ] || [ $interface == "REST_PARALLEL" ]; then
BjornMagnussonXA496156d2020-08-10 14:16:24 +0200214 if [ $HTTPX == "HTTP" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100215 use_a1pms_rest_http
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200216 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100217 use_a1pms_rest_https
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200218 fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200219 else
BjornMagnussonXA496156d2020-08-10 14:16:24 +0200220 if [ $HTTPX == "HTTPS" ]; then
221 echo "Using secure ports towards dmaap"
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100222 use_a1pms_dmaap_https
BjornMagnussonXA496156d2020-08-10 14:16:24 +0200223 else
224 echo "Using non-secure ports towards dmaap"
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100225 use_a1pms_dmaap_http
BjornMagnussonXA496156d2020-08-10 14:16:24 +0200226 fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200227 fi
228
229 echo "Create $NUM_INSTANCES instances in each OSC RIC"
230 INSTANCE_ID=200000
231 INSTANCES=0
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200232 if [ $interface == "REST_PARALLEL" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100233 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 +0200234 fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200235 for ((i=1; i<=$NUM_RICS; i++))
236 do
237 if [ $interface == "DMAAP-BATCH" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100238 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 +0200239 elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100240 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 +0200241 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200242 if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200243 MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES))
244 fi
245 sim_equal ricsim_g1_$i num_instances $NUM_INSTANCES
246 INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES))
247 INSTANCES=$(($INSTANCES+$NUM_INSTANCES))
248 done
249
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100250 a1pms_equal json:policy-instances $INSTANCES
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200251
252 echo "Create $NUM_INSTANCES instances in each STD RIC"
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200253 if [ $interface == "REST_PARALLEL" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100254 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 +0200255 fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200256 for ((i=1; i<=$NUM_RICS; i++))
257 do
258 if [ $interface == "DMAAP-BATCH" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100259 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 +0200260 elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100261 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 +0200262 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200263 if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200264 MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES))
265 fi
266 sim_equal ricsim_g2_$i num_instances $NUM_INSTANCES
267 INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES))
268 INSTANCES=$(($INSTANCES+$NUM_INSTANCES))
269 done
270
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100271 a1pms_equal json:policy-instances $INSTANCES
272
273 echo "Create $NUM_INSTANCES instances in each STD 2 RIC"
274 if [ $interface == "REST_PARALLEL" ]; then
275 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
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100276 fi
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100277 for ((i=1; i<=$NUM_RICS; i++))
278 do
279 if [ $interface == "DMAAP-BATCH" ]; then
280 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
281 elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then
282 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 +0100283 fi
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100284 if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then
285 MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES))
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100286 fi
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100287 sim_equal ricsim_g3_$i num_instances $NUM_INSTANCES
288 INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES))
289 INSTANCES=$(($INSTANCES+$NUM_INSTANCES))
290 done
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100291
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100292 a1pms_equal json:policy-instances $INSTANCES
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200293
294 echo "Delete all instances in each OSC RIC"
295
296 INSTANCE_ID=200000
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200297 if [ $interface == "REST_PARALLEL" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100298 a1pms_api_delete_policy_parallel 204 $NUM_RICS $INSTANCE_ID $NUM_INSTANCES 3
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200299 fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200300 for ((i=1; i<=$NUM_RICS; i++))
301 do
302 if [ $interface == "DMAAP-BATCH" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100303 a1pms_api_delete_policy_batch 204 $INSTANCE_ID $NUM_INSTANCES
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200304 elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100305 a1pms_api_delete_policy 204 $INSTANCE_ID $NUM_INSTANCES
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200306 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200307 if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200308 MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES))
309 fi
310 INSTANCES=$(($INSTANCES-$NUM_INSTANCES))
311 sim_equal ricsim_g1_$i num_instances 0
312 INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES))
313 done
314
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100315 a1pms_equal json:policy-instances $INSTANCES
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200316
317 echo "Delete all instances in each STD RIC"
318
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200319 if [ $interface == "REST_PARALLEL" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100320 a1pms_api_delete_policy_parallel 204 $NUM_RICS $INSTANCE_ID $NUM_INSTANCES 3
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200321 fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200322 for ((i=1; i<=$NUM_RICS; i++))
323 do
324 if [ $interface == "DMAAP-BATCH" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100325 a1pms_api_delete_policy_batch 204 $INSTANCE_ID $NUM_INSTANCES
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200326 elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100327 a1pms_api_delete_policy 204 $INSTANCE_ID $NUM_INSTANCES
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200328 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200329 if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200330 MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES))
331 fi
332 INSTANCES=$(($INSTANCES-$NUM_INSTANCES))
333 sim_equal ricsim_g2_$i num_instances 0
334 INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES))
335 done
336
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100337 a1pms_equal json:policy-instances $INSTANCES
338
339 echo "Delete all instances in each STD 2 RIC"
340
341 if [ $interface == "REST_PARALLEL" ]; then
342 a1pms_api_delete_policy_parallel 204 $NUM_RICS $INSTANCE_ID $NUM_INSTANCES 3
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100343 fi
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100344 for ((i=1; i<=$NUM_RICS; i++))
345 do
346 if [ $interface == "DMAAP-BATCH" ]; then
347 a1pms_api_delete_policy_batch 204 $INSTANCE_ID $NUM_INSTANCES
348 elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then
349 a1pms_api_delete_policy 204 $INSTANCE_ID $NUM_INSTANCES
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100350 fi
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100351 if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then
352 MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES))
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100353 fi
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100354 INSTANCES=$(($INSTANCES-$NUM_INSTANCES))
355 sim_equal ricsim_g3_$i num_instances 0
356 INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES))
357 done
358
359 a1pms_equal json:policy-instances $INSTANCES
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100360
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200361 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
362 :
363 else
364 mr_equal requests_submitted $MR_MESSAGES
365 mr_equal requests_fetched $MR_MESSAGES
366 mr_equal responses_submitted $MR_MESSAGES
367 mr_equal responses_fetched $MR_MESSAGES
368 mr_equal current_requests 0
369 mr_equal current_responses 0
370 fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200371
372
373 for ((i=1; i<=$NUM_RICS; i++))
374 do
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100375 sim_contains_str ricsim_g1_$i remote_hosts $SDNC_APP_NAME
376 sim_contains_str ricsim_g2_$i remote_hosts $SDNC_APP_NAME
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100377
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100378 sim_contains_str ricsim_g3_$i remote_hosts $SDNC_APP_NAME
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200379 done
380
381 done
382
383done
384
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100385check_a1pms_logs
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100386check_sdnc_logs
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200387
388#### TEST COMPLETE ####
389
390store_logs END
391
392print_result
393
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100394auto_clean_environment