blob: 31e40ab9b50cb88bca49d64c931cd538d3eb95e8 [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
BjornMagnussonXA79e37002021-11-22 13:36:04 +010035. ../common/testcase_common.sh $@
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010036
37setup_testenvironment
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020038
39#### TEST BEGIN ####
40
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010041generate_policy_uuid
BjornMagnussonXAad047782020-06-08 15:54:11 +020042
BjornMagnussonXA496156d2020-08-10 14:16:24 +020043use_cr_http
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020044
45NUM_RICS=10
46NUM_RICS_2=$(($NUM_RICS-2))
47
48# Tested variants of REST/SDNC config
49TESTED_VARIANTS="REST REST+SDNC"
50
51for interface in $TESTED_VARIANTS ; do
52
53 echo "#####################################################################"
54 echo "#####################################################################"
55 echo "### Testing agent: "$interface
56 echo "#####################################################################"
57 echo "#####################################################################"
58
59
60 # Clean container and start all needed containers #
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010061 clean_environment
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020062
BjornMagnussonXA663566c2021-11-08 10:25:07 +010063 start_kube_proxy
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010064
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020065 #Start simulators and prepare two configs
66
67 start_ric_simulators ricsim_g1 $NUM_RICS_2 OSC_2.1.0
68
BjornMagnussonXA79e37002021-11-22 13:36:04 +010069 start_cr 1
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020070
71 start_mr
72
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010073 if [ $RUNMODE == "DOCKER" ]; then
74 start_consul_cbs
75 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020076
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +010077 # Create first config
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020078 if [[ $interface = *"SDNC"* ]]; then
79 start_sdnc
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +010080 prepare_consul_config SDNC ".consul_config_initial.json"
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020081 else
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +010082 prepare_consul_config NOSDNC ".consul_config_initial.json"
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020083 fi
84
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020085 # Create 2nd config and save for later
86 start_ric_simulators ricsim_g1 $NUM_RICS OSC_2.1.0
87
88 if [[ $interface = *"SDNC"* ]]; then
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020089 prepare_consul_config SDNC ".consul_config_all.json"
90 else
91 prepare_consul_config NOSDNC ".consul_config_all.json"
92 fi
93
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010094 start_policy_agent NORPOXY $SIM_GROUP/$POLICY_AGENT_COMPOSE_DIR/$POLICY_AGENT_CONFIG_FILE
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020095
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +020096 set_agent_trace
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020097
98 api_get_status 200
99
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100100 # Create service to be able to receive events when rics becomes available
101 # Must use rest towards the agent since dmaap is not configured yet
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100102 api_put_service 201 "ric-registration" 0 "$CR_SERVICE_APP_PATH_0/ric-registration"
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100103
104 #Load first config
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100105 if [ $RUNMODE == "KUBE" ]; then
106 agent_load_config ".consul_config_initial.json"
107 else
108 consul_config_app ".consul_config_initial.json"
109 fi
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100110
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200111 for ((i=1; i<=${NUM_RICS}; i++))
112 do
113 sim_print ricsim_g1_$i interface
114 done
115
116 # All sims running but 2 are not configured in consul
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100117 api_equal json:rics 8 300
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200118
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100119 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100120 cr_equal 0 received_callbacks?id=ric-registration 8 120
121 cr_api_check_all_sync_events 200 0 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
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100122 fi
123
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200124 api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:NOTYPE:???? \
125 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:NOTYPE:???? \
126 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:NOTYPE:???? \
127 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:NOTYPE:???? \
128 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:NOTYPE:???? \
129 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:NOTYPE:???? \
130 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:NOTYPE:???? \
131 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:NOTYPE:???? "
132
133
134 sim_put_policy_type 201 ricsim_g1_1 1 testdata/OSC/sim_1.json
135 sim_put_policy_type 201 ricsim_g1_2 1 testdata/OSC/sim_1.json
136 sim_put_policy_type 201 ricsim_g1_3 1 testdata/OSC/sim_1.json
137 sim_put_policy_type 201 ricsim_g1_4 1 testdata/OSC/sim_1.json
138 sim_put_policy_type 201 ricsim_g1_5 1 testdata/OSC/sim_1.json
139
140 sim_put_policy_type 201 ricsim_g1_2 2 testdata/OSC/sim_2.json
141 sim_put_policy_type 201 ricsim_g1_3 2 testdata/OSC/sim_2.json
142 sim_put_policy_type 201 ricsim_g1_4 2 testdata/OSC/sim_2.json
143 sim_put_policy_type 201 ricsim_g1_5 2 testdata/OSC/sim_2.json
144 sim_put_policy_type 201 ricsim_g1_6 2 testdata/OSC/sim_2.json
145
146 sim_put_policy_type 201 ricsim_g1_3 3 testdata/OSC/sim_3.json
147 sim_put_policy_type 201 ricsim_g1_4 3 testdata/OSC/sim_3.json
148 sim_put_policy_type 201 ricsim_g1_5 3 testdata/OSC/sim_3.json
149 sim_put_policy_type 201 ricsim_g1_6 3 testdata/OSC/sim_3.json
150 sim_put_policy_type 201 ricsim_g1_7 3 testdata/OSC/sim_3.json
151
152 sim_put_policy_type 201 ricsim_g1_4 4 testdata/OSC/sim_4.json
153 sim_put_policy_type 201 ricsim_g1_5 4 testdata/OSC/sim_4.json
154 sim_put_policy_type 201 ricsim_g1_6 4 testdata/OSC/sim_4.json
155 sim_put_policy_type 201 ricsim_g1_7 4 testdata/OSC/sim_4.json
156 sim_put_policy_type 201 ricsim_g1_8 4 testdata/OSC/sim_4.json
157
158 sim_put_policy_type 201 ricsim_g1_5 5 testdata/OSC/sim_5.json
159 sim_put_policy_type 201 ricsim_g1_6 5 testdata/OSC/sim_5.json
160 sim_put_policy_type 201 ricsim_g1_7 5 testdata/OSC/sim_5.json
161 sim_put_policy_type 201 ricsim_g1_8 5 testdata/OSC/sim_5.json
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200162
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100163 if [ "$PMS_VERSION" == "V2" ]; then
164 api_equal json:policy-types 5 120
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200165
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100166 echo "Check the number of types in the agent for each ric"
167 api_equal json:policy-types?ric_id=ricsim_g1_1 1 120
168 api_equal json:policy-types?ric_id=ricsim_g1_2 2 120
169 api_equal json:policy-types?ric_id=ricsim_g1_3 3 120
170 api_equal json:policy-types?ric_id=ricsim_g1_4 4 120
171 api_equal json:policy-types?ric_id=ricsim_g1_5 5 120
172 api_equal json:policy-types?ric_id=ricsim_g1_6 4 120
173 api_equal json:policy-types?ric_id=ricsim_g1_7 3 120
174 api_equal json:policy-types?ric_id=ricsim_g1_8 2 120
175 else
176 api_equal json:policy_types 5 120
177
178 echo "Check the number of types in the agent for each ric"
179 api_equal json:policy_types?ric=ricsim_g1_1 1 120
180 api_equal json:policy_types?ric=ricsim_g1_2 2 120
181 api_equal json:policy_types?ric=ricsim_g1_3 3 120
182 api_equal json:policy_types?ric=ricsim_g1_4 4 120
183 api_equal json:policy_types?ric=ricsim_g1_5 5 120
184 api_equal json:policy_types?ric=ricsim_g1_6 4 120
185 api_equal json:policy_types?ric=ricsim_g1_7 3 120
186 api_equal json:policy_types?ric=ricsim_g1_8 2 120
187 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200188
189 api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
190 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
191 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \
192 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3,4:???? \
193 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,4,5:???? \
194 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,4,5:???? \
195 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,4,5:???? \
196 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:4,5:???? "
197
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100198 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100199 cr_equal 0 received_callbacks?id=ric-registration 16 120
200 cr_api_check_all_sync_events 200 0 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
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100201 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200202
203 #Load config with all rics
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100204 if [ $RUNMODE == "KUBE" ]; then
205 agent_load_config ".consul_config_all.json"
206 else
207 consul_config_app ".consul_config_all.json"
208 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200209
210 api_equal json:rics 10 120
211
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100212 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100213 cr_equal 0 received_callbacks?id=ric-registration 18 120
214 cr_api_check_all_sync_events 200 0 ric-registration ricsim_g1_9 ricsim_g1_10
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100215 fi
216
217 sim_put_policy_type 201 ricsim_g1_9 5 testdata/OSC/sim_5.json
218
219 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100220
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200221 api_equal json:policy-types 5 120
222
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100223 echo "Check the number of types in the agent for each ric"
224 api_equal json:policy-types?ric_id=ricsim_g1_1 1 120
225 api_equal json:policy-types?ric_id=ricsim_g1_2 2 120
226 api_equal json:policy-types?ric_id=ricsim_g1_3 3 120
227 api_equal json:policy-types?ric_id=ricsim_g1_4 4 120
228 api_equal json:policy-types?ric_id=ricsim_g1_5 5 120
229 api_equal json:policy-types?ric_id=ricsim_g1_6 4 120
230 api_equal json:policy-types?ric_id=ricsim_g1_7 3 120
231 api_equal json:policy-types?ric_id=ricsim_g1_8 2 120
232 api_equal json:policy-types?ric_id=ricsim_g1_9 1 120
233 api_equal json:policy-types?ric_id=ricsim_g1_10 0 120
234 else
235
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200236 api_equal json:policy_types 5 120
237
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100238 echo "Check the number of types in the agent for each ric"
239 api_equal json:policy_types?ric=ricsim_g1_1 1 120
240 api_equal json:policy_types?ric=ricsim_g1_2 2 120
241 api_equal json:policy_types?ric=ricsim_g1_3 3 120
242 api_equal json:policy_types?ric=ricsim_g1_4 4 120
243 api_equal json:policy_types?ric=ricsim_g1_5 5 120
244 api_equal json:policy_types?ric=ricsim_g1_6 4 120
245 api_equal json:policy_types?ric=ricsim_g1_7 3 120
246 api_equal json:policy_types?ric=ricsim_g1_8 2 120
247 api_equal json:policy_types?ric=ricsim_g1_9 1 120
248 api_equal json:policy_types?ric=ricsim_g1_10 0 120
249 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200250
251 api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
252 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
253 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \
254 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3,4:???? \
255 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,4,5:???? \
256 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,4,5:???? \
257 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,4,5:???? \
258 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:4,5:???? \
259 ricsim_g1_9:me1_ricsim_g1_9,me2_ricsim_g1_9:5:???? \
260 ricsim_g1_10:me1_ricsim_g1_10,me2_ricsim_g1_10:NOTYPE:???? "
261
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100262 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100263 cr_equal 0 received_callbacks?id=ric-registration 19 120
264 cr_api_check_all_sync_events 200 0 ric-registration ricsim_g1_9
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100265 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200266
267 #No policy type in sim #10
268
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100269 if [ "$PMS_VERSION" == "V2" ]; then
270 api_equal json:policy-types 5
271 else
272 api_equal json:policy_types 5
273 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200274
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100275 api_put_service 201 "serv1" 3600 "$CR_SERVICE_APP_PATH_0/serv1"
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200276
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100277 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100278 notificationurl=$CR_SERVICE_APP_PATH_0"/test"
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100279 else
280 notificationurl=""
281 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200282
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100283 sleep_wait 120
284
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200285 # Load config with reduced number of rics
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100286 if [ $RUNMODE == "KUBE" ]; then
287 agent_load_config ".consul_config_initial.json"
288 else
289 consul_config_app ".consul_config_initial.json"
290 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200291
292 api_equal json:rics 8 120
293
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100294 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100295 cr_equal 0 received_callbacks?id=ric-registration 19 120
296 cr_api_check_all_sync_events 200 0 ric-registration EMPTY
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100297 fi
298
299 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200300
301 api_equal json:policy-types 5 120
302
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100303 echo "Check the number of types in the agent for each ric"
304 api_equal json:policy-types?ric_id=ricsim_g1_1 1 120
305 api_equal json:policy-types?ric_id=ricsim_g1_2 2 120
306 api_equal json:policy-types?ric_id=ricsim_g1_3 3 120
307 api_equal json:policy-types?ric_id=ricsim_g1_4 4 120
308 api_equal json:policy-types?ric_id=ricsim_g1_5 5 120
309 api_equal json:policy-types?ric_id=ricsim_g1_6 4 120
310 api_equal json:policy-types?ric_id=ricsim_g1_7 3 120
311 api_equal json:policy-types?ric_id=ricsim_g1_8 2 120
312 else
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200313
314 api_equal json:policy_types 5 120
315
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100316 echo "Check the number of types in the agent for each ric"
317 api_equal json:policy_types?ric=ricsim_g1_1 1 120
318 api_equal json:policy_types?ric=ricsim_g1_2 2 120
319 api_equal json:policy_types?ric=ricsim_g1_3 3 120
320 api_equal json:policy_types?ric=ricsim_g1_4 4 120
321 api_equal json:policy_types?ric=ricsim_g1_5 5 120
322 api_equal json:policy_types?ric=ricsim_g1_6 4 120
323 api_equal json:policy_types?ric=ricsim_g1_7 3 120
324 api_equal json:policy_types?ric=ricsim_g1_8 2 120
325 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200326
327 api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
328 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
329 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \
330 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3,4:???? \
331 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,4,5:???? \
332 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,4,5:???? \
333 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,4,5:???? \
334 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:4,5:???? "
335
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200336 sleep_wait 120
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200337
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100338 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100339 api_equal json:policy-instances 0
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100340 else
341 api_equal json:policy_ids 0
342 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200343
344 api_get_policy_types 404 ricsim_g1_9
345
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200346 # Load config with all rics
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100347 if [ $RUNMODE == "KUBE" ]; then
348 agent_load_config ".consul_config_all.json"
349 else
350 consul_config_app ".consul_config_all.json"
351 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200352
353 api_equal json:rics 10 120
354
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100355 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200356
357 api_equal json:policy-types 5 120
358
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100359 echo "Check the number of types in the agent for each ric"
360 api_equal json:policy-types?ric_id=ricsim_g1_1 1 120
361 api_equal json:policy-types?ric_id=ricsim_g1_2 2 120
362 api_equal json:policy-types?ric_id=ricsim_g1_3 3 120
363 api_equal json:policy-types?ric_id=ricsim_g1_4 4 120
364 api_equal json:policy-types?ric_id=ricsim_g1_5 5 120
365 api_equal json:policy-types?ric_id=ricsim_g1_6 4 120
366 api_equal json:policy-types?ric_id=ricsim_g1_7 3 120
367 api_equal json:policy-types?ric_id=ricsim_g1_8 2 120
368 api_equal json:policy-types?ric_id=ricsim_g1_9 1 120
369 api_equal json:policy-types?ric_id=ricsim_g1_10 0 120
370 else
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200371
372 api_equal json:policy_types 5 120
373
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100374 echo "Check the number of types in the agent for each ric"
375 api_equal json:policy_types?ric=ricsim_g1_1 1 120
376 api_equal json:policy_types?ric=ricsim_g1_2 2 120
377 api_equal json:policy_types?ric=ricsim_g1_3 3 120
378 api_equal json:policy_types?ric=ricsim_g1_4 4 120
379 api_equal json:policy_types?ric=ricsim_g1_5 5 120
380 api_equal json:policy_types?ric=ricsim_g1_6 4 120
381 api_equal json:policy_types?ric=ricsim_g1_7 3 120
382 api_equal json:policy_types?ric=ricsim_g1_8 2 120
383 api_equal json:policy_types?ric=ricsim_g1_9 1 120
384 api_equal json:policy_types?ric=ricsim_g1_10 0 120
385 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200386
387 api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
388 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
389 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \
390 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3,4:???? \
391 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,4,5:???? \
392 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,4,5:???? \
393 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,4,5:???? \
394 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:4,5:???? \
395 ricsim_g1_9:me1_ricsim_g1_9,me2_ricsim_g1_9:5:???? \
396 ricsim_g1_10:me1_ricsim_g1_10,me2_ricsim_g1_10:NOTYPE:???? "
397
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200398 sleep_wait 120
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200399
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100400 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100401 api_equal json:policy-instances 0
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100402 else
403 api_equal json:policy_ids 0
404 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200405
406 sim_equal ricsim_g1_9 num_instances 0
407
408
409 sim_delete_policy_type 204 ricsim_g1_4 4
410 sim_delete_policy_type 204 ricsim_g1_5 4
411 sim_delete_policy_type 204 ricsim_g1_6 4
412 sim_delete_policy_type 204 ricsim_g1_7 4
413
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200414 sleep_wait 120
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200415
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100416 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200417
418 api_equal json:policy-types 5 120
419
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100420 api_equal json:policy-types?ric_id=ricsim_g1_1 1 120
421 api_equal json:policy-types?ric_id=ricsim_g1_2 2 120
422 api_equal json:policy-types?ric_id=ricsim_g1_3 3 120
423 api_equal json:policy-types?ric_id=ricsim_g1_4 3 120
424 api_equal json:policy-types?ric_id=ricsim_g1_5 4 120
425 api_equal json:policy-types?ric_id=ricsim_g1_6 3 120
426 api_equal json:policy-types?ric_id=ricsim_g1_7 2 120
427 api_equal json:policy-types?ric_id=ricsim_g1_8 2 120
428 api_equal json:policy-types?ric_id=ricsim_g1_9 1 120
429 api_equal json:policy-types?ric_id=ricsim_g1_10 0 120
430 else
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200431
432 api_equal json:policy_types 5 120
433
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100434 api_equal json:policy_types?ric=ricsim_g1_1 1 120
435 api_equal json:policy_types?ric=ricsim_g1_2 2 120
436 api_equal json:policy_types?ric=ricsim_g1_3 3 120
437 api_equal json:policy_types?ric=ricsim_g1_4 3 120
438 api_equal json:policy_types?ric=ricsim_g1_5 4 120
439 api_equal json:policy_types?ric=ricsim_g1_6 3 120
440 api_equal json:policy_types?ric=ricsim_g1_7 2 120
441 api_equal json:policy_types?ric=ricsim_g1_8 2 120
442 api_equal json:policy_types?ric=ricsim_g1_9 1 120
443 api_equal json:policy_types?ric=ricsim_g1_10 0 120
444 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200445
446 api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
447 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
448 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \
449 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3:???? \
450 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,5:???? \
451 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,5:???? \
452 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,5:???? \
453 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:4,5:???? \
454 ricsim_g1_9:me1_ricsim_g1_9,me2_ricsim_g1_9:5:???? \
455 ricsim_g1_10:me1_ricsim_g1_10,me2_ricsim_g1_10:NOTYPE:???? "
456
457 sim_delete_policy_type 204 ricsim_g1_8 4
458
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100459 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200460 api_equal json:policy-types 5 120
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100461 api_equal json:policy-types?ric_id=ricsim_g1_8 1 120
462 else
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200463 api_equal json:policy_types 5 120
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100464 api_equal json:policy_types?ric=ricsim_g1_8 1 120
465 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200466
467 api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
468 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
469 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \
470 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3:???? \
471 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,5:???? \
472 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,5:???? \
473 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,5:???? \
474 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:5:???? \
475 ricsim_g1_9:me1_ricsim_g1_9,me2_ricsim_g1_9:5:???? \
476 ricsim_g1_10:me1_ricsim_g1_10,me2_ricsim_g1_10:NOTYPE:???? "
477
478
479
480 check_policy_agent_logs
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100481 if [[ $interface = *"SDNC"* ]]; then
482 check_sdnc_logs
483 fi
484
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200485 store_logs ${interface}
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200486
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200487done
488
489
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200490#### TEST COMPLETE ####
491
492
493print_result
494
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100495auto_clean_environment