blob: d30b31411b95598272bea562d343278c642b566d [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
23DOCKER_INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC"
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
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
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
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020043
44#### TEST BEGIN ####
45
BjornMagnussonXAad047782020-06-08 15:54:11 +020046generate_uuid
47
BjornMagnussonXA496156d2020-08-10 14:16:24 +020048use_cr_http
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020049
50NUM_RICS=10
51NUM_RICS_2=$(($NUM_RICS-2))
52
53# Tested variants of REST/SDNC config
54TESTED_VARIANTS="REST REST+SDNC"
55
56for interface in $TESTED_VARIANTS ; do
57
58 echo "#####################################################################"
59 echo "#####################################################################"
60 echo "### Testing agent: "$interface
61 echo "#####################################################################"
62 echo "#####################################################################"
63
64
65 # Clean container and start all needed containers #
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010066 clean_environment
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020067
68 #Start simulators and prepare two configs
69
70 start_ric_simulators ricsim_g1 $NUM_RICS_2 OSC_2.1.0
71
72 start_cr
73
74 start_mr
75
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010076 if [ $RUNMODE == "DOCKER" ]; then
77 start_consul_cbs
78 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020079
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +010080 # Create first config
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020081 if [[ $interface = *"SDNC"* ]]; then
82 start_sdnc
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +010083 prepare_consul_config SDNC ".consul_config_initial.json"
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020084 else
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +010085 prepare_consul_config NOSDNC ".consul_config_initial.json"
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020086 fi
87
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020088 # Create 2nd config and save for later
89 start_ric_simulators ricsim_g1 $NUM_RICS OSC_2.1.0
90
91 if [[ $interface = *"SDNC"* ]]; then
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020092 prepare_consul_config SDNC ".consul_config_all.json"
93 else
94 prepare_consul_config NOSDNC ".consul_config_all.json"
95 fi
96
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010097 start_policy_agent NORPOXY $SIM_GROUP/$POLICY_AGENT_COMPOSE_DIR/application.yaml
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020098
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +020099 set_agent_trace
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200100
101 api_get_status 200
102
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100103 # Create service to be able to receive events when rics becomes available
104 # Must use rest towards the agent since dmaap is not configured yet
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100105 api_put_service 201 "ric-registration" 0 "$CR_SERVICE_PATH/ric-registration"
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100106
107 #Load first config
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100108 if [ $RUNMODE == "KUBE" ]; then
109 agent_load_config ".consul_config_initial.json"
110 else
111 consul_config_app ".consul_config_initial.json"
112 fi
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100113
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200114 for ((i=1; i<=${NUM_RICS}; i++))
115 do
116 sim_print ricsim_g1_$i interface
117 done
118
119 # All sims running but 2 are not configured in consul
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100120 api_equal json:rics 8 300
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200121
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100122 if [ "$PMS_VERSION" == "V2" ]; then
123 cr_equal received_callbacks?id=ric-registration 8 120
124 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
125 fi
126
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200127 api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:NOTYPE:???? \
128 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:NOTYPE:???? \
129 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:NOTYPE:???? \
130 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:NOTYPE:???? \
131 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:NOTYPE:???? \
132 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:NOTYPE:???? \
133 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:NOTYPE:???? \
134 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:NOTYPE:???? "
135
136
137 sim_put_policy_type 201 ricsim_g1_1 1 testdata/OSC/sim_1.json
138 sim_put_policy_type 201 ricsim_g1_2 1 testdata/OSC/sim_1.json
139 sim_put_policy_type 201 ricsim_g1_3 1 testdata/OSC/sim_1.json
140 sim_put_policy_type 201 ricsim_g1_4 1 testdata/OSC/sim_1.json
141 sim_put_policy_type 201 ricsim_g1_5 1 testdata/OSC/sim_1.json
142
143 sim_put_policy_type 201 ricsim_g1_2 2 testdata/OSC/sim_2.json
144 sim_put_policy_type 201 ricsim_g1_3 2 testdata/OSC/sim_2.json
145 sim_put_policy_type 201 ricsim_g1_4 2 testdata/OSC/sim_2.json
146 sim_put_policy_type 201 ricsim_g1_5 2 testdata/OSC/sim_2.json
147 sim_put_policy_type 201 ricsim_g1_6 2 testdata/OSC/sim_2.json
148
149 sim_put_policy_type 201 ricsim_g1_3 3 testdata/OSC/sim_3.json
150 sim_put_policy_type 201 ricsim_g1_4 3 testdata/OSC/sim_3.json
151 sim_put_policy_type 201 ricsim_g1_5 3 testdata/OSC/sim_3.json
152 sim_put_policy_type 201 ricsim_g1_6 3 testdata/OSC/sim_3.json
153 sim_put_policy_type 201 ricsim_g1_7 3 testdata/OSC/sim_3.json
154
155 sim_put_policy_type 201 ricsim_g1_4 4 testdata/OSC/sim_4.json
156 sim_put_policy_type 201 ricsim_g1_5 4 testdata/OSC/sim_4.json
157 sim_put_policy_type 201 ricsim_g1_6 4 testdata/OSC/sim_4.json
158 sim_put_policy_type 201 ricsim_g1_7 4 testdata/OSC/sim_4.json
159 sim_put_policy_type 201 ricsim_g1_8 4 testdata/OSC/sim_4.json
160
161 sim_put_policy_type 201 ricsim_g1_5 5 testdata/OSC/sim_5.json
162 sim_put_policy_type 201 ricsim_g1_6 5 testdata/OSC/sim_5.json
163 sim_put_policy_type 201 ricsim_g1_7 5 testdata/OSC/sim_5.json
164 sim_put_policy_type 201 ricsim_g1_8 5 testdata/OSC/sim_5.json
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200165
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100166 if [ "$PMS_VERSION" == "V2" ]; then
167 api_equal json:policy-types 5 120
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200168
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100169 echo "Check the number of types in the agent for each ric"
170 api_equal json:policy-types?ric_id=ricsim_g1_1 1 120
171 api_equal json:policy-types?ric_id=ricsim_g1_2 2 120
172 api_equal json:policy-types?ric_id=ricsim_g1_3 3 120
173 api_equal json:policy-types?ric_id=ricsim_g1_4 4 120
174 api_equal json:policy-types?ric_id=ricsim_g1_5 5 120
175 api_equal json:policy-types?ric_id=ricsim_g1_6 4 120
176 api_equal json:policy-types?ric_id=ricsim_g1_7 3 120
177 api_equal json:policy-types?ric_id=ricsim_g1_8 2 120
178 else
179 api_equal json:policy_types 5 120
180
181 echo "Check the number of types in the agent for each ric"
182 api_equal json:policy_types?ric=ricsim_g1_1 1 120
183 api_equal json:policy_types?ric=ricsim_g1_2 2 120
184 api_equal json:policy_types?ric=ricsim_g1_3 3 120
185 api_equal json:policy_types?ric=ricsim_g1_4 4 120
186 api_equal json:policy_types?ric=ricsim_g1_5 5 120
187 api_equal json:policy_types?ric=ricsim_g1_6 4 120
188 api_equal json:policy_types?ric=ricsim_g1_7 3 120
189 api_equal json:policy_types?ric=ricsim_g1_8 2 120
190 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200191
192 api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
193 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
194 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \
195 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3,4:???? \
196 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,4,5:???? \
197 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,4,5:???? \
198 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,4,5:???? \
199 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:4,5:???? "
200
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100201 if [ "$PMS_VERSION" == "V2" ]; then
202 cr_equal received_callbacks?id=ric-registration 16 120
203 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
204 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200205
206 #Load config with all rics
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100207 if [ $RUNMODE == "KUBE" ]; then
208 agent_load_config ".consul_config_all.json"
209 else
210 consul_config_app ".consul_config_all.json"
211 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200212
213 api_equal json:rics 10 120
214
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100215 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100216 cr_equal received_callbacks?id=ric-registration 18 120
217 cr_api_check_all_sync_events 200 ric-registration ricsim_g1_9 ricsim_g1_10
218 fi
219
220 sim_put_policy_type 201 ricsim_g1_9 5 testdata/OSC/sim_5.json
221
222 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100223
224 echo "Check the number of types in the agent for each ric"
225 api_equal json:policy-types?ric_id=ricsim_g1_1 1 120
226 api_equal json:policy-types?ric_id=ricsim_g1_2 2 120
227 api_equal json:policy-types?ric_id=ricsim_g1_3 3 120
228 api_equal json:policy-types?ric_id=ricsim_g1_4 4 120
229 api_equal json:policy-types?ric_id=ricsim_g1_5 5 120
230 api_equal json:policy-types?ric_id=ricsim_g1_6 4 120
231 api_equal json:policy-types?ric_id=ricsim_g1_7 3 120
232 api_equal json:policy-types?ric_id=ricsim_g1_8 2 120
233 api_equal json:policy-types?ric_id=ricsim_g1_9 1 120
234 api_equal json:policy-types?ric_id=ricsim_g1_10 0 120
235 else
236
237 echo "Check the number of types in the agent for each ric"
238 api_equal json:policy_types?ric=ricsim_g1_1 1 120
239 api_equal json:policy_types?ric=ricsim_g1_2 2 120
240 api_equal json:policy_types?ric=ricsim_g1_3 3 120
241 api_equal json:policy_types?ric=ricsim_g1_4 4 120
242 api_equal json:policy_types?ric=ricsim_g1_5 5 120
243 api_equal json:policy_types?ric=ricsim_g1_6 4 120
244 api_equal json:policy_types?ric=ricsim_g1_7 3 120
245 api_equal json:policy_types?ric=ricsim_g1_8 2 120
246 api_equal json:policy_types?ric=ricsim_g1_9 1 120
247 api_equal json:policy_types?ric=ricsim_g1_10 0 120
248 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200249
250 api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
251 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
252 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \
253 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3,4:???? \
254 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,4,5:???? \
255 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,4,5:???? \
256 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,4,5:???? \
257 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:4,5:???? \
258 ricsim_g1_9:me1_ricsim_g1_9,me2_ricsim_g1_9:5:???? \
259 ricsim_g1_10:me1_ricsim_g1_10,me2_ricsim_g1_10:NOTYPE:???? "
260
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100261 if [ "$PMS_VERSION" == "V2" ]; then
262 cr_equal received_callbacks?id=ric-registration 19 120
263 cr_api_check_all_sync_events 200 ric-registration ricsim_g1_9
264 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200265
266 #No policy type in sim #10
267
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100268 if [ "$PMS_VERSION" == "V2" ]; then
269 api_equal json:policy-types 5
270 else
271 api_equal json:policy_types 5
272 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200273
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100274 api_put_service 201 "serv1" 3600 "$CR_SERVICE_PATH/serv1"
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200275
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100276 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100277 notificationurl=$CR_SERVICE_PATH"/test"
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100278 else
279 notificationurl=""
280 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200281
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100282 sleep_wait 120
283
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200284 # Load config with reduced number of rics
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100285 if [ $RUNMODE == "KUBE" ]; then
286 agent_load_config ".consul_config_initial.json"
287 else
288 consul_config_app ".consul_config_initial.json"
289 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200290
291 api_equal json:rics 8 120
292
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100293 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100294 cr_equal received_callbacks?id=ric-registration 19 120
295 cr_api_check_all_sync_events 200 ric-registration EMPTY
296 fi
297
298 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100299 echo "Check the number of types in the agent for each ric"
300 api_equal json:policy-types?ric_id=ricsim_g1_1 1 120
301 api_equal json:policy-types?ric_id=ricsim_g1_2 2 120
302 api_equal json:policy-types?ric_id=ricsim_g1_3 3 120
303 api_equal json:policy-types?ric_id=ricsim_g1_4 4 120
304 api_equal json:policy-types?ric_id=ricsim_g1_5 5 120
305 api_equal json:policy-types?ric_id=ricsim_g1_6 4 120
306 api_equal json:policy-types?ric_id=ricsim_g1_7 3 120
307 api_equal json:policy-types?ric_id=ricsim_g1_8 2 120
308 else
309 echo "Check the number of types in the agent for each ric"
310 api_equal json:policy_types?ric=ricsim_g1_1 1 120
311 api_equal json:policy_types?ric=ricsim_g1_2 2 120
312 api_equal json:policy_types?ric=ricsim_g1_3 3 120
313 api_equal json:policy_types?ric=ricsim_g1_4 4 120
314 api_equal json:policy_types?ric=ricsim_g1_5 5 120
315 api_equal json:policy_types?ric=ricsim_g1_6 4 120
316 api_equal json:policy_types?ric=ricsim_g1_7 3 120
317 api_equal json:policy_types?ric=ricsim_g1_8 2 120
318 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200319
320 api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
321 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
322 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \
323 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3,4:???? \
324 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,4,5:???? \
325 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,4,5:???? \
326 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,4,5:???? \
327 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:4,5:???? "
328
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200329 sleep_wait 120
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200330
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100331 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100332 api_equal json:policy-instances 0
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100333 else
334 api_equal json:policy_ids 0
335 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200336
337 api_get_policy_types 404 ricsim_g1_9
338
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200339 # Load config with all rics
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100340 if [ $RUNMODE == "KUBE" ]; then
341 agent_load_config ".consul_config_all.json"
342 else
343 consul_config_app ".consul_config_all.json"
344 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200345
346 api_equal json:rics 10 120
347
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100348 if [ "$PMS_VERSION" == "V2" ]; then
349 echo "Check the number of types in the agent for each ric"
350 api_equal json:policy-types?ric_id=ricsim_g1_1 1 120
351 api_equal json:policy-types?ric_id=ricsim_g1_2 2 120
352 api_equal json:policy-types?ric_id=ricsim_g1_3 3 120
353 api_equal json:policy-types?ric_id=ricsim_g1_4 4 120
354 api_equal json:policy-types?ric_id=ricsim_g1_5 5 120
355 api_equal json:policy-types?ric_id=ricsim_g1_6 4 120
356 api_equal json:policy-types?ric_id=ricsim_g1_7 3 120
357 api_equal json:policy-types?ric_id=ricsim_g1_8 2 120
358 api_equal json:policy-types?ric_id=ricsim_g1_9 1 120
359 api_equal json:policy-types?ric_id=ricsim_g1_10 0 120
360 else
361 echo "Check the number of types in the agent for each ric"
362 api_equal json:policy_types?ric=ricsim_g1_1 1 120
363 api_equal json:policy_types?ric=ricsim_g1_2 2 120
364 api_equal json:policy_types?ric=ricsim_g1_3 3 120
365 api_equal json:policy_types?ric=ricsim_g1_4 4 120
366 api_equal json:policy_types?ric=ricsim_g1_5 5 120
367 api_equal json:policy_types?ric=ricsim_g1_6 4 120
368 api_equal json:policy_types?ric=ricsim_g1_7 3 120
369 api_equal json:policy_types?ric=ricsim_g1_8 2 120
370 api_equal json:policy_types?ric=ricsim_g1_9 1 120
371 api_equal json:policy_types?ric=ricsim_g1_10 0 120
372 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200373
374 api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
375 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
376 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \
377 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3,4:???? \
378 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,4,5:???? \
379 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,4,5:???? \
380 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,4,5:???? \
381 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:4,5:???? \
382 ricsim_g1_9:me1_ricsim_g1_9,me2_ricsim_g1_9:5:???? \
383 ricsim_g1_10:me1_ricsim_g1_10,me2_ricsim_g1_10:NOTYPE:???? "
384
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200385 sleep_wait 120
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200386
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100387 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100388 api_equal json:policy-instances 0
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100389 else
390 api_equal json:policy_ids 0
391 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200392
393 sim_equal ricsim_g1_9 num_instances 0
394
395
396 sim_delete_policy_type 204 ricsim_g1_4 4
397 sim_delete_policy_type 204 ricsim_g1_5 4
398 sim_delete_policy_type 204 ricsim_g1_6 4
399 sim_delete_policy_type 204 ricsim_g1_7 4
400
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200401 sleep_wait 120
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200402
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100403 if [ "$PMS_VERSION" == "V2" ]; then
404 api_equal json:policy-types?ric_id=ricsim_g1_1 1 120
405 api_equal json:policy-types?ric_id=ricsim_g1_2 2 120
406 api_equal json:policy-types?ric_id=ricsim_g1_3 3 120
407 api_equal json:policy-types?ric_id=ricsim_g1_4 3 120
408 api_equal json:policy-types?ric_id=ricsim_g1_5 4 120
409 api_equal json:policy-types?ric_id=ricsim_g1_6 3 120
410 api_equal json:policy-types?ric_id=ricsim_g1_7 2 120
411 api_equal json:policy-types?ric_id=ricsim_g1_8 2 120
412 api_equal json:policy-types?ric_id=ricsim_g1_9 1 120
413 api_equal json:policy-types?ric_id=ricsim_g1_10 0 120
414 else
415 api_equal json:policy_types?ric=ricsim_g1_1 1 120
416 api_equal json:policy_types?ric=ricsim_g1_2 2 120
417 api_equal json:policy_types?ric=ricsim_g1_3 3 120
418 api_equal json:policy_types?ric=ricsim_g1_4 3 120
419 api_equal json:policy_types?ric=ricsim_g1_5 4 120
420 api_equal json:policy_types?ric=ricsim_g1_6 3 120
421 api_equal json:policy_types?ric=ricsim_g1_7 2 120
422 api_equal json:policy_types?ric=ricsim_g1_8 2 120
423 api_equal json:policy_types?ric=ricsim_g1_9 1 120
424 api_equal json:policy_types?ric=ricsim_g1_10 0 120
425 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200426
427 api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
428 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
429 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \
430 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3:???? \
431 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,5:???? \
432 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,5:???? \
433 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,5:???? \
434 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:4,5:???? \
435 ricsim_g1_9:me1_ricsim_g1_9,me2_ricsim_g1_9:5:???? \
436 ricsim_g1_10:me1_ricsim_g1_10,me2_ricsim_g1_10:NOTYPE:???? "
437
438 sim_delete_policy_type 204 ricsim_g1_8 4
439
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100440 if [ "$PMS_VERSION" == "V2" ]; then
441 api_equal json:policy-types?ric_id=ricsim_g1_8 1 120
442 else
443 api_equal json:policy_types?ric=ricsim_g1_8 1 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: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
458
459 check_policy_agent_logs
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100460 if [[ $interface = *"SDNC"* ]]; then
461 check_sdnc_logs
462 fi
463
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200464 store_logs ${interface}
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200465
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200466done
467
468
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200469#### TEST COMPLETE ####
470
471
472print_result
473
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100474auto_clean_environment