blob: 6cb6b882907e7c08950c0a358e92903c144c014e [file] [log] [blame]
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +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
20TC_ONELINE_DESCR="Change supported policy types and reconfigure rics"
21
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010022#App names to include in the test when running docker, space separated list
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010023DOCKER_INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC NGW"
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020024
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010025#App names to include in the test when running kubernetes, space separated list
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010026KUBE_INCLUDED_IMAGES="CP CR MR PA 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
30#Supported test environment profiles
BjornMagnussonXAfec823b2021-08-03 14:14:05 +020031SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-D-RELEASE ORAN-E-RELEASE"
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010032#Supported run modes
33SUPPORTED_RUNMODES="DOCKER KUBE"
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +010034
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020035. ../common/testcase_common.sh $@
36. ../common/agent_api_functions.sh
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010037. ../common/consul_cbs_functions.sh
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020038. ../common/ricsimulator_api_functions.sh
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +010039. ../common/cr_api_functions.sh
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010040. ../common/mr_api_functions.sh
41. ../common/control_panel_api_functions.sh
42. ../common/controller_api_functions.sh
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010043. ../common/kube_proxy_api_functions.sh
BjornMagnussonXA674793d2021-05-06 19:49:17 +020044. ../common/gateway_api_functions.sh
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010045
46setup_testenvironment
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020047
48#### TEST BEGIN ####
49
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010050generate_policy_uuid
BjornMagnussonXAad047782020-06-08 15:54:11 +020051
BjornMagnussonXA496156d2020-08-10 14:16:24 +020052use_cr_http
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020053
54NUM_RICS=10
55NUM_RICS_2=$(($NUM_RICS-2))
56
57# Tested variants of REST/SDNC config
58TESTED_VARIANTS="REST REST+SDNC"
59
60for interface in $TESTED_VARIANTS ; do
61
62 echo "#####################################################################"
63 echo "#####################################################################"
64 echo "### Testing agent: "$interface
65 echo "#####################################################################"
66 echo "#####################################################################"
67
68
69 # Clean container and start all needed containers #
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010070 clean_environment
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020071
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010072 if [ $RUNMODE == "KUBE" ]; then
73 start_kube_proxy
74 fi
75
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020076 #Start simulators and prepare two configs
77
78 start_ric_simulators ricsim_g1 $NUM_RICS_2 OSC_2.1.0
79
80 start_cr
81
82 start_mr
83
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010084 if [ $RUNMODE == "DOCKER" ]; then
85 start_consul_cbs
86 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020087
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +010088 # Create first config
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020089 if [[ $interface = *"SDNC"* ]]; then
90 start_sdnc
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +010091 prepare_consul_config SDNC ".consul_config_initial.json"
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020092 else
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +010093 prepare_consul_config NOSDNC ".consul_config_initial.json"
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020094 fi
95
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020096 # Create 2nd config and save for later
97 start_ric_simulators ricsim_g1 $NUM_RICS OSC_2.1.0
98
99 if [[ $interface = *"SDNC"* ]]; then
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200100 prepare_consul_config SDNC ".consul_config_all.json"
101 else
102 prepare_consul_config NOSDNC ".consul_config_all.json"
103 fi
104
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +0100105 start_policy_agent NORPOXY $SIM_GROUP/$POLICY_AGENT_COMPOSE_DIR/$POLICY_AGENT_CONFIG_FILE
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200106
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200107 set_agent_trace
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200108
109 api_get_status 200
110
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100111 # Create service to be able to receive events when rics becomes available
112 # Must use rest towards the agent since dmaap is not configured yet
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100113 api_put_service 201 "ric-registration" 0 "$CR_SERVICE_PATH/ric-registration"
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100114
115 #Load first config
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100116 if [ $RUNMODE == "KUBE" ]; then
117 agent_load_config ".consul_config_initial.json"
118 else
119 consul_config_app ".consul_config_initial.json"
120 fi
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100121
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200122 for ((i=1; i<=${NUM_RICS}; i++))
123 do
124 sim_print ricsim_g1_$i interface
125 done
126
127 # All sims running but 2 are not configured in consul
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100128 api_equal json:rics 8 300
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200129
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100130 if [ "$PMS_VERSION" == "V2" ]; then
131 cr_equal received_callbacks?id=ric-registration 8 120
132 cr_api_check_all_sync_events 200 ric-registration ricsim_g1_1 ricsim_g1_2 ricsim_g1_3 ricsim_g1_4 ricsim_g1_5 ricsim_g1_6 ricsim_g1_7 ricsim_g1_8
133 fi
134
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200135 api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:NOTYPE:???? \
136 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:NOTYPE:???? \
137 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:NOTYPE:???? \
138 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:NOTYPE:???? \
139 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:NOTYPE:???? \
140 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:NOTYPE:???? \
141 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:NOTYPE:???? \
142 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:NOTYPE:???? "
143
144
145 sim_put_policy_type 201 ricsim_g1_1 1 testdata/OSC/sim_1.json
146 sim_put_policy_type 201 ricsim_g1_2 1 testdata/OSC/sim_1.json
147 sim_put_policy_type 201 ricsim_g1_3 1 testdata/OSC/sim_1.json
148 sim_put_policy_type 201 ricsim_g1_4 1 testdata/OSC/sim_1.json
149 sim_put_policy_type 201 ricsim_g1_5 1 testdata/OSC/sim_1.json
150
151 sim_put_policy_type 201 ricsim_g1_2 2 testdata/OSC/sim_2.json
152 sim_put_policy_type 201 ricsim_g1_3 2 testdata/OSC/sim_2.json
153 sim_put_policy_type 201 ricsim_g1_4 2 testdata/OSC/sim_2.json
154 sim_put_policy_type 201 ricsim_g1_5 2 testdata/OSC/sim_2.json
155 sim_put_policy_type 201 ricsim_g1_6 2 testdata/OSC/sim_2.json
156
157 sim_put_policy_type 201 ricsim_g1_3 3 testdata/OSC/sim_3.json
158 sim_put_policy_type 201 ricsim_g1_4 3 testdata/OSC/sim_3.json
159 sim_put_policy_type 201 ricsim_g1_5 3 testdata/OSC/sim_3.json
160 sim_put_policy_type 201 ricsim_g1_6 3 testdata/OSC/sim_3.json
161 sim_put_policy_type 201 ricsim_g1_7 3 testdata/OSC/sim_3.json
162
163 sim_put_policy_type 201 ricsim_g1_4 4 testdata/OSC/sim_4.json
164 sim_put_policy_type 201 ricsim_g1_5 4 testdata/OSC/sim_4.json
165 sim_put_policy_type 201 ricsim_g1_6 4 testdata/OSC/sim_4.json
166 sim_put_policy_type 201 ricsim_g1_7 4 testdata/OSC/sim_4.json
167 sim_put_policy_type 201 ricsim_g1_8 4 testdata/OSC/sim_4.json
168
169 sim_put_policy_type 201 ricsim_g1_5 5 testdata/OSC/sim_5.json
170 sim_put_policy_type 201 ricsim_g1_6 5 testdata/OSC/sim_5.json
171 sim_put_policy_type 201 ricsim_g1_7 5 testdata/OSC/sim_5.json
172 sim_put_policy_type 201 ricsim_g1_8 5 testdata/OSC/sim_5.json
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200173
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100174 if [ "$PMS_VERSION" == "V2" ]; then
175 api_equal json:policy-types 5 120
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200176
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100177 echo "Check the number of types in the agent for each ric"
178 api_equal json:policy-types?ric_id=ricsim_g1_1 1 120
179 api_equal json:policy-types?ric_id=ricsim_g1_2 2 120
180 api_equal json:policy-types?ric_id=ricsim_g1_3 3 120
181 api_equal json:policy-types?ric_id=ricsim_g1_4 4 120
182 api_equal json:policy-types?ric_id=ricsim_g1_5 5 120
183 api_equal json:policy-types?ric_id=ricsim_g1_6 4 120
184 api_equal json:policy-types?ric_id=ricsim_g1_7 3 120
185 api_equal json:policy-types?ric_id=ricsim_g1_8 2 120
186 else
187 api_equal json:policy_types 5 120
188
189 echo "Check the number of types in the agent for each ric"
190 api_equal json:policy_types?ric=ricsim_g1_1 1 120
191 api_equal json:policy_types?ric=ricsim_g1_2 2 120
192 api_equal json:policy_types?ric=ricsim_g1_3 3 120
193 api_equal json:policy_types?ric=ricsim_g1_4 4 120
194 api_equal json:policy_types?ric=ricsim_g1_5 5 120
195 api_equal json:policy_types?ric=ricsim_g1_6 4 120
196 api_equal json:policy_types?ric=ricsim_g1_7 3 120
197 api_equal json:policy_types?ric=ricsim_g1_8 2 120
198 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200199
200 api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
201 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
202 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \
203 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3,4:???? \
204 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,4,5:???? \
205 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,4,5:???? \
206 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,4,5:???? \
207 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:4,5:???? "
208
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100209 if [ "$PMS_VERSION" == "V2" ]; then
210 cr_equal received_callbacks?id=ric-registration 16 120
211 cr_api_check_all_sync_events 200 ric-registration ricsim_g1_1 ricsim_g1_2 ricsim_g1_3 ricsim_g1_4 ricsim_g1_5 ricsim_g1_6 ricsim_g1_7 ricsim_g1_8
212 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200213
214 #Load config with all rics
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100215 if [ $RUNMODE == "KUBE" ]; then
216 agent_load_config ".consul_config_all.json"
217 else
218 consul_config_app ".consul_config_all.json"
219 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200220
221 api_equal json:rics 10 120
222
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100223 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100224 cr_equal received_callbacks?id=ric-registration 18 120
225 cr_api_check_all_sync_events 200 ric-registration ricsim_g1_9 ricsim_g1_10
226 fi
227
228 sim_put_policy_type 201 ricsim_g1_9 5 testdata/OSC/sim_5.json
229
230 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100231
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200232 api_equal json:policy-types 5 120
233
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100234 echo "Check the number of types in the agent for each ric"
235 api_equal json:policy-types?ric_id=ricsim_g1_1 1 120
236 api_equal json:policy-types?ric_id=ricsim_g1_2 2 120
237 api_equal json:policy-types?ric_id=ricsim_g1_3 3 120
238 api_equal json:policy-types?ric_id=ricsim_g1_4 4 120
239 api_equal json:policy-types?ric_id=ricsim_g1_5 5 120
240 api_equal json:policy-types?ric_id=ricsim_g1_6 4 120
241 api_equal json:policy-types?ric_id=ricsim_g1_7 3 120
242 api_equal json:policy-types?ric_id=ricsim_g1_8 2 120
243 api_equal json:policy-types?ric_id=ricsim_g1_9 1 120
244 api_equal json:policy-types?ric_id=ricsim_g1_10 0 120
245 else
246
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200247 api_equal json:policy_types 5 120
248
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100249 echo "Check the number of types in the agent for each ric"
250 api_equal json:policy_types?ric=ricsim_g1_1 1 120
251 api_equal json:policy_types?ric=ricsim_g1_2 2 120
252 api_equal json:policy_types?ric=ricsim_g1_3 3 120
253 api_equal json:policy_types?ric=ricsim_g1_4 4 120
254 api_equal json:policy_types?ric=ricsim_g1_5 5 120
255 api_equal json:policy_types?ric=ricsim_g1_6 4 120
256 api_equal json:policy_types?ric=ricsim_g1_7 3 120
257 api_equal json:policy_types?ric=ricsim_g1_8 2 120
258 api_equal json:policy_types?ric=ricsim_g1_9 1 120
259 api_equal json:policy_types?ric=ricsim_g1_10 0 120
260 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200261
262 api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
263 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
264 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \
265 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3,4:???? \
266 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,4,5:???? \
267 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,4,5:???? \
268 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,4,5:???? \
269 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:4,5:???? \
270 ricsim_g1_9:me1_ricsim_g1_9,me2_ricsim_g1_9:5:???? \
271 ricsim_g1_10:me1_ricsim_g1_10,me2_ricsim_g1_10:NOTYPE:???? "
272
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100273 if [ "$PMS_VERSION" == "V2" ]; then
274 cr_equal received_callbacks?id=ric-registration 19 120
275 cr_api_check_all_sync_events 200 ric-registration ricsim_g1_9
276 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200277
278 #No policy type in sim #10
279
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100280 if [ "$PMS_VERSION" == "V2" ]; then
281 api_equal json:policy-types 5
282 else
283 api_equal json:policy_types 5
284 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200285
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100286 api_put_service 201 "serv1" 3600 "$CR_SERVICE_PATH/serv1"
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200287
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100288 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100289 notificationurl=$CR_SERVICE_PATH"/test"
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100290 else
291 notificationurl=""
292 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200293
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100294 sleep_wait 120
295
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200296 # Load config with reduced number of rics
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100297 if [ $RUNMODE == "KUBE" ]; then
298 agent_load_config ".consul_config_initial.json"
299 else
300 consul_config_app ".consul_config_initial.json"
301 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200302
303 api_equal json:rics 8 120
304
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100305 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100306 cr_equal received_callbacks?id=ric-registration 19 120
307 cr_api_check_all_sync_events 200 ric-registration EMPTY
308 fi
309
310 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200311
312 api_equal json:policy-types 5 120
313
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100314 echo "Check the number of types in the agent for each ric"
315 api_equal json:policy-types?ric_id=ricsim_g1_1 1 120
316 api_equal json:policy-types?ric_id=ricsim_g1_2 2 120
317 api_equal json:policy-types?ric_id=ricsim_g1_3 3 120
318 api_equal json:policy-types?ric_id=ricsim_g1_4 4 120
319 api_equal json:policy-types?ric_id=ricsim_g1_5 5 120
320 api_equal json:policy-types?ric_id=ricsim_g1_6 4 120
321 api_equal json:policy-types?ric_id=ricsim_g1_7 3 120
322 api_equal json:policy-types?ric_id=ricsim_g1_8 2 120
323 else
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200324
325 api_equal json:policy_types 5 120
326
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100327 echo "Check the number of types in the agent for each ric"
328 api_equal json:policy_types?ric=ricsim_g1_1 1 120
329 api_equal json:policy_types?ric=ricsim_g1_2 2 120
330 api_equal json:policy_types?ric=ricsim_g1_3 3 120
331 api_equal json:policy_types?ric=ricsim_g1_4 4 120
332 api_equal json:policy_types?ric=ricsim_g1_5 5 120
333 api_equal json:policy_types?ric=ricsim_g1_6 4 120
334 api_equal json:policy_types?ric=ricsim_g1_7 3 120
335 api_equal json:policy_types?ric=ricsim_g1_8 2 120
336 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200337
338 api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
339 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
340 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \
341 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3,4:???? \
342 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,4,5:???? \
343 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,4,5:???? \
344 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,4,5:???? \
345 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:4,5:???? "
346
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200347 sleep_wait 120
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200348
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100349 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100350 api_equal json:policy-instances 0
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100351 else
352 api_equal json:policy_ids 0
353 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200354
355 api_get_policy_types 404 ricsim_g1_9
356
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200357 # Load config with all rics
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100358 if [ $RUNMODE == "KUBE" ]; then
359 agent_load_config ".consul_config_all.json"
360 else
361 consul_config_app ".consul_config_all.json"
362 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200363
364 api_equal json:rics 10 120
365
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100366 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200367
368 api_equal json:policy-types 5 120
369
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100370 echo "Check the number of types in the agent for each ric"
371 api_equal json:policy-types?ric_id=ricsim_g1_1 1 120
372 api_equal json:policy-types?ric_id=ricsim_g1_2 2 120
373 api_equal json:policy-types?ric_id=ricsim_g1_3 3 120
374 api_equal json:policy-types?ric_id=ricsim_g1_4 4 120
375 api_equal json:policy-types?ric_id=ricsim_g1_5 5 120
376 api_equal json:policy-types?ric_id=ricsim_g1_6 4 120
377 api_equal json:policy-types?ric_id=ricsim_g1_7 3 120
378 api_equal json:policy-types?ric_id=ricsim_g1_8 2 120
379 api_equal json:policy-types?ric_id=ricsim_g1_9 1 120
380 api_equal json:policy-types?ric_id=ricsim_g1_10 0 120
381 else
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200382
383 api_equal json:policy_types 5 120
384
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100385 echo "Check the number of types in the agent for each ric"
386 api_equal json:policy_types?ric=ricsim_g1_1 1 120
387 api_equal json:policy_types?ric=ricsim_g1_2 2 120
388 api_equal json:policy_types?ric=ricsim_g1_3 3 120
389 api_equal json:policy_types?ric=ricsim_g1_4 4 120
390 api_equal json:policy_types?ric=ricsim_g1_5 5 120
391 api_equal json:policy_types?ric=ricsim_g1_6 4 120
392 api_equal json:policy_types?ric=ricsim_g1_7 3 120
393 api_equal json:policy_types?ric=ricsim_g1_8 2 120
394 api_equal json:policy_types?ric=ricsim_g1_9 1 120
395 api_equal json:policy_types?ric=ricsim_g1_10 0 120
396 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200397
398 api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
399 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
400 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \
401 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3,4:???? \
402 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,4,5:???? \
403 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,4,5:???? \
404 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,4,5:???? \
405 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:4,5:???? \
406 ricsim_g1_9:me1_ricsim_g1_9,me2_ricsim_g1_9:5:???? \
407 ricsim_g1_10:me1_ricsim_g1_10,me2_ricsim_g1_10:NOTYPE:???? "
408
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200409 sleep_wait 120
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200410
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100411 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100412 api_equal json:policy-instances 0
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100413 else
414 api_equal json:policy_ids 0
415 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200416
417 sim_equal ricsim_g1_9 num_instances 0
418
419
420 sim_delete_policy_type 204 ricsim_g1_4 4
421 sim_delete_policy_type 204 ricsim_g1_5 4
422 sim_delete_policy_type 204 ricsim_g1_6 4
423 sim_delete_policy_type 204 ricsim_g1_7 4
424
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200425 sleep_wait 120
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200426
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100427 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200428
429 api_equal json:policy-types 5 120
430
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100431 api_equal json:policy-types?ric_id=ricsim_g1_1 1 120
432 api_equal json:policy-types?ric_id=ricsim_g1_2 2 120
433 api_equal json:policy-types?ric_id=ricsim_g1_3 3 120
434 api_equal json:policy-types?ric_id=ricsim_g1_4 3 120
435 api_equal json:policy-types?ric_id=ricsim_g1_5 4 120
436 api_equal json:policy-types?ric_id=ricsim_g1_6 3 120
437 api_equal json:policy-types?ric_id=ricsim_g1_7 2 120
438 api_equal json:policy-types?ric_id=ricsim_g1_8 2 120
439 api_equal json:policy-types?ric_id=ricsim_g1_9 1 120
440 api_equal json:policy-types?ric_id=ricsim_g1_10 0 120
441 else
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200442
443 api_equal json:policy_types 5 120
444
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100445 api_equal json:policy_types?ric=ricsim_g1_1 1 120
446 api_equal json:policy_types?ric=ricsim_g1_2 2 120
447 api_equal json:policy_types?ric=ricsim_g1_3 3 120
448 api_equal json:policy_types?ric=ricsim_g1_4 3 120
449 api_equal json:policy_types?ric=ricsim_g1_5 4 120
450 api_equal json:policy_types?ric=ricsim_g1_6 3 120
451 api_equal json:policy_types?ric=ricsim_g1_7 2 120
452 api_equal json:policy_types?ric=ricsim_g1_8 2 120
453 api_equal json:policy_types?ric=ricsim_g1_9 1 120
454 api_equal json:policy_types?ric=ricsim_g1_10 0 120
455 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200456
457 api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
458 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
459 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \
460 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3:???? \
461 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,5:???? \
462 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,5:???? \
463 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,5:???? \
464 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:4,5:???? \
465 ricsim_g1_9:me1_ricsim_g1_9,me2_ricsim_g1_9:5:???? \
466 ricsim_g1_10:me1_ricsim_g1_10,me2_ricsim_g1_10:NOTYPE:???? "
467
468 sim_delete_policy_type 204 ricsim_g1_8 4
469
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100470 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200471 api_equal json:policy-types 5 120
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100472 api_equal json:policy-types?ric_id=ricsim_g1_8 1 120
473 else
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200474 api_equal json:policy_types 5 120
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100475 api_equal json:policy_types?ric=ricsim_g1_8 1 120
476 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200477
478 api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
479 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
480 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \
481 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3:???? \
482 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,5:???? \
483 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,5:???? \
484 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,5:???? \
485 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:5:???? \
486 ricsim_g1_9:me1_ricsim_g1_9,me2_ricsim_g1_9:5:???? \
487 ricsim_g1_10:me1_ricsim_g1_10,me2_ricsim_g1_10:NOTYPE:???? "
488
489
490
491 check_policy_agent_logs
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100492 if [[ $interface = *"SDNC"* ]]; then
493 check_sdnc_logs
494 fi
495
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200496 store_logs ${interface}
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200497
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200498done
499
500
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200501#### TEST COMPLETE ####
502
503
504print_result
505
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100506auto_clean_environment