blob: a92106ee9bc8d224f01e23ff2d43fda8df6a1cb3 [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
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020020TC_ONELINE_DESCR="Repeatedly create and delete policies in each RICs for 24h (or configured number of days). Via agent REST/DMAAP/DMAAP_BATCH and SDNC using http or https"
21
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010022#App names to include in the test when running docker, space separated list
23DOCKER_INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC"
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
26KUBE_INCLUDED_IMAGES="CP CR MR PA RICSIM SDNC"
27#Prestarted app (not started by script) to include in the test when running kubernetes, space separated list
28KUBE_PRESTARTED_IMAGES=""
29
30#Supported test environment profiles
BjornMagnussonXA89b64ab2020-12-16 09:21:01 +010031SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ORAN-CHERRY ORAN-DAWN"
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010032#Supported run modes
33SUPPORTED_RUNMODES="DOCKER KUBE"
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +010034
BjornMagnussonXA70e878f2020-05-11 14:11:30 +020035. ../common/testcase_common.sh $@
36. ../common/agent_api_functions.sh
37. ../common/ricsimulator_api_functions.sh
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +010038. ../common/cr_api_functions.sh
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010039. ../common/mr_api_functions.sh
40. ../common/control_panel_api_functions.sh
41. ../common/controller_api_functions.sh
BjornMagnussonXA70e878f2020-05-11 14:11:30 +020042
43#### TEST BEGIN ####
44
BjornMagnussonXAad047782020-06-08 15:54:11 +020045generate_uuid
46
BjornMagnussonXA70e878f2020-05-11 14:11:30 +020047#Local vars in test script
48##########################
BjornMagnussonXA496156d2020-08-10 14:16:24 +020049
BjornMagnussonXA70e878f2020-05-11 14:11:30 +020050# Number of RICs per interface type (OSC and STD)
51NUM_RICS=30
BjornMagnussonXA2791e082020-11-12 00:52:08 +010052if [ "$PMS_VERSION" == "V2" ]; then
53 NUM_RICS=20 # 3 A1 interfaces test, less sims per interface. total sims will be same
54fi
55
BjornMagnussonXA70e878f2020-05-11 14:11:30 +020056# Number of policy instances per RIC
57NUM_INSTANCES=5
58
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020059DAYS=3
60
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010061clean_environment
BjornMagnussonXA70e878f2020-05-11 14:11:30 +020062
BjornMagnussonXA496156d2020-08-10 14:16:24 +020063# use HTTP or HTTPS for all apis
64HTTPX=HTTPS
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020065
BjornMagnussonXA496156d2020-08-10 14:16:24 +020066if [ $HTTPX == "HTTP" ]; then
BjornMagnussonXA496156d2020-08-10 14:16:24 +020067 use_cr_http
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020068 use_agent_rest_http
69 use_sdnc_http
70 use_simulator_http
71else
BjornMagnussonXA496156d2020-08-10 14:16:24 +020072 use_cr_https
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020073 use_agent_rest_https
74 use_sdnc_https
75 use_simulator_https
76fi
77
BjornMagnussonXA70e878f2020-05-11 14:11:30 +020078start_ric_simulators ricsim_g1 $NUM_RICS OSC_2.1.0
79
80start_ric_simulators ricsim_g2 $NUM_RICS STD_1.1.3
81
BjornMagnussonXA2791e082020-11-12 00:52:08 +010082if [ "$PMS_VERSION" == "V2" ]; then
83 start_ric_simulators ricsim_g3 $NUM_RICS STD_2.0.0
84fi
85
BjornMagnussonXA70e878f2020-05-11 14:11:30 +020086start_mr
87
88start_cr
89
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010090start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/application.properties
91
92start_policy_agent NORPOXY $SIM_GROUP/$POLICY_AGENT_COMPOSE_DIR/application.yaml
93
94if [ $RUNMODE == "DOCKER" ]; then
95 start_consul_cbs
96fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +020097
98prepare_consul_config SDNC ".consul_config.json"
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010099
100if [ $RUNMODE == "KUBE" ]; then
101 agent_load_config ".consul_config.json"
102else
103 consul_config_app ".consul_config.json"
104fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200105
106start_sdnc
107
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200108
109api_get_status 200
110
111echo "Print the interface for group 1 simulators, shall be OSC"
112for ((i=1; i<=$NUM_RICS; i++))
113do
114 sim_print ricsim_g1_$i interface
115done
116
117echo "Print the interface for group 2 simulators, shall be STD"
118for ((i=1; i<=$NUM_RICS; i++))
119do
120 sim_print ricsim_g2_$i interface
121done
122
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100123if [ "$PMS_VERSION" == "V2" ]; then
124 echo "Print the interface for group 2 simulators, shall be STD 2"
125 for ((i=1; i<=$NUM_RICS; i++))
126 do
127 sim_print ricsim_g3_$i interface
128 done
129fi
130
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200131echo "Load policy type in group 1 simulators"
132for ((i=1; i<=$NUM_RICS; i++))
133do
134 sim_put_policy_type 201 ricsim_g1_$i 1 testdata/OSC/sim_1.json
135done
136
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100137if [ "$PMS_VERSION" == "V2" ]; then
138 echo "Load policy type in group 3 simulators"
139 for ((i=1; i<=$NUM_RICS; i++))
140 do
141 sim_put_policy_type 201 ricsim_g3_$i STD_QOS2_0.1.0 testdata/STD2/sim_qos2.json
142 done
143fi
144
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200145echo "Check the number of instances in group 1 simulators, shall be 0"
146for ((i=1; i<=$NUM_RICS; i++))
147do
148 sim_equal ricsim_g1_$i num_instances 0
149done
150
151echo "Check the number of instances in group 2 simulators, shall be 0"
152for ((i=1; i<=$NUM_RICS; i++))
153do
154 sim_equal ricsim_g2_$i num_instances 0
155done
156
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100157if [ "$PMS_VERSION" == "V2" ]; then
158 echo "Check the number of instances in group 3 simulators, shall be 0"
159 for ((i=1; i<=$NUM_RICS; i++))
160 do
161 sim_equal ricsim_g3_$i num_instances 0
162 done
163fi
164
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200165echo "Wait for the agent to refresh types from the simulator"
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100166if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100167 api_equal json:policy-types 3 300
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100168else
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100169 api_equal json:policy_types 2 300
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100170fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200171
172echo "Check the number of types in the agent for each ric is 1"
173for ((i=1; i<=$NUM_RICS; i++))
174do
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100175 if [ "$PMS_VERSION" == "V2" ]; then
176 api_equal json:policy-types?ric_id=ricsim_g1_$i 1 120
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100177 api_equal json:policy-types?ric_id=ricsim_g3_$i 1 120
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100178 else
179 api_equal json:policy_types?ric=ricsim_g1_$i 1 120
180 fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200181done
182
183echo "Register a service"
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100184api_put_service 201 "serv1" 0 "$CR_SERVICE_PATH/1"
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200185
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200186TEST_DURATION=$((24*3600*$DAYS))
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200187TEST_START=$SECONDS
188
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200189AGENT_INTERFACES="REST REST_PARALLEL DMAAP DMAAP-BATCH"
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200190
191MR_MESSAGES=0
192
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100193if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100194 notificationurl=$CR_SERVICE_PATH"/test"
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100195else
196 notificationurl=""
197fi
198
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
207 for interface in $AGENT_INTERFACES ; do
208
209 echo "############################################"
210 echo "## Testing using agent interface: $interface ##"
211 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
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200215 use_agent_rest_http
216 else
217 use_agent_rest_https
218 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"
222 use_agent_dmaap_https
223 else
224 echo "Using non-secure ports towards dmaap"
225 use_agent_dmaap_http
226 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
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100233 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
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100238 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
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100240 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
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100250 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100251 api_equal json:policy-instances $INSTANCES
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100252 else
253 api_equal json:policy_ids $INSTANCES
254 fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200255
256 echo "Create $NUM_INSTANCES instances in each STD RIC"
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200257 if [ $interface == "REST_PARALLEL" ]; then
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100258 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 +0200259 fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200260 for ((i=1; i<=$NUM_RICS; i++))
261 do
262 if [ $interface == "DMAAP-BATCH" ]; then
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100263 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 +0200264 elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100265 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 +0200266 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200267 if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200268 MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES))
269 fi
270 sim_equal ricsim_g2_$i num_instances $NUM_INSTANCES
271 INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES))
272 INSTANCES=$(($INSTANCES+$NUM_INSTANCES))
273 done
274
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100275 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100276 api_equal json:policy-instances $INSTANCES
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100277 else
278 api_equal json:policy_ids $INSTANCES
279 fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200280
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100281 if [ "$PMS_VERSION" == "V2" ]; then
282 echo "Create $NUM_INSTANCES instances in each STD 2 RIC"
283 if [ $interface == "REST_PARALLEL" ]; then
284 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
285 fi
286 for ((i=1; i<=$NUM_RICS; i++))
287 do
288 if [ $interface == "DMAAP-BATCH" ]; then
289 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
290 elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then
291 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
292 fi
293 if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then
294 MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES))
295 fi
296 sim_equal ricsim_g3_$i num_instances $NUM_INSTANCES
297 INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES))
298 INSTANCES=$(($INSTANCES+$NUM_INSTANCES))
299 done
300
301 if [ "$PMS_VERSION" == "V2" ]; then
302 api_equal json:policy-instances $INSTANCES
303 else
304 api_equal json:policy_ids $INSTANCES
305 fi
306 fi
307
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200308
309 echo "Delete all instances in each OSC RIC"
310
311 INSTANCE_ID=200000
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200312 if [ $interface == "REST_PARALLEL" ]; then
313 api_delete_policy_parallel 204 $NUM_RICS $INSTANCE_ID $NUM_INSTANCES 3
314 fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200315 for ((i=1; i<=$NUM_RICS; i++))
316 do
317 if [ $interface == "DMAAP-BATCH" ]; then
318 api_delete_policy_batch 204 $INSTANCE_ID $NUM_INSTANCES
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200319 elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200320 api_delete_policy 204 $INSTANCE_ID $NUM_INSTANCES
321 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200322 if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200323 MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES))
324 fi
325 INSTANCES=$(($INSTANCES-$NUM_INSTANCES))
326 sim_equal ricsim_g1_$i num_instances 0
327 INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES))
328 done
329
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100330 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100331 api_equal json:policy-instances $INSTANCES
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100332 else
333 api_equal json:policy_ids $INSTANCES
334 fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200335
336 echo "Delete all instances in each STD RIC"
337
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200338 if [ $interface == "REST_PARALLEL" ]; then
339 api_delete_policy_parallel 204 $NUM_RICS $INSTANCE_ID $NUM_INSTANCES 3
340 fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200341 for ((i=1; i<=$NUM_RICS; i++))
342 do
343 if [ $interface == "DMAAP-BATCH" ]; then
344 api_delete_policy_batch 204 $INSTANCE_ID $NUM_INSTANCES
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200345 elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200346 api_delete_policy 204 $INSTANCE_ID $NUM_INSTANCES
347 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200348 if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200349 MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES))
350 fi
351 INSTANCES=$(($INSTANCES-$NUM_INSTANCES))
352 sim_equal ricsim_g2_$i num_instances 0
353 INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES))
354 done
355
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100356 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100357 api_equal json:policy-instances $INSTANCES
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100358 else
359 api_equal json:policy_ids $INSTANCES
360 fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200361
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100362 if [ "$PMS_VERSION" == "V2" ]; then
363 echo "Delete all instances in each STD 2 RIC"
364
365 if [ $interface == "REST_PARALLEL" ]; then
366 api_delete_policy_parallel 204 $NUM_RICS $INSTANCE_ID $NUM_INSTANCES 3
367 fi
368 for ((i=1; i<=$NUM_RICS; i++))
369 do
370 if [ $interface == "DMAAP-BATCH" ]; then
371 api_delete_policy_batch 204 $INSTANCE_ID $NUM_INSTANCES
372 elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then
373 api_delete_policy 204 $INSTANCE_ID $NUM_INSTANCES
374 fi
375 if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then
376 MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES))
377 fi
378 INSTANCES=$(($INSTANCES-$NUM_INSTANCES))
379 sim_equal ricsim_g3_$i num_instances 0
380 INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES))
381 done
382
383 if [ "$PMS_VERSION" == "V2" ]; then
384 api_equal json:policy-instances $INSTANCES
385 else
386 api_equal json:policy_ids $INSTANCES
387 fi
388 fi
389
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200390 mr_equal requests_submitted $MR_MESSAGES
391 mr_equal requests_fetched $MR_MESSAGES
392 mr_equal responses_submitted $MR_MESSAGES
393 mr_equal responses_fetched $MR_MESSAGES
394 mr_equal current_requests 0
395 mr_equal current_responses 0
396
397
398 for ((i=1; i<=$NUM_RICS; i++))
399 do
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100400 sim_contains_str ricsim_g1_$i remote_hosts $SDNC_APP_NAME
401 sim_contains_str ricsim_g2_$i remote_hosts $SDNC_APP_NAME
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100402
403 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100404 sim_contains_str ricsim_g3_$i remote_hosts $SDNC_APP_NAME
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100405 fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200406 done
407
408 done
409
410done
411
412check_policy_agent_logs
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100413check_sdnc_logs
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200414
415#### TEST COMPLETE ####
416
417store_logs END
418
419print_result
420
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100421auto_clean_environment