blob: 25bdc4ce8662e88a460fa9c763dfea04735e8af7 [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
BjornMagnussonXA663566c2021-11-08 10:25:07 +010023DOCKER_INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC NGW KUBEPROXY"
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
BjornMagnussonXA663566c2021-11-08 10:25:07 +010072 start_kube_proxy
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010073
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020074 #Start simulators and prepare two configs
75
76 start_ric_simulators ricsim_g1 $NUM_RICS_2 OSC_2.1.0
77
78 start_cr
79
80 start_mr
81
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010082 if [ $RUNMODE == "DOCKER" ]; then
83 start_consul_cbs
84 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020085
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +010086 # Create first config
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020087 if [[ $interface = *"SDNC"* ]]; then
88 start_sdnc
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +010089 prepare_consul_config SDNC ".consul_config_initial.json"
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020090 else
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +010091 prepare_consul_config NOSDNC ".consul_config_initial.json"
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020092 fi
93
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020094 # Create 2nd config and save for later
95 start_ric_simulators ricsim_g1 $NUM_RICS OSC_2.1.0
96
97 if [[ $interface = *"SDNC"* ]]; then
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020098 prepare_consul_config SDNC ".consul_config_all.json"
99 else
100 prepare_consul_config NOSDNC ".consul_config_all.json"
101 fi
102
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +0100103 start_policy_agent NORPOXY $SIM_GROUP/$POLICY_AGENT_COMPOSE_DIR/$POLICY_AGENT_CONFIG_FILE
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200104
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200105 set_agent_trace
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200106
107 api_get_status 200
108
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100109 # Create service to be able to receive events when rics becomes available
110 # Must use rest towards the agent since dmaap is not configured yet
BjornMagnussonXA663566c2021-11-08 10:25:07 +0100111 api_put_service 201 "ric-registration" 0 "$CR_SERVICE_APP_PATH/ric-registration"
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100112
113 #Load first config
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100114 if [ $RUNMODE == "KUBE" ]; then
115 agent_load_config ".consul_config_initial.json"
116 else
117 consul_config_app ".consul_config_initial.json"
118 fi
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100119
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200120 for ((i=1; i<=${NUM_RICS}; i++))
121 do
122 sim_print ricsim_g1_$i interface
123 done
124
125 # All sims running but 2 are not configured in consul
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100126 api_equal json:rics 8 300
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200127
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100128 if [ "$PMS_VERSION" == "V2" ]; then
129 cr_equal received_callbacks?id=ric-registration 8 120
130 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
131 fi
132
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200133 api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:NOTYPE:???? \
134 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:NOTYPE:???? \
135 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:NOTYPE:???? \
136 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:NOTYPE:???? \
137 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:NOTYPE:???? \
138 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:NOTYPE:???? \
139 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:NOTYPE:???? \
140 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:NOTYPE:???? "
141
142
143 sim_put_policy_type 201 ricsim_g1_1 1 testdata/OSC/sim_1.json
144 sim_put_policy_type 201 ricsim_g1_2 1 testdata/OSC/sim_1.json
145 sim_put_policy_type 201 ricsim_g1_3 1 testdata/OSC/sim_1.json
146 sim_put_policy_type 201 ricsim_g1_4 1 testdata/OSC/sim_1.json
147 sim_put_policy_type 201 ricsim_g1_5 1 testdata/OSC/sim_1.json
148
149 sim_put_policy_type 201 ricsim_g1_2 2 testdata/OSC/sim_2.json
150 sim_put_policy_type 201 ricsim_g1_3 2 testdata/OSC/sim_2.json
151 sim_put_policy_type 201 ricsim_g1_4 2 testdata/OSC/sim_2.json
152 sim_put_policy_type 201 ricsim_g1_5 2 testdata/OSC/sim_2.json
153 sim_put_policy_type 201 ricsim_g1_6 2 testdata/OSC/sim_2.json
154
155 sim_put_policy_type 201 ricsim_g1_3 3 testdata/OSC/sim_3.json
156 sim_put_policy_type 201 ricsim_g1_4 3 testdata/OSC/sim_3.json
157 sim_put_policy_type 201 ricsim_g1_5 3 testdata/OSC/sim_3.json
158 sim_put_policy_type 201 ricsim_g1_6 3 testdata/OSC/sim_3.json
159 sim_put_policy_type 201 ricsim_g1_7 3 testdata/OSC/sim_3.json
160
161 sim_put_policy_type 201 ricsim_g1_4 4 testdata/OSC/sim_4.json
162 sim_put_policy_type 201 ricsim_g1_5 4 testdata/OSC/sim_4.json
163 sim_put_policy_type 201 ricsim_g1_6 4 testdata/OSC/sim_4.json
164 sim_put_policy_type 201 ricsim_g1_7 4 testdata/OSC/sim_4.json
165 sim_put_policy_type 201 ricsim_g1_8 4 testdata/OSC/sim_4.json
166
167 sim_put_policy_type 201 ricsim_g1_5 5 testdata/OSC/sim_5.json
168 sim_put_policy_type 201 ricsim_g1_6 5 testdata/OSC/sim_5.json
169 sim_put_policy_type 201 ricsim_g1_7 5 testdata/OSC/sim_5.json
170 sim_put_policy_type 201 ricsim_g1_8 5 testdata/OSC/sim_5.json
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200171
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100172 if [ "$PMS_VERSION" == "V2" ]; then
173 api_equal json:policy-types 5 120
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200174
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100175 echo "Check the number of types in the agent for each ric"
176 api_equal json:policy-types?ric_id=ricsim_g1_1 1 120
177 api_equal json:policy-types?ric_id=ricsim_g1_2 2 120
178 api_equal json:policy-types?ric_id=ricsim_g1_3 3 120
179 api_equal json:policy-types?ric_id=ricsim_g1_4 4 120
180 api_equal json:policy-types?ric_id=ricsim_g1_5 5 120
181 api_equal json:policy-types?ric_id=ricsim_g1_6 4 120
182 api_equal json:policy-types?ric_id=ricsim_g1_7 3 120
183 api_equal json:policy-types?ric_id=ricsim_g1_8 2 120
184 else
185 api_equal json:policy_types 5 120
186
187 echo "Check the number of types in the agent for each ric"
188 api_equal json:policy_types?ric=ricsim_g1_1 1 120
189 api_equal json:policy_types?ric=ricsim_g1_2 2 120
190 api_equal json:policy_types?ric=ricsim_g1_3 3 120
191 api_equal json:policy_types?ric=ricsim_g1_4 4 120
192 api_equal json:policy_types?ric=ricsim_g1_5 5 120
193 api_equal json:policy_types?ric=ricsim_g1_6 4 120
194 api_equal json:policy_types?ric=ricsim_g1_7 3 120
195 api_equal json:policy_types?ric=ricsim_g1_8 2 120
196 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200197
198 api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
199 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
200 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \
201 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3,4:???? \
202 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,4,5:???? \
203 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,4,5:???? \
204 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,4,5:???? \
205 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:4,5:???? "
206
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100207 if [ "$PMS_VERSION" == "V2" ]; then
208 cr_equal received_callbacks?id=ric-registration 16 120
209 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
210 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200211
212 #Load config with all rics
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100213 if [ $RUNMODE == "KUBE" ]; then
214 agent_load_config ".consul_config_all.json"
215 else
216 consul_config_app ".consul_config_all.json"
217 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200218
219 api_equal json:rics 10 120
220
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100221 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100222 cr_equal received_callbacks?id=ric-registration 18 120
223 cr_api_check_all_sync_events 200 ric-registration ricsim_g1_9 ricsim_g1_10
224 fi
225
226 sim_put_policy_type 201 ricsim_g1_9 5 testdata/OSC/sim_5.json
227
228 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100229
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200230 api_equal json:policy-types 5 120
231
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100232 echo "Check the number of types in the agent for each ric"
233 api_equal json:policy-types?ric_id=ricsim_g1_1 1 120
234 api_equal json:policy-types?ric_id=ricsim_g1_2 2 120
235 api_equal json:policy-types?ric_id=ricsim_g1_3 3 120
236 api_equal json:policy-types?ric_id=ricsim_g1_4 4 120
237 api_equal json:policy-types?ric_id=ricsim_g1_5 5 120
238 api_equal json:policy-types?ric_id=ricsim_g1_6 4 120
239 api_equal json:policy-types?ric_id=ricsim_g1_7 3 120
240 api_equal json:policy-types?ric_id=ricsim_g1_8 2 120
241 api_equal json:policy-types?ric_id=ricsim_g1_9 1 120
242 api_equal json:policy-types?ric_id=ricsim_g1_10 0 120
243 else
244
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200245 api_equal json:policy_types 5 120
246
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100247 echo "Check the number of types in the agent for each ric"
248 api_equal json:policy_types?ric=ricsim_g1_1 1 120
249 api_equal json:policy_types?ric=ricsim_g1_2 2 120
250 api_equal json:policy_types?ric=ricsim_g1_3 3 120
251 api_equal json:policy_types?ric=ricsim_g1_4 4 120
252 api_equal json:policy_types?ric=ricsim_g1_5 5 120
253 api_equal json:policy_types?ric=ricsim_g1_6 4 120
254 api_equal json:policy_types?ric=ricsim_g1_7 3 120
255 api_equal json:policy_types?ric=ricsim_g1_8 2 120
256 api_equal json:policy_types?ric=ricsim_g1_9 1 120
257 api_equal json:policy_types?ric=ricsim_g1_10 0 120
258 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200259
260 api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
261 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
262 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \
263 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3,4:???? \
264 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,4,5:???? \
265 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,4,5:???? \
266 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,4,5:???? \
267 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:4,5:???? \
268 ricsim_g1_9:me1_ricsim_g1_9,me2_ricsim_g1_9:5:???? \
269 ricsim_g1_10:me1_ricsim_g1_10,me2_ricsim_g1_10:NOTYPE:???? "
270
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100271 if [ "$PMS_VERSION" == "V2" ]; then
272 cr_equal received_callbacks?id=ric-registration 19 120
273 cr_api_check_all_sync_events 200 ric-registration ricsim_g1_9
274 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200275
276 #No policy type in sim #10
277
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100278 if [ "$PMS_VERSION" == "V2" ]; then
279 api_equal json:policy-types 5
280 else
281 api_equal json:policy_types 5
282 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200283
BjornMagnussonXA663566c2021-11-08 10:25:07 +0100284 api_put_service 201 "serv1" 3600 "$CR_SERVICE_APP_PATH/serv1"
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200285
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100286 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXA663566c2021-11-08 10:25:07 +0100287 notificationurl=$CR_SERVICE_APP_PATH"/test"
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100288 else
289 notificationurl=""
290 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200291
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100292 sleep_wait 120
293
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200294 # Load config with reduced number of rics
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100295 if [ $RUNMODE == "KUBE" ]; then
296 agent_load_config ".consul_config_initial.json"
297 else
298 consul_config_app ".consul_config_initial.json"
299 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200300
301 api_equal json:rics 8 120
302
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100303 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100304 cr_equal received_callbacks?id=ric-registration 19 120
305 cr_api_check_all_sync_events 200 ric-registration EMPTY
306 fi
307
308 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200309
310 api_equal json:policy-types 5 120
311
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100312 echo "Check the number of types in the agent for each ric"
313 api_equal json:policy-types?ric_id=ricsim_g1_1 1 120
314 api_equal json:policy-types?ric_id=ricsim_g1_2 2 120
315 api_equal json:policy-types?ric_id=ricsim_g1_3 3 120
316 api_equal json:policy-types?ric_id=ricsim_g1_4 4 120
317 api_equal json:policy-types?ric_id=ricsim_g1_5 5 120
318 api_equal json:policy-types?ric_id=ricsim_g1_6 4 120
319 api_equal json:policy-types?ric_id=ricsim_g1_7 3 120
320 api_equal json:policy-types?ric_id=ricsim_g1_8 2 120
321 else
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200322
323 api_equal json:policy_types 5 120
324
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100325 echo "Check the number of types in the agent for each ric"
326 api_equal json:policy_types?ric=ricsim_g1_1 1 120
327 api_equal json:policy_types?ric=ricsim_g1_2 2 120
328 api_equal json:policy_types?ric=ricsim_g1_3 3 120
329 api_equal json:policy_types?ric=ricsim_g1_4 4 120
330 api_equal json:policy_types?ric=ricsim_g1_5 5 120
331 api_equal json:policy_types?ric=ricsim_g1_6 4 120
332 api_equal json:policy_types?ric=ricsim_g1_7 3 120
333 api_equal json:policy_types?ric=ricsim_g1_8 2 120
334 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200335
336 api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
337 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
338 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \
339 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3,4:???? \
340 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,4,5:???? \
341 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,4,5:???? \
342 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,4,5:???? \
343 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:4,5:???? "
344
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200345 sleep_wait 120
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200346
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100347 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100348 api_equal json:policy-instances 0
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100349 else
350 api_equal json:policy_ids 0
351 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200352
353 api_get_policy_types 404 ricsim_g1_9
354
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200355 # Load config with all rics
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100356 if [ $RUNMODE == "KUBE" ]; then
357 agent_load_config ".consul_config_all.json"
358 else
359 consul_config_app ".consul_config_all.json"
360 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200361
362 api_equal json:rics 10 120
363
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100364 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200365
366 api_equal json:policy-types 5 120
367
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100368 echo "Check the number of types in the agent for each ric"
369 api_equal json:policy-types?ric_id=ricsim_g1_1 1 120
370 api_equal json:policy-types?ric_id=ricsim_g1_2 2 120
371 api_equal json:policy-types?ric_id=ricsim_g1_3 3 120
372 api_equal json:policy-types?ric_id=ricsim_g1_4 4 120
373 api_equal json:policy-types?ric_id=ricsim_g1_5 5 120
374 api_equal json:policy-types?ric_id=ricsim_g1_6 4 120
375 api_equal json:policy-types?ric_id=ricsim_g1_7 3 120
376 api_equal json:policy-types?ric_id=ricsim_g1_8 2 120
377 api_equal json:policy-types?ric_id=ricsim_g1_9 1 120
378 api_equal json:policy-types?ric_id=ricsim_g1_10 0 120
379 else
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200380
381 api_equal json:policy_types 5 120
382
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100383 echo "Check the number of types in the agent for each ric"
384 api_equal json:policy_types?ric=ricsim_g1_1 1 120
385 api_equal json:policy_types?ric=ricsim_g1_2 2 120
386 api_equal json:policy_types?ric=ricsim_g1_3 3 120
387 api_equal json:policy_types?ric=ricsim_g1_4 4 120
388 api_equal json:policy_types?ric=ricsim_g1_5 5 120
389 api_equal json:policy_types?ric=ricsim_g1_6 4 120
390 api_equal json:policy_types?ric=ricsim_g1_7 3 120
391 api_equal json:policy_types?ric=ricsim_g1_8 2 120
392 api_equal json:policy_types?ric=ricsim_g1_9 1 120
393 api_equal json:policy_types?ric=ricsim_g1_10 0 120
394 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200395
396 api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
397 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
398 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \
399 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3,4:???? \
400 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,4,5:???? \
401 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,4,5:???? \
402 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,4,5:???? \
403 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:4,5:???? \
404 ricsim_g1_9:me1_ricsim_g1_9,me2_ricsim_g1_9:5:???? \
405 ricsim_g1_10:me1_ricsim_g1_10,me2_ricsim_g1_10:NOTYPE:???? "
406
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200407 sleep_wait 120
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200408
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100409 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100410 api_equal json:policy-instances 0
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100411 else
412 api_equal json:policy_ids 0
413 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200414
415 sim_equal ricsim_g1_9 num_instances 0
416
417
418 sim_delete_policy_type 204 ricsim_g1_4 4
419 sim_delete_policy_type 204 ricsim_g1_5 4
420 sim_delete_policy_type 204 ricsim_g1_6 4
421 sim_delete_policy_type 204 ricsim_g1_7 4
422
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200423 sleep_wait 120
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200424
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100425 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200426
427 api_equal json:policy-types 5 120
428
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100429 api_equal json:policy-types?ric_id=ricsim_g1_1 1 120
430 api_equal json:policy-types?ric_id=ricsim_g1_2 2 120
431 api_equal json:policy-types?ric_id=ricsim_g1_3 3 120
432 api_equal json:policy-types?ric_id=ricsim_g1_4 3 120
433 api_equal json:policy-types?ric_id=ricsim_g1_5 4 120
434 api_equal json:policy-types?ric_id=ricsim_g1_6 3 120
435 api_equal json:policy-types?ric_id=ricsim_g1_7 2 120
436 api_equal json:policy-types?ric_id=ricsim_g1_8 2 120
437 api_equal json:policy-types?ric_id=ricsim_g1_9 1 120
438 api_equal json:policy-types?ric_id=ricsim_g1_10 0 120
439 else
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200440
441 api_equal json:policy_types 5 120
442
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100443 api_equal json:policy_types?ric=ricsim_g1_1 1 120
444 api_equal json:policy_types?ric=ricsim_g1_2 2 120
445 api_equal json:policy_types?ric=ricsim_g1_3 3 120
446 api_equal json:policy_types?ric=ricsim_g1_4 3 120
447 api_equal json:policy_types?ric=ricsim_g1_5 4 120
448 api_equal json:policy_types?ric=ricsim_g1_6 3 120
449 api_equal json:policy_types?ric=ricsim_g1_7 2 120
450 api_equal json:policy_types?ric=ricsim_g1_8 2 120
451 api_equal json:policy_types?ric=ricsim_g1_9 1 120
452 api_equal json:policy_types?ric=ricsim_g1_10 0 120
453 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200454
455 api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
456 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
457 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \
458 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3:???? \
459 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,5:???? \
460 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,5:???? \
461 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,5:???? \
462 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:4,5:???? \
463 ricsim_g1_9:me1_ricsim_g1_9,me2_ricsim_g1_9:5:???? \
464 ricsim_g1_10:me1_ricsim_g1_10,me2_ricsim_g1_10:NOTYPE:???? "
465
466 sim_delete_policy_type 204 ricsim_g1_8 4
467
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100468 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200469 api_equal json:policy-types 5 120
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100470 api_equal json:policy-types?ric_id=ricsim_g1_8 1 120
471 else
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200472 api_equal json:policy_types 5 120
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100473 api_equal json:policy_types?ric=ricsim_g1_8 1 120
474 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200475
476 api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
477 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
478 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \
479 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3:???? \
480 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,5:???? \
481 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,5:???? \
482 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,5:???? \
483 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:5:???? \
484 ricsim_g1_9:me1_ricsim_g1_9,me2_ricsim_g1_9:5:???? \
485 ricsim_g1_10:me1_ricsim_g1_10,me2_ricsim_g1_10:NOTYPE:???? "
486
487
488
489 check_policy_agent_logs
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100490 if [[ $interface = *"SDNC"* ]]; then
491 check_sdnc_logs
492 fi
493
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200494 store_logs ${interface}
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200495
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200496done
497
498
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200499#### TEST COMPLETE ####
500
501
502print_result
503
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100504auto_clean_environment