blob: 959f00f8490391dc2fb625f9685510199936db67 [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
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +020022#App names to include in the test, space separated list
23INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC"
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020024
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +010025#SUPPORTED TEST ENV FILE
26SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN"
27
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020028. ../common/testcase_common.sh $@
29. ../common/agent_api_functions.sh
30. ../common/ricsimulator_api_functions.sh
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +010031. ../common/cr_api_functions.sh
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020032
33#### TEST BEGIN ####
34
BjornMagnussonXAad047782020-06-08 15:54:11 +020035generate_uuid
36
BjornMagnussonXA496156d2020-08-10 14:16:24 +020037use_cr_http
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020038
39NUM_RICS=10
40NUM_RICS_2=$(($NUM_RICS-2))
41
42# Tested variants of REST/SDNC config
43TESTED_VARIANTS="REST REST+SDNC"
44
45for interface in $TESTED_VARIANTS ; do
46
47 echo "#####################################################################"
48 echo "#####################################################################"
49 echo "### Testing agent: "$interface
50 echo "#####################################################################"
51 echo "#####################################################################"
52
53
54 # Clean container and start all needed containers #
55 clean_containers
56
57 #Start simulators and prepare two configs
58
59 start_ric_simulators ricsim_g1 $NUM_RICS_2 OSC_2.1.0
60
61 start_cr
62
63 start_mr
64
65 start_consul_cbs
66
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +010067 # Create first config
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020068 if [[ $interface = *"SDNC"* ]]; then
69 start_sdnc
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +010070 prepare_consul_config SDNC ".consul_config_initial.json"
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020071 else
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +010072 prepare_consul_config NOSDNC ".consul_config_initial.json"
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020073 fi
74
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020075 # Create 2nd config and save for later
76 start_ric_simulators ricsim_g1 $NUM_RICS OSC_2.1.0
77
78 if [[ $interface = *"SDNC"* ]]; then
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020079 prepare_consul_config SDNC ".consul_config_all.json"
80 else
81 prepare_consul_config NOSDNC ".consul_config_all.json"
82 fi
83
84 start_policy_agent
85
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +020086 set_agent_trace
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020087
88 api_get_status 200
89
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +010090 # Create service to be able to receive events when rics becomes available
91 # Must use rest towards the agent since dmaap is not configured yet
92 api_put_service 201 "ric-registration" 0 "$CR_PATH/ric-registration"
93
94 #Load first config
95 consul_config_app ".consul_config_initial.json"
96
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020097 for ((i=1; i<=${NUM_RICS}; i++))
98 do
99 sim_print ricsim_g1_$i interface
100 done
101
102 # All sims running but 2 are not configured in consul
103 api_equal json:rics 8 120
104
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100105 if [ "$PMS_VERSION" == "V2" ]; then
106 cr_equal received_callbacks?id=ric-registration 8 120
107 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
108 fi
109
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200110 api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:NOTYPE:???? \
111 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:NOTYPE:???? \
112 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:NOTYPE:???? \
113 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:NOTYPE:???? \
114 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:NOTYPE:???? \
115 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:NOTYPE:???? \
116 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:NOTYPE:???? \
117 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:NOTYPE:???? "
118
119
120 sim_put_policy_type 201 ricsim_g1_1 1 testdata/OSC/sim_1.json
121 sim_put_policy_type 201 ricsim_g1_2 1 testdata/OSC/sim_1.json
122 sim_put_policy_type 201 ricsim_g1_3 1 testdata/OSC/sim_1.json
123 sim_put_policy_type 201 ricsim_g1_4 1 testdata/OSC/sim_1.json
124 sim_put_policy_type 201 ricsim_g1_5 1 testdata/OSC/sim_1.json
125
126 sim_put_policy_type 201 ricsim_g1_2 2 testdata/OSC/sim_2.json
127 sim_put_policy_type 201 ricsim_g1_3 2 testdata/OSC/sim_2.json
128 sim_put_policy_type 201 ricsim_g1_4 2 testdata/OSC/sim_2.json
129 sim_put_policy_type 201 ricsim_g1_5 2 testdata/OSC/sim_2.json
130 sim_put_policy_type 201 ricsim_g1_6 2 testdata/OSC/sim_2.json
131
132 sim_put_policy_type 201 ricsim_g1_3 3 testdata/OSC/sim_3.json
133 sim_put_policy_type 201 ricsim_g1_4 3 testdata/OSC/sim_3.json
134 sim_put_policy_type 201 ricsim_g1_5 3 testdata/OSC/sim_3.json
135 sim_put_policy_type 201 ricsim_g1_6 3 testdata/OSC/sim_3.json
136 sim_put_policy_type 201 ricsim_g1_7 3 testdata/OSC/sim_3.json
137
138 sim_put_policy_type 201 ricsim_g1_4 4 testdata/OSC/sim_4.json
139 sim_put_policy_type 201 ricsim_g1_5 4 testdata/OSC/sim_4.json
140 sim_put_policy_type 201 ricsim_g1_6 4 testdata/OSC/sim_4.json
141 sim_put_policy_type 201 ricsim_g1_7 4 testdata/OSC/sim_4.json
142 sim_put_policy_type 201 ricsim_g1_8 4 testdata/OSC/sim_4.json
143
144 sim_put_policy_type 201 ricsim_g1_5 5 testdata/OSC/sim_5.json
145 sim_put_policy_type 201 ricsim_g1_6 5 testdata/OSC/sim_5.json
146 sim_put_policy_type 201 ricsim_g1_7 5 testdata/OSC/sim_5.json
147 sim_put_policy_type 201 ricsim_g1_8 5 testdata/OSC/sim_5.json
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200148
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100149 if [ "$PMS_VERSION" == "V2" ]; then
150 api_equal json:policy-types 5 120
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200151
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100152 echo "Check the number of types in the agent for each ric"
153 api_equal json:policy-types?ric_id=ricsim_g1_1 1 120
154 api_equal json:policy-types?ric_id=ricsim_g1_2 2 120
155 api_equal json:policy-types?ric_id=ricsim_g1_3 3 120
156 api_equal json:policy-types?ric_id=ricsim_g1_4 4 120
157 api_equal json:policy-types?ric_id=ricsim_g1_5 5 120
158 api_equal json:policy-types?ric_id=ricsim_g1_6 4 120
159 api_equal json:policy-types?ric_id=ricsim_g1_7 3 120
160 api_equal json:policy-types?ric_id=ricsim_g1_8 2 120
161 else
162 api_equal json:policy_types 5 120
163
164 echo "Check the number of types in the agent for each ric"
165 api_equal json:policy_types?ric=ricsim_g1_1 1 120
166 api_equal json:policy_types?ric=ricsim_g1_2 2 120
167 api_equal json:policy_types?ric=ricsim_g1_3 3 120
168 api_equal json:policy_types?ric=ricsim_g1_4 4 120
169 api_equal json:policy_types?ric=ricsim_g1_5 5 120
170 api_equal json:policy_types?ric=ricsim_g1_6 4 120
171 api_equal json:policy_types?ric=ricsim_g1_7 3 120
172 api_equal json:policy_types?ric=ricsim_g1_8 2 120
173 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200174
175 api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
176 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
177 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \
178 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3,4:???? \
179 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,4,5:???? \
180 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,4,5:???? \
181 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,4,5:???? \
182 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:4,5:???? "
183
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100184 if [ "$PMS_VERSION" == "V2" ]; then
185 cr_equal received_callbacks?id=ric-registration 16 120
186 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
187 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200188
189 #Load config with all rics
190 consul_config_app ".consul_config_all.json"
191
192 api_equal json:rics 10 120
193
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100194 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100195 cr_equal received_callbacks?id=ric-registration 18 120
196 cr_api_check_all_sync_events 200 ric-registration ricsim_g1_9 ricsim_g1_10
197 fi
198
199 sim_put_policy_type 201 ricsim_g1_9 5 testdata/OSC/sim_5.json
200
201 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100202
203 echo "Check the number of types in the agent for each ric"
204 api_equal json:policy-types?ric_id=ricsim_g1_1 1 120
205 api_equal json:policy-types?ric_id=ricsim_g1_2 2 120
206 api_equal json:policy-types?ric_id=ricsim_g1_3 3 120
207 api_equal json:policy-types?ric_id=ricsim_g1_4 4 120
208 api_equal json:policy-types?ric_id=ricsim_g1_5 5 120
209 api_equal json:policy-types?ric_id=ricsim_g1_6 4 120
210 api_equal json:policy-types?ric_id=ricsim_g1_7 3 120
211 api_equal json:policy-types?ric_id=ricsim_g1_8 2 120
212 api_equal json:policy-types?ric_id=ricsim_g1_9 1 120
213 api_equal json:policy-types?ric_id=ricsim_g1_10 0 120
214 else
215
216 echo "Check the number of types in the agent for each ric"
217 api_equal json:policy_types?ric=ricsim_g1_1 1 120
218 api_equal json:policy_types?ric=ricsim_g1_2 2 120
219 api_equal json:policy_types?ric=ricsim_g1_3 3 120
220 api_equal json:policy_types?ric=ricsim_g1_4 4 120
221 api_equal json:policy_types?ric=ricsim_g1_5 5 120
222 api_equal json:policy_types?ric=ricsim_g1_6 4 120
223 api_equal json:policy_types?ric=ricsim_g1_7 3 120
224 api_equal json:policy_types?ric=ricsim_g1_8 2 120
225 api_equal json:policy_types?ric=ricsim_g1_9 1 120
226 api_equal json:policy_types?ric=ricsim_g1_10 0 120
227 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200228
229 api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
230 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
231 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \
232 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3,4:???? \
233 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,4,5:???? \
234 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,4,5:???? \
235 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,4,5:???? \
236 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:4,5:???? \
237 ricsim_g1_9:me1_ricsim_g1_9,me2_ricsim_g1_9:5:???? \
238 ricsim_g1_10:me1_ricsim_g1_10,me2_ricsim_g1_10:NOTYPE:???? "
239
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100240 if [ "$PMS_VERSION" == "V2" ]; then
241 cr_equal received_callbacks?id=ric-registration 19 120
242 cr_api_check_all_sync_events 200 ric-registration ricsim_g1_9
243 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200244
245 #No policy type in sim #10
246
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100247 if [ "$PMS_VERSION" == "V2" ]; then
248 api_equal json:policy-types 5
249 else
250 api_equal json:policy_types 5
251 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200252
253 api_put_service 201 "serv1" 3600 "$CR_PATH/serv1"
254
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100255 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100256 notificationurl=$CR_PATH"/test"
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100257 else
258 notificationurl=""
259 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200260
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100261 sleep_wait 120
262
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200263 # Load config with reduced number of rics
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100264 consul_config_app ".consul_config_initial.json"
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200265
266 api_equal json:rics 8 120
267
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100268 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100269 cr_equal received_callbacks?id=ric-registration 19 120
270 cr_api_check_all_sync_events 200 ric-registration EMPTY
271 fi
272
273 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100274 echo "Check the number of types in the agent for each ric"
275 api_equal json:policy-types?ric_id=ricsim_g1_1 1 120
276 api_equal json:policy-types?ric_id=ricsim_g1_2 2 120
277 api_equal json:policy-types?ric_id=ricsim_g1_3 3 120
278 api_equal json:policy-types?ric_id=ricsim_g1_4 4 120
279 api_equal json:policy-types?ric_id=ricsim_g1_5 5 120
280 api_equal json:policy-types?ric_id=ricsim_g1_6 4 120
281 api_equal json:policy-types?ric_id=ricsim_g1_7 3 120
282 api_equal json:policy-types?ric_id=ricsim_g1_8 2 120
283 else
284 echo "Check the number of types in the agent for each ric"
285 api_equal json:policy_types?ric=ricsim_g1_1 1 120
286 api_equal json:policy_types?ric=ricsim_g1_2 2 120
287 api_equal json:policy_types?ric=ricsim_g1_3 3 120
288 api_equal json:policy_types?ric=ricsim_g1_4 4 120
289 api_equal json:policy_types?ric=ricsim_g1_5 5 120
290 api_equal json:policy_types?ric=ricsim_g1_6 4 120
291 api_equal json:policy_types?ric=ricsim_g1_7 3 120
292 api_equal json:policy_types?ric=ricsim_g1_8 2 120
293 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200294
295 api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
296 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
297 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \
298 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3,4:???? \
299 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,4,5:???? \
300 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,4,5:???? \
301 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,4,5:???? \
302 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:4,5:???? "
303
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200304 sleep_wait 120
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200305
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100306 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100307 api_equal json:policy-instances 0
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100308 else
309 api_equal json:policy_ids 0
310 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200311
312 api_get_policy_types 404 ricsim_g1_9
313
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200314 # Load config with all rics
315 consul_config_app ".consul_config_all.json"
316
317 api_equal json:rics 10 120
318
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100319 if [ "$PMS_VERSION" == "V2" ]; then
320 echo "Check the number of types in the agent for each ric"
321 api_equal json:policy-types?ric_id=ricsim_g1_1 1 120
322 api_equal json:policy-types?ric_id=ricsim_g1_2 2 120
323 api_equal json:policy-types?ric_id=ricsim_g1_3 3 120
324 api_equal json:policy-types?ric_id=ricsim_g1_4 4 120
325 api_equal json:policy-types?ric_id=ricsim_g1_5 5 120
326 api_equal json:policy-types?ric_id=ricsim_g1_6 4 120
327 api_equal json:policy-types?ric_id=ricsim_g1_7 3 120
328 api_equal json:policy-types?ric_id=ricsim_g1_8 2 120
329 api_equal json:policy-types?ric_id=ricsim_g1_9 1 120
330 api_equal json:policy-types?ric_id=ricsim_g1_10 0 120
331 else
332 echo "Check the number of types in the agent for each ric"
333 api_equal json:policy_types?ric=ricsim_g1_1 1 120
334 api_equal json:policy_types?ric=ricsim_g1_2 2 120
335 api_equal json:policy_types?ric=ricsim_g1_3 3 120
336 api_equal json:policy_types?ric=ricsim_g1_4 4 120
337 api_equal json:policy_types?ric=ricsim_g1_5 5 120
338 api_equal json:policy_types?ric=ricsim_g1_6 4 120
339 api_equal json:policy_types?ric=ricsim_g1_7 3 120
340 api_equal json:policy_types?ric=ricsim_g1_8 2 120
341 api_equal json:policy_types?ric=ricsim_g1_9 1 120
342 api_equal json:policy_types?ric=ricsim_g1_10 0 120
343 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200344
345 api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
346 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
347 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \
348 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3,4:???? \
349 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,4,5:???? \
350 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,4,5:???? \
351 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,4,5:???? \
352 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:4,5:???? \
353 ricsim_g1_9:me1_ricsim_g1_9,me2_ricsim_g1_9:5:???? \
354 ricsim_g1_10:me1_ricsim_g1_10,me2_ricsim_g1_10:NOTYPE:???? "
355
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200356 sleep_wait 120
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200357
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100358 if [ "$PMS_VERSION" == "V2" ]; then
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100359 api_equal json:policy-instances 0
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100360 else
361 api_equal json:policy_ids 0
362 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200363
364 sim_equal ricsim_g1_9 num_instances 0
365
366
367 sim_delete_policy_type 204 ricsim_g1_4 4
368 sim_delete_policy_type 204 ricsim_g1_5 4
369 sim_delete_policy_type 204 ricsim_g1_6 4
370 sim_delete_policy_type 204 ricsim_g1_7 4
371
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200372 sleep_wait 120
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200373
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100374 if [ "$PMS_VERSION" == "V2" ]; then
375 api_equal json:policy-types?ric_id=ricsim_g1_1 1 120
376 api_equal json:policy-types?ric_id=ricsim_g1_2 2 120
377 api_equal json:policy-types?ric_id=ricsim_g1_3 3 120
378 api_equal json:policy-types?ric_id=ricsim_g1_4 3 120
379 api_equal json:policy-types?ric_id=ricsim_g1_5 4 120
380 api_equal json:policy-types?ric_id=ricsim_g1_6 3 120
381 api_equal json:policy-types?ric_id=ricsim_g1_7 2 120
382 api_equal json:policy-types?ric_id=ricsim_g1_8 2 120
383 api_equal json:policy-types?ric_id=ricsim_g1_9 1 120
384 api_equal json:policy-types?ric_id=ricsim_g1_10 0 120
385 else
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 3 120
390 api_equal json:policy_types?ric=ricsim_g1_5 4 120
391 api_equal json:policy_types?ric=ricsim_g1_6 3 120
392 api_equal json:policy_types?ric=ricsim_g1_7 2 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:???? \
402 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,5:???? \
403 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,5:???? \
404 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,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
409 sim_delete_policy_type 204 ricsim_g1_8 4
410
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100411 if [ "$PMS_VERSION" == "V2" ]; then
412 api_equal json:policy-types?ric_id=ricsim_g1_8 1 120
413 else
414 api_equal json:policy_types?ric=ricsim_g1_8 1 120
415 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200416
417 api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
418 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
419 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \
420 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3:???? \
421 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,5:???? \
422 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,5:???? \
423 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,5:???? \
424 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:5:???? \
425 ricsim_g1_9:me1_ricsim_g1_9,me2_ricsim_g1_9:5:???? \
426 ricsim_g1_10:me1_ricsim_g1_10,me2_ricsim_g1_10:NOTYPE:???? "
427
428
429
430 check_policy_agent_logs
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100431 if [[ $interface = *"SDNC"* ]]; then
432 check_sdnc_logs
433 fi
434
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200435 store_logs ${interface}
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200436
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200437done
438
439
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200440#### TEST COMPLETE ####
441
442
443print_result
444
445auto_clean_containers