blob: 8cee8e5db6a9ec8e1410d709e1e6f391202bcb88 [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
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +010023DOCKER_INCLUDED_IMAGES="CBS CONSUL CP CR MR A1PMS RICSIM SDNC 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
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +010026KUBE_INCLUDED_IMAGES="CP CR MR A1PMS RICSIM SDNC KUBEPROXY"
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
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +010030#Ignore image in DOCKER_INCLUDED_IMAGES, KUBE_INCLUDED_IMAGES if
31#the image is not configured in the supplied env_file
32#Used for images not applicable to all supported profile
33CONDITIONALLY_IGNORED_IMAGES="CBS CONSUL"
34
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010035#Supported test environment profiles
BjornMagnussonXAe60d04e2021-12-27 13:38:01 +010036SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ONAP-ISTANBUL ONAP-JAKARTA ORAN-CHERRY ORAN-D-RELEASE ORAN-E-RELEASE ORAN-F-RELEASE"
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010037#Supported run modes
38SUPPORTED_RUNMODES="DOCKER KUBE"
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +010039
BjornMagnussonXA79e37002021-11-22 13:36:04 +010040. ../common/testcase_common.sh $@
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010041
42setup_testenvironment
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020043
44#### TEST BEGIN ####
45
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010046generate_policy_uuid
BjornMagnussonXAad047782020-06-08 15:54:11 +020047
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 "#####################################################################"
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +010060 echo "### Testing a1pms: "$interface
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020061 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
BjornMagnussonXA663566c2021-11-08 10:25:07 +010068 start_kube_proxy
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010069
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020070 #Start simulators and prepare two configs
71
72 start_ric_simulators ricsim_g1 $NUM_RICS_2 OSC_2.1.0
73
BjornMagnussonXA79e37002021-11-22 13:36:04 +010074 start_cr 1
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020075
76 start_mr
77
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010078 if [ $RUNMODE == "DOCKER" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +010079 if [[ "$A1PMS_FEATURE_LEVEL" != *"NOCONSUL"* ]]; then
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +010080 start_consul_cbs
81 fi
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010082 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020083
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +010084 # Create first config
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020085 if [[ $interface = *"SDNC"* ]]; then
86 start_sdnc
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +010087 prepare_consul_config SDNC ".consul_config_initial.json"
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020088 else
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +010089 prepare_consul_config NOSDNC ".consul_config_initial.json"
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020090 fi
91
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020092 # Create 2nd config and save for later
93 start_ric_simulators ricsim_g1 $NUM_RICS OSC_2.1.0
94
95 if [[ $interface = *"SDNC"* ]]; then
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020096 prepare_consul_config SDNC ".consul_config_all.json"
97 else
98 prepare_consul_config NOSDNC ".consul_config_all.json"
99 fi
100
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100101 if [ $RUNMODE == "KUBE" ] && [[ "$A1PMS_FEATURE_LEVEL" == *"INITIALCONFIGMAP"* ]]; then
102 start_a1pms NORPOXY $SIM_GROUP/$A1PMS_COMPOSE_DIR/application2.yaml
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100103 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100104 start_a1pms NORPOXY $SIM_GROUP/$A1PMS_COMPOSE_DIR/$A1PMS_CONFIG_FILE
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100105 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200106
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100107 set_a1pms_trace
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200108
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100109 a1pms_api_get_status 200
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200110
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100111 # Create service to be able to receive events when rics becomes available
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100112 # Must use rest towards the a1pms since dmaap is not configured yet
113 a1pms_api_put_service 201 "ric-registration" 0 "$CR_SERVICE_APP_PATH_0/ric-registration"
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100114
115 #Load first config
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100116 if [ $RUNMODE == "KUBE" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100117 if [[ "$A1PMS_FEATURE_LEVEL" == *"INITIALCONFIGMAP"* ]]; then
118 a1pms_api_put_configuration 200 ".consul_config_initial.json"
119 a1pms_api_get_configuration 200 ".consul_config_initial.json"
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100120 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100121 a1pms_load_config ".consul_config_initial.json"
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100122 fi
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100123 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100124 if [[ "$A1PMS_FEATURE_LEVEL" == *"NOCONSUL"* ]]; then
125 a1pms_api_put_configuration 200 ".consul_config_initial.json"
126 a1pms_api_get_configuration 200 ".consul_config_initial.json"
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100127 else
128 consul_config_app ".consul_config_initial.json"
129 fi
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100130 fi
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100131
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200132 for ((i=1; i<=${NUM_RICS}; i++))
133 do
134 sim_print ricsim_g1_$i interface
135 done
136
137 # All sims running but 2 are not configured in consul
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100138 a1pms_equal json:rics 8 300
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200139
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100140 if [ "$A1PMS_VERSION" == "V2" ]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100141 cr_equal 0 received_callbacks?id=ric-registration 8 120
142 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 +0100143 fi
144
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100145 a1pms_api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:NOTYPE:???? \
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200146 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:NOTYPE:???? \
147 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:NOTYPE:???? \
148 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:NOTYPE:???? \
149 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:NOTYPE:???? \
150 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:NOTYPE:???? \
151 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:NOTYPE:???? \
152 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:NOTYPE:???? "
153
154
155 sim_put_policy_type 201 ricsim_g1_1 1 testdata/OSC/sim_1.json
156 sim_put_policy_type 201 ricsim_g1_2 1 testdata/OSC/sim_1.json
157 sim_put_policy_type 201 ricsim_g1_3 1 testdata/OSC/sim_1.json
158 sim_put_policy_type 201 ricsim_g1_4 1 testdata/OSC/sim_1.json
159 sim_put_policy_type 201 ricsim_g1_5 1 testdata/OSC/sim_1.json
160
161 sim_put_policy_type 201 ricsim_g1_2 2 testdata/OSC/sim_2.json
162 sim_put_policy_type 201 ricsim_g1_3 2 testdata/OSC/sim_2.json
163 sim_put_policy_type 201 ricsim_g1_4 2 testdata/OSC/sim_2.json
164 sim_put_policy_type 201 ricsim_g1_5 2 testdata/OSC/sim_2.json
165 sim_put_policy_type 201 ricsim_g1_6 2 testdata/OSC/sim_2.json
166
167 sim_put_policy_type 201 ricsim_g1_3 3 testdata/OSC/sim_3.json
168 sim_put_policy_type 201 ricsim_g1_4 3 testdata/OSC/sim_3.json
169 sim_put_policy_type 201 ricsim_g1_5 3 testdata/OSC/sim_3.json
170 sim_put_policy_type 201 ricsim_g1_6 3 testdata/OSC/sim_3.json
171 sim_put_policy_type 201 ricsim_g1_7 3 testdata/OSC/sim_3.json
172
173 sim_put_policy_type 201 ricsim_g1_4 4 testdata/OSC/sim_4.json
174 sim_put_policy_type 201 ricsim_g1_5 4 testdata/OSC/sim_4.json
175 sim_put_policy_type 201 ricsim_g1_6 4 testdata/OSC/sim_4.json
176 sim_put_policy_type 201 ricsim_g1_7 4 testdata/OSC/sim_4.json
177 sim_put_policy_type 201 ricsim_g1_8 4 testdata/OSC/sim_4.json
178
179 sim_put_policy_type 201 ricsim_g1_5 5 testdata/OSC/sim_5.json
180 sim_put_policy_type 201 ricsim_g1_6 5 testdata/OSC/sim_5.json
181 sim_put_policy_type 201 ricsim_g1_7 5 testdata/OSC/sim_5.json
182 sim_put_policy_type 201 ricsim_g1_8 5 testdata/OSC/sim_5.json
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200183
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100184 if [ "$A1PMS_VERSION" == "V2" ]; then
185 a1pms_equal json:policy-types 5 120
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200186
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100187 echo "Check the number of types in the a1pms for each ric"
188 a1pms_equal json:policy-types?ric_id=ricsim_g1_1 1 120
189 a1pms_equal json:policy-types?ric_id=ricsim_g1_2 2 120
190 a1pms_equal json:policy-types?ric_id=ricsim_g1_3 3 120
191 a1pms_equal json:policy-types?ric_id=ricsim_g1_4 4 120
192 a1pms_equal json:policy-types?ric_id=ricsim_g1_5 5 120
193 a1pms_equal json:policy-types?ric_id=ricsim_g1_6 4 120
194 a1pms_equal json:policy-types?ric_id=ricsim_g1_7 3 120
195 a1pms_equal json:policy-types?ric_id=ricsim_g1_8 2 120
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100196 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100197 a1pms_equal json:policy_types 5 120
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100198
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100199 echo "Check the number of types in the a1pms for each ric"
200 a1pms_equal json:policy_types?ric=ricsim_g1_1 1 120
201 a1pms_equal json:policy_types?ric=ricsim_g1_2 2 120
202 a1pms_equal json:policy_types?ric=ricsim_g1_3 3 120
203 a1pms_equal json:policy_types?ric=ricsim_g1_4 4 120
204 a1pms_equal json:policy_types?ric=ricsim_g1_5 5 120
205 a1pms_equal json:policy_types?ric=ricsim_g1_6 4 120
206 a1pms_equal json:policy_types?ric=ricsim_g1_7 3 120
207 a1pms_equal json:policy_types?ric=ricsim_g1_8 2 120
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100208 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200209
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100210 a1pms_api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200211 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
212 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \
213 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3,4:???? \
214 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,4,5:???? \
215 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,4,5:???? \
216 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,4,5:???? \
217 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:4,5:???? "
218
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100219 if [ "$A1PMS_VERSION" == "V2" ]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100220 cr_equal 0 received_callbacks?id=ric-registration 16 120
221 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 +0100222 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200223
224 #Load config with all rics
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100225 if [ $RUNMODE == "KUBE" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100226 if [[ "$A1PMS_FEATURE_LEVEL" == *"INITIALCONFIGMAP"* ]]; then
227 a1pms_api_put_configuration 200 ".consul_config_all.json"
228 a1pms_api_get_configuration 200 ".consul_config_all.json"
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100229 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100230 a1pms_load_config ".consul_config_all.json"
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100231 fi
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100232 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100233 if [[ "$A1PMS_FEATURE_LEVEL" == *"NOCONSUL"* ]]; then
234 a1pms_api_put_configuration 200 ".consul_config_all.json"
235 a1pms_api_get_configuration 200 ".consul_config_all.json"
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100236 else
237 consul_config_app ".consul_config_all.json"
238 fi
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100239 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200240
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100241 a1pms_equal json:rics 10 120
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200242
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100243 if [ "$A1PMS_VERSION" == "V2" ]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100244 cr_equal 0 received_callbacks?id=ric-registration 18 120
245 cr_api_check_all_sync_events 200 0 ric-registration ricsim_g1_9 ricsim_g1_10
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100246 fi
247
248 sim_put_policy_type 201 ricsim_g1_9 5 testdata/OSC/sim_5.json
249
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100250 if [ "$A1PMS_VERSION" == "V2" ]; then
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100251
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100252 a1pms_equal json:policy-types 5 120
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200253
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100254 echo "Check the number of types in the a1pms for each ric"
255 a1pms_equal json:policy-types?ric_id=ricsim_g1_1 1 120
256 a1pms_equal json:policy-types?ric_id=ricsim_g1_2 2 120
257 a1pms_equal json:policy-types?ric_id=ricsim_g1_3 3 120
258 a1pms_equal json:policy-types?ric_id=ricsim_g1_4 4 120
259 a1pms_equal json:policy-types?ric_id=ricsim_g1_5 5 120
260 a1pms_equal json:policy-types?ric_id=ricsim_g1_6 4 120
261 a1pms_equal json:policy-types?ric_id=ricsim_g1_7 3 120
262 a1pms_equal json:policy-types?ric_id=ricsim_g1_8 2 120
263 a1pms_equal json:policy-types?ric_id=ricsim_g1_9 1 120
264 a1pms_equal json:policy-types?ric_id=ricsim_g1_10 0 120
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100265 else
266
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100267 a1pms_equal json:policy_types 5 120
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200268
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100269 echo "Check the number of types in the a1pms for each ric"
270 a1pms_equal json:policy_types?ric=ricsim_g1_1 1 120
271 a1pms_equal json:policy_types?ric=ricsim_g1_2 2 120
272 a1pms_equal json:policy_types?ric=ricsim_g1_3 3 120
273 a1pms_equal json:policy_types?ric=ricsim_g1_4 4 120
274 a1pms_equal json:policy_types?ric=ricsim_g1_5 5 120
275 a1pms_equal json:policy_types?ric=ricsim_g1_6 4 120
276 a1pms_equal json:policy_types?ric=ricsim_g1_7 3 120
277 a1pms_equal json:policy_types?ric=ricsim_g1_8 2 120
278 a1pms_equal json:policy_types?ric=ricsim_g1_9 1 120
279 a1pms_equal json:policy_types?ric=ricsim_g1_10 0 120
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100280 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200281
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100282 a1pms_api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200283 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
284 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \
285 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3,4:???? \
286 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,4,5:???? \
287 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,4,5:???? \
288 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,4,5:???? \
289 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:4,5:???? \
290 ricsim_g1_9:me1_ricsim_g1_9,me2_ricsim_g1_9:5:???? \
291 ricsim_g1_10:me1_ricsim_g1_10,me2_ricsim_g1_10:NOTYPE:???? "
292
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100293 if [ "$A1PMS_VERSION" == "V2" ]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100294 cr_equal 0 received_callbacks?id=ric-registration 19 120
295 cr_api_check_all_sync_events 200 0 ric-registration ricsim_g1_9
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100296 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200297
298 #No policy type in sim #10
299
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100300 if [ "$A1PMS_VERSION" == "V2" ]; then
301 a1pms_equal json:policy-types 5
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100302 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100303 a1pms_equal json:policy_types 5
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100304 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200305
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100306 a1pms_api_put_service 201 "serv1" 3600 "$CR_SERVICE_APP_PATH_0/serv1"
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200307
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100308 if [ "$A1PMS_VERSION" == "V2" ]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100309 notificationurl=$CR_SERVICE_APP_PATH_0"/test"
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100310 else
311 notificationurl=""
312 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200313
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100314 sleep_wait 120
315
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200316 # Load config with reduced number of rics
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100317 if [ $RUNMODE == "KUBE" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100318 if [[ "$A1PMS_FEATURE_LEVEL" == *"INITIALCONFIGMAP"* ]]; then
319 a1pms_api_put_configuration 200 ".consul_config_initial.json"
320 a1pms_api_get_configuration 200 ".consul_config_initial.json"
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100321 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100322 a1pms_load_config ".consul_config_initial.json"
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100323 fi
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100324 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100325 if [[ "$A1PMS_FEATURE_LEVEL" == *"NOCONSUL"* ]]; then
326 a1pms_api_put_configuration 200 ".consul_config_initial.json"
327 a1pms_api_get_configuration 200 ".consul_config_initial.json"
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100328 else
329 consul_config_app ".consul_config_initial.json"
330 fi
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100331 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200332
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100333 a1pms_equal json:rics 8 120
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200334
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100335 if [ "$A1PMS_VERSION" == "V2" ]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100336 cr_equal 0 received_callbacks?id=ric-registration 19 120
337 cr_api_check_all_sync_events 200 0 ric-registration EMPTY
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100338 fi
339
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100340 if [ "$A1PMS_VERSION" == "V2" ]; then
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200341
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100342 a1pms_equal json:policy-types 5 120
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200343
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100344 echo "Check the number of types in the a1pms for each ric"
345 a1pms_equal json:policy-types?ric_id=ricsim_g1_1 1 120
346 a1pms_equal json:policy-types?ric_id=ricsim_g1_2 2 120
347 a1pms_equal json:policy-types?ric_id=ricsim_g1_3 3 120
348 a1pms_equal json:policy-types?ric_id=ricsim_g1_4 4 120
349 a1pms_equal json:policy-types?ric_id=ricsim_g1_5 5 120
350 a1pms_equal json:policy-types?ric_id=ricsim_g1_6 4 120
351 a1pms_equal json:policy-types?ric_id=ricsim_g1_7 3 120
352 a1pms_equal json:policy-types?ric_id=ricsim_g1_8 2 120
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100353 else
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200354
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100355 a1pms_equal json:policy_types 5 120
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200356
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100357 echo "Check the number of types in the a1pms for each ric"
358 a1pms_equal json:policy_types?ric=ricsim_g1_1 1 120
359 a1pms_equal json:policy_types?ric=ricsim_g1_2 2 120
360 a1pms_equal json:policy_types?ric=ricsim_g1_3 3 120
361 a1pms_equal json:policy_types?ric=ricsim_g1_4 4 120
362 a1pms_equal json:policy_types?ric=ricsim_g1_5 5 120
363 a1pms_equal json:policy_types?ric=ricsim_g1_6 4 120
364 a1pms_equal json:policy_types?ric=ricsim_g1_7 3 120
365 a1pms_equal json:policy_types?ric=ricsim_g1_8 2 120
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100366 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200367
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100368 a1pms_api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200369 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
370 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \
371 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3,4:???? \
372 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,4,5:???? \
373 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,4,5:???? \
374 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,4,5:???? \
375 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:4,5:???? "
376
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200377 sleep_wait 120
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200378
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100379 if [ "$A1PMS_VERSION" == "V2" ]; then
380 a1pms_equal json:policy-instances 0
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100381 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100382 a1pms_equal json:policy_ids 0
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100383 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200384
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100385 a1pms_api_get_policy_types 404 ricsim_g1_9
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200386
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200387 # Load config with all rics
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100388 if [ $RUNMODE == "KUBE" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100389 if [[ "$A1PMS_FEATURE_LEVEL" == *"INITIALCONFIGMAP"* ]]; then
390 a1pms_api_put_configuration 200 ".consul_config_all.json"
391 a1pms_api_get_configuration 200 ".consul_config_all.json"
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100392 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100393 a1pms_load_config ".consul_config_all.json"
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100394 fi
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100395 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100396 if [[ "$A1PMS_FEATURE_LEVEL" == *"NOCONSUL"* ]]; then
397 a1pms_api_put_configuration 200 ".consul_config_all.json"
398 a1pms_api_get_configuration 200 ".consul_config_all.json"
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100399 else
400 consul_config_app ".consul_config_all.json"
401 fi
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100402 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200403
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100404 a1pms_equal json:rics 10 120
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200405
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100406 if [ "$A1PMS_VERSION" == "V2" ]; then
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200407
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100408 a1pms_equal json:policy-types 5 120
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200409
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100410 echo "Check the number of types in the a1pms for each ric"
411 a1pms_equal json:policy-types?ric_id=ricsim_g1_1 1 120
412 a1pms_equal json:policy-types?ric_id=ricsim_g1_2 2 120
413 a1pms_equal json:policy-types?ric_id=ricsim_g1_3 3 120
414 a1pms_equal json:policy-types?ric_id=ricsim_g1_4 4 120
415 a1pms_equal json:policy-types?ric_id=ricsim_g1_5 5 120
416 a1pms_equal json:policy-types?ric_id=ricsim_g1_6 4 120
417 a1pms_equal json:policy-types?ric_id=ricsim_g1_7 3 120
418 a1pms_equal json:policy-types?ric_id=ricsim_g1_8 2 120
419 a1pms_equal json:policy-types?ric_id=ricsim_g1_9 1 120
420 a1pms_equal json:policy-types?ric_id=ricsim_g1_10 0 120
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100421 else
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200422
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100423 a1pms_equal json:policy_types 5 120
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200424
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100425 echo "Check the number of types in the a1pms for each ric"
426 a1pms_equal json:policy_types?ric=ricsim_g1_1 1 120
427 a1pms_equal json:policy_types?ric=ricsim_g1_2 2 120
428 a1pms_equal json:policy_types?ric=ricsim_g1_3 3 120
429 a1pms_equal json:policy_types?ric=ricsim_g1_4 4 120
430 a1pms_equal json:policy_types?ric=ricsim_g1_5 5 120
431 a1pms_equal json:policy_types?ric=ricsim_g1_6 4 120
432 a1pms_equal json:policy_types?ric=ricsim_g1_7 3 120
433 a1pms_equal json:policy_types?ric=ricsim_g1_8 2 120
434 a1pms_equal json:policy_types?ric=ricsim_g1_9 1 120
435 a1pms_equal json:policy_types?ric=ricsim_g1_10 0 120
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100436 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200437
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100438 a1pms_api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200439 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
440 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \
441 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3,4:???? \
442 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,4,5:???? \
443 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,4,5:???? \
444 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,4,5:???? \
445 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:4,5:???? \
446 ricsim_g1_9:me1_ricsim_g1_9,me2_ricsim_g1_9:5:???? \
447 ricsim_g1_10:me1_ricsim_g1_10,me2_ricsim_g1_10:NOTYPE:???? "
448
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200449 sleep_wait 120
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200450
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100451 if [ "$A1PMS_VERSION" == "V2" ]; then
452 a1pms_equal json:policy-instances 0
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100453 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100454 a1pms_equal json:policy_ids 0
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100455 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200456
457 sim_equal ricsim_g1_9 num_instances 0
458
459
460 sim_delete_policy_type 204 ricsim_g1_4 4
461 sim_delete_policy_type 204 ricsim_g1_5 4
462 sim_delete_policy_type 204 ricsim_g1_6 4
463 sim_delete_policy_type 204 ricsim_g1_7 4
464
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200465 sleep_wait 120
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200466
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100467 if [ "$A1PMS_VERSION" == "V2" ]; then
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200468
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100469 a1pms_equal json:policy-types 5 120
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200470
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100471 a1pms_equal json:policy-types?ric_id=ricsim_g1_1 1 120
472 a1pms_equal json:policy-types?ric_id=ricsim_g1_2 2 120
473 a1pms_equal json:policy-types?ric_id=ricsim_g1_3 3 120
474 a1pms_equal json:policy-types?ric_id=ricsim_g1_4 3 120
475 a1pms_equal json:policy-types?ric_id=ricsim_g1_5 4 120
476 a1pms_equal json:policy-types?ric_id=ricsim_g1_6 3 120
477 a1pms_equal json:policy-types?ric_id=ricsim_g1_7 2 120
478 a1pms_equal json:policy-types?ric_id=ricsim_g1_8 2 120
479 a1pms_equal json:policy-types?ric_id=ricsim_g1_9 1 120
480 a1pms_equal json:policy-types?ric_id=ricsim_g1_10 0 120
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100481 else
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200482
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100483 a1pms_equal json:policy_types 5 120
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200484
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100485 a1pms_equal json:policy_types?ric=ricsim_g1_1 1 120
486 a1pms_equal json:policy_types?ric=ricsim_g1_2 2 120
487 a1pms_equal json:policy_types?ric=ricsim_g1_3 3 120
488 a1pms_equal json:policy_types?ric=ricsim_g1_4 3 120
489 a1pms_equal json:policy_types?ric=ricsim_g1_5 4 120
490 a1pms_equal json:policy_types?ric=ricsim_g1_6 3 120
491 a1pms_equal json:policy_types?ric=ricsim_g1_7 2 120
492 a1pms_equal json:policy_types?ric=ricsim_g1_8 2 120
493 a1pms_equal json:policy_types?ric=ricsim_g1_9 1 120
494 a1pms_equal json:policy_types?ric=ricsim_g1_10 0 120
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100495 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200496
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100497 a1pms_api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200498 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
499 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \
500 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3:???? \
501 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,5:???? \
502 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,5:???? \
503 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,5:???? \
504 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:4,5:???? \
505 ricsim_g1_9:me1_ricsim_g1_9,me2_ricsim_g1_9:5:???? \
506 ricsim_g1_10:me1_ricsim_g1_10,me2_ricsim_g1_10:NOTYPE:???? "
507
508 sim_delete_policy_type 204 ricsim_g1_8 4
509
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100510 if [ "$A1PMS_VERSION" == "V2" ]; then
511 a1pms_equal json:policy-types 5 120
512 a1pms_equal json:policy-types?ric_id=ricsim_g1_8 1 120
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100513 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100514 a1pms_equal json:policy_types 5 120
515 a1pms_equal json:policy_types?ric=ricsim_g1_8 1 120
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100516 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200517
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100518 a1pms_api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200519 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
520 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \
521 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3:???? \
522 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,5:???? \
523 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,5:???? \
524 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,5:???? \
525 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:5:???? \
526 ricsim_g1_9:me1_ricsim_g1_9,me2_ricsim_g1_9:5:???? \
527 ricsim_g1_10:me1_ricsim_g1_10,me2_ricsim_g1_10:NOTYPE:???? "
528
529
530
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100531 check_a1pms_logs
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100532 if [[ $interface = *"SDNC"* ]]; then
533 check_sdnc_logs
534 fi
535
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200536 store_logs ${interface}
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200537
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200538done
539
540
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200541#### TEST COMPLETE ####
542
543
544print_result
545
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100546auto_clean_environment