blob: 5188eefaad4d50b891a82996235a96fca3cca452 [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
BjornMagnussonXAf81090f2022-08-24 09:17:44 +020084 __CONFIG_HEADER="NOHEADER"
85 if [ $RUNMODE == "KUBE" ]; then
86 __CONFIG_HEADER="HEADER"
87 else
88 if [[ "$A1PMS_FEATURE_LEVEL" == *"NOCONSUL"* ]]; then
89 __CONFIG_HEADER="HEADER"
90 fi
91 fi
92
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +010093 # Create first config
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020094 if [[ $interface = *"SDNC"* ]]; then
95 start_sdnc
BjornMagnussonXAf81090f2022-08-24 09:17:44 +020096 prepare_consul_config SDNC ".consul_config_initial.json" $__CONFIG_HEADER
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020097 else
BjornMagnussonXAf81090f2022-08-24 09:17:44 +020098 prepare_consul_config NOSDNC ".consul_config_initial.json" $__CONFIG_HEADER
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020099 fi
100
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200101 # Create 2nd config and save for later
102 start_ric_simulators ricsim_g1 $NUM_RICS OSC_2.1.0
103
104 if [[ $interface = *"SDNC"* ]]; then
BjornMagnussonXAf81090f2022-08-24 09:17:44 +0200105 prepare_consul_config SDNC ".consul_config_all.json" $__CONFIG_HEADER
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200106 else
BjornMagnussonXAf81090f2022-08-24 09:17:44 +0200107 prepare_consul_config NOSDNC ".consul_config_all.json" $__CONFIG_HEADER
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200108 fi
109
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100110 if [ $RUNMODE == "KUBE" ] && [[ "$A1PMS_FEATURE_LEVEL" == *"INITIALCONFIGMAP"* ]]; then
111 start_a1pms NORPOXY $SIM_GROUP/$A1PMS_COMPOSE_DIR/application2.yaml
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100112 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100113 start_a1pms NORPOXY $SIM_GROUP/$A1PMS_COMPOSE_DIR/$A1PMS_CONFIG_FILE
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100114 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200115
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100116 set_a1pms_trace
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200117
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100118 a1pms_api_get_status 200
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200119
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100120 # Create service to be able to receive events when rics becomes available
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100121 # Must use rest towards the a1pms since dmaap is not configured yet
122 a1pms_api_put_service 201 "ric-registration" 0 "$CR_SERVICE_APP_PATH_0/ric-registration"
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100123
124 #Load first config
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100125 if [ $RUNMODE == "KUBE" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100126 if [[ "$A1PMS_FEATURE_LEVEL" == *"INITIALCONFIGMAP"* ]]; then
127 a1pms_api_put_configuration 200 ".consul_config_initial.json"
128 a1pms_api_get_configuration 200 ".consul_config_initial.json"
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100129 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100130 a1pms_load_config ".consul_config_initial.json"
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100131 fi
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100132 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100133 if [[ "$A1PMS_FEATURE_LEVEL" == *"NOCONSUL"* ]]; then
134 a1pms_api_put_configuration 200 ".consul_config_initial.json"
135 a1pms_api_get_configuration 200 ".consul_config_initial.json"
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100136 else
137 consul_config_app ".consul_config_initial.json"
138 fi
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100139 fi
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100140
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200141 for ((i=1; i<=${NUM_RICS}; i++))
142 do
143 sim_print ricsim_g1_$i interface
144 done
145
146 # All sims running but 2 are not configured in consul
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100147 a1pms_equal json:rics 8 300
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200148
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100149 if [ "$A1PMS_VERSION" == "V2" ]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100150 cr_equal 0 received_callbacks?id=ric-registration 8 120
151 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 +0100152 fi
153
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100154 a1pms_api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:NOTYPE:???? \
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200155 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:NOTYPE:???? \
156 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:NOTYPE:???? \
157 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:NOTYPE:???? \
158 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:NOTYPE:???? \
159 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:NOTYPE:???? \
160 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:NOTYPE:???? \
161 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:NOTYPE:???? "
162
163
164 sim_put_policy_type 201 ricsim_g1_1 1 testdata/OSC/sim_1.json
165 sim_put_policy_type 201 ricsim_g1_2 1 testdata/OSC/sim_1.json
166 sim_put_policy_type 201 ricsim_g1_3 1 testdata/OSC/sim_1.json
167 sim_put_policy_type 201 ricsim_g1_4 1 testdata/OSC/sim_1.json
168 sim_put_policy_type 201 ricsim_g1_5 1 testdata/OSC/sim_1.json
169
170 sim_put_policy_type 201 ricsim_g1_2 2 testdata/OSC/sim_2.json
171 sim_put_policy_type 201 ricsim_g1_3 2 testdata/OSC/sim_2.json
172 sim_put_policy_type 201 ricsim_g1_4 2 testdata/OSC/sim_2.json
173 sim_put_policy_type 201 ricsim_g1_5 2 testdata/OSC/sim_2.json
174 sim_put_policy_type 201 ricsim_g1_6 2 testdata/OSC/sim_2.json
175
176 sim_put_policy_type 201 ricsim_g1_3 3 testdata/OSC/sim_3.json
177 sim_put_policy_type 201 ricsim_g1_4 3 testdata/OSC/sim_3.json
178 sim_put_policy_type 201 ricsim_g1_5 3 testdata/OSC/sim_3.json
179 sim_put_policy_type 201 ricsim_g1_6 3 testdata/OSC/sim_3.json
180 sim_put_policy_type 201 ricsim_g1_7 3 testdata/OSC/sim_3.json
181
182 sim_put_policy_type 201 ricsim_g1_4 4 testdata/OSC/sim_4.json
183 sim_put_policy_type 201 ricsim_g1_5 4 testdata/OSC/sim_4.json
184 sim_put_policy_type 201 ricsim_g1_6 4 testdata/OSC/sim_4.json
185 sim_put_policy_type 201 ricsim_g1_7 4 testdata/OSC/sim_4.json
186 sim_put_policy_type 201 ricsim_g1_8 4 testdata/OSC/sim_4.json
187
188 sim_put_policy_type 201 ricsim_g1_5 5 testdata/OSC/sim_5.json
189 sim_put_policy_type 201 ricsim_g1_6 5 testdata/OSC/sim_5.json
190 sim_put_policy_type 201 ricsim_g1_7 5 testdata/OSC/sim_5.json
191 sim_put_policy_type 201 ricsim_g1_8 5 testdata/OSC/sim_5.json
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200192
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100193 if [ "$A1PMS_VERSION" == "V2" ]; then
194 a1pms_equal json:policy-types 5 120
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200195
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100196 echo "Check the number of types in the a1pms for each ric"
197 a1pms_equal json:policy-types?ric_id=ricsim_g1_1 1 120
198 a1pms_equal json:policy-types?ric_id=ricsim_g1_2 2 120
199 a1pms_equal json:policy-types?ric_id=ricsim_g1_3 3 120
200 a1pms_equal json:policy-types?ric_id=ricsim_g1_4 4 120
201 a1pms_equal json:policy-types?ric_id=ricsim_g1_5 5 120
202 a1pms_equal json:policy-types?ric_id=ricsim_g1_6 4 120
203 a1pms_equal json:policy-types?ric_id=ricsim_g1_7 3 120
204 a1pms_equal json:policy-types?ric_id=ricsim_g1_8 2 120
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100205 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100206 a1pms_equal json:policy_types 5 120
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100207
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100208 echo "Check the number of types in the a1pms for each ric"
209 a1pms_equal json:policy_types?ric=ricsim_g1_1 1 120
210 a1pms_equal json:policy_types?ric=ricsim_g1_2 2 120
211 a1pms_equal json:policy_types?ric=ricsim_g1_3 3 120
212 a1pms_equal json:policy_types?ric=ricsim_g1_4 4 120
213 a1pms_equal json:policy_types?ric=ricsim_g1_5 5 120
214 a1pms_equal json:policy_types?ric=ricsim_g1_6 4 120
215 a1pms_equal json:policy_types?ric=ricsim_g1_7 3 120
216 a1pms_equal json:policy_types?ric=ricsim_g1_8 2 120
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100217 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200218
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100219 a1pms_api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200220 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
221 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \
222 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3,4:???? \
223 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,4,5:???? \
224 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,4,5:???? \
225 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,4,5:???? \
226 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:4,5:???? "
227
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100228 if [ "$A1PMS_VERSION" == "V2" ]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100229 cr_equal 0 received_callbacks?id=ric-registration 16 120
230 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 +0100231 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200232
233 #Load config with all rics
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100234 if [ $RUNMODE == "KUBE" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100235 if [[ "$A1PMS_FEATURE_LEVEL" == *"INITIALCONFIGMAP"* ]]; then
236 a1pms_api_put_configuration 200 ".consul_config_all.json"
237 a1pms_api_get_configuration 200 ".consul_config_all.json"
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100238 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100239 a1pms_load_config ".consul_config_all.json"
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100240 fi
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100241 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100242 if [[ "$A1PMS_FEATURE_LEVEL" == *"NOCONSUL"* ]]; then
243 a1pms_api_put_configuration 200 ".consul_config_all.json"
244 a1pms_api_get_configuration 200 ".consul_config_all.json"
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100245 else
246 consul_config_app ".consul_config_all.json"
247 fi
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100248 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200249
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100250 a1pms_equal json:rics 10 120
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200251
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100252 if [ "$A1PMS_VERSION" == "V2" ]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100253 cr_equal 0 received_callbacks?id=ric-registration 18 120
254 cr_api_check_all_sync_events 200 0 ric-registration ricsim_g1_9 ricsim_g1_10
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100255 fi
256
257 sim_put_policy_type 201 ricsim_g1_9 5 testdata/OSC/sim_5.json
258
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100259 if [ "$A1PMS_VERSION" == "V2" ]; then
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100260
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100261 a1pms_equal json:policy-types 5 120
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200262
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100263 echo "Check the number of types in the a1pms for each ric"
264 a1pms_equal json:policy-types?ric_id=ricsim_g1_1 1 120
265 a1pms_equal json:policy-types?ric_id=ricsim_g1_2 2 120
266 a1pms_equal json:policy-types?ric_id=ricsim_g1_3 3 120
267 a1pms_equal json:policy-types?ric_id=ricsim_g1_4 4 120
268 a1pms_equal json:policy-types?ric_id=ricsim_g1_5 5 120
269 a1pms_equal json:policy-types?ric_id=ricsim_g1_6 4 120
270 a1pms_equal json:policy-types?ric_id=ricsim_g1_7 3 120
271 a1pms_equal json:policy-types?ric_id=ricsim_g1_8 2 120
272 a1pms_equal json:policy-types?ric_id=ricsim_g1_9 1 120
273 a1pms_equal json:policy-types?ric_id=ricsim_g1_10 0 120
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100274 else
275
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100276 a1pms_equal json:policy_types 5 120
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200277
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100278 echo "Check the number of types in the a1pms for each ric"
279 a1pms_equal json:policy_types?ric=ricsim_g1_1 1 120
280 a1pms_equal json:policy_types?ric=ricsim_g1_2 2 120
281 a1pms_equal json:policy_types?ric=ricsim_g1_3 3 120
282 a1pms_equal json:policy_types?ric=ricsim_g1_4 4 120
283 a1pms_equal json:policy_types?ric=ricsim_g1_5 5 120
284 a1pms_equal json:policy_types?ric=ricsim_g1_6 4 120
285 a1pms_equal json:policy_types?ric=ricsim_g1_7 3 120
286 a1pms_equal json:policy_types?ric=ricsim_g1_8 2 120
287 a1pms_equal json:policy_types?ric=ricsim_g1_9 1 120
288 a1pms_equal json:policy_types?ric=ricsim_g1_10 0 120
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100289 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200290
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100291 a1pms_api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200292 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
293 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \
294 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3,4:???? \
295 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,4,5:???? \
296 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,4,5:???? \
297 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,4,5:???? \
298 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:4,5:???? \
299 ricsim_g1_9:me1_ricsim_g1_9,me2_ricsim_g1_9:5:???? \
300 ricsim_g1_10:me1_ricsim_g1_10,me2_ricsim_g1_10:NOTYPE:???? "
301
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100302 if [ "$A1PMS_VERSION" == "V2" ]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100303 cr_equal 0 received_callbacks?id=ric-registration 19 120
304 cr_api_check_all_sync_events 200 0 ric-registration ricsim_g1_9
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100305 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200306
307 #No policy type in sim #10
308
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100309 if [ "$A1PMS_VERSION" == "V2" ]; then
310 a1pms_equal json:policy-types 5
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100311 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100312 a1pms_equal json:policy_types 5
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100313 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200314
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100315 a1pms_api_put_service 201 "serv1" 3600 "$CR_SERVICE_APP_PATH_0/serv1"
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200316
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100317 if [ "$A1PMS_VERSION" == "V2" ]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100318 notificationurl=$CR_SERVICE_APP_PATH_0"/test"
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100319 else
320 notificationurl=""
321 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200322
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100323 sleep_wait 120
324
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200325 # Load config with reduced number of rics
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100326 if [ $RUNMODE == "KUBE" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100327 if [[ "$A1PMS_FEATURE_LEVEL" == *"INITIALCONFIGMAP"* ]]; then
328 a1pms_api_put_configuration 200 ".consul_config_initial.json"
329 a1pms_api_get_configuration 200 ".consul_config_initial.json"
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100330 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100331 a1pms_load_config ".consul_config_initial.json"
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100332 fi
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100333 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100334 if [[ "$A1PMS_FEATURE_LEVEL" == *"NOCONSUL"* ]]; then
335 a1pms_api_put_configuration 200 ".consul_config_initial.json"
336 a1pms_api_get_configuration 200 ".consul_config_initial.json"
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100337 else
338 consul_config_app ".consul_config_initial.json"
339 fi
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100340 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200341
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100342 a1pms_equal json:rics 8 120
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200343
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100344 if [ "$A1PMS_VERSION" == "V2" ]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100345 cr_equal 0 received_callbacks?id=ric-registration 19 120
346 cr_api_check_all_sync_events 200 0 ric-registration EMPTY
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100347 fi
348
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100349 if [ "$A1PMS_VERSION" == "V2" ]; then
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200350
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100351 a1pms_equal json:policy-types 5 120
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200352
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100353 echo "Check the number of types in the a1pms for each ric"
354 a1pms_equal json:policy-types?ric_id=ricsim_g1_1 1 120
355 a1pms_equal json:policy-types?ric_id=ricsim_g1_2 2 120
356 a1pms_equal json:policy-types?ric_id=ricsim_g1_3 3 120
357 a1pms_equal json:policy-types?ric_id=ricsim_g1_4 4 120
358 a1pms_equal json:policy-types?ric_id=ricsim_g1_5 5 120
359 a1pms_equal json:policy-types?ric_id=ricsim_g1_6 4 120
360 a1pms_equal json:policy-types?ric_id=ricsim_g1_7 3 120
361 a1pms_equal json:policy-types?ric_id=ricsim_g1_8 2 120
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100362 else
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200363
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100364 a1pms_equal json:policy_types 5 120
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200365
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100366 echo "Check the number of types in the a1pms for each ric"
367 a1pms_equal json:policy_types?ric=ricsim_g1_1 1 120
368 a1pms_equal json:policy_types?ric=ricsim_g1_2 2 120
369 a1pms_equal json:policy_types?ric=ricsim_g1_3 3 120
370 a1pms_equal json:policy_types?ric=ricsim_g1_4 4 120
371 a1pms_equal json:policy_types?ric=ricsim_g1_5 5 120
372 a1pms_equal json:policy_types?ric=ricsim_g1_6 4 120
373 a1pms_equal json:policy_types?ric=ricsim_g1_7 3 120
374 a1pms_equal json:policy_types?ric=ricsim_g1_8 2 120
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100375 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200376
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100377 a1pms_api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200378 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
379 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \
380 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3,4:???? \
381 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,4,5:???? \
382 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,4,5:???? \
383 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,4,5:???? \
384 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:4,5:???? "
385
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200386 sleep_wait 120
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200387
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100388 if [ "$A1PMS_VERSION" == "V2" ]; then
389 a1pms_equal json:policy-instances 0
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100390 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100391 a1pms_equal json:policy_ids 0
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100392 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200393
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100394 a1pms_api_get_policy_types 404 ricsim_g1_9
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200395
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200396 # Load config with all rics
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100397 if [ $RUNMODE == "KUBE" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100398 if [[ "$A1PMS_FEATURE_LEVEL" == *"INITIALCONFIGMAP"* ]]; then
399 a1pms_api_put_configuration 200 ".consul_config_all.json"
400 a1pms_api_get_configuration 200 ".consul_config_all.json"
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100401 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100402 a1pms_load_config ".consul_config_all.json"
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100403 fi
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100404 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100405 if [[ "$A1PMS_FEATURE_LEVEL" == *"NOCONSUL"* ]]; then
406 a1pms_api_put_configuration 200 ".consul_config_all.json"
407 a1pms_api_get_configuration 200 ".consul_config_all.json"
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100408 else
409 consul_config_app ".consul_config_all.json"
410 fi
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100411 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200412
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100413 a1pms_equal json:rics 10 120
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200414
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100415 if [ "$A1PMS_VERSION" == "V2" ]; then
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200416
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100417 a1pms_equal json:policy-types 5 120
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200418
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100419 echo "Check the number of types in the a1pms for each ric"
420 a1pms_equal json:policy-types?ric_id=ricsim_g1_1 1 120
421 a1pms_equal json:policy-types?ric_id=ricsim_g1_2 2 120
422 a1pms_equal json:policy-types?ric_id=ricsim_g1_3 3 120
423 a1pms_equal json:policy-types?ric_id=ricsim_g1_4 4 120
424 a1pms_equal json:policy-types?ric_id=ricsim_g1_5 5 120
425 a1pms_equal json:policy-types?ric_id=ricsim_g1_6 4 120
426 a1pms_equal json:policy-types?ric_id=ricsim_g1_7 3 120
427 a1pms_equal json:policy-types?ric_id=ricsim_g1_8 2 120
428 a1pms_equal json:policy-types?ric_id=ricsim_g1_9 1 120
429 a1pms_equal json:policy-types?ric_id=ricsim_g1_10 0 120
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100430 else
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200431
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100432 a1pms_equal json:policy_types 5 120
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200433
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100434 echo "Check the number of types in the a1pms for each ric"
435 a1pms_equal json:policy_types?ric=ricsim_g1_1 1 120
436 a1pms_equal json:policy_types?ric=ricsim_g1_2 2 120
437 a1pms_equal json:policy_types?ric=ricsim_g1_3 3 120
438 a1pms_equal json:policy_types?ric=ricsim_g1_4 4 120
439 a1pms_equal json:policy_types?ric=ricsim_g1_5 5 120
440 a1pms_equal json:policy_types?ric=ricsim_g1_6 4 120
441 a1pms_equal json:policy_types?ric=ricsim_g1_7 3 120
442 a1pms_equal json:policy_types?ric=ricsim_g1_8 2 120
443 a1pms_equal json:policy_types?ric=ricsim_g1_9 1 120
444 a1pms_equal json:policy_types?ric=ricsim_g1_10 0 120
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100445 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200446
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100447 a1pms_api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200448 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
449 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \
450 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3,4:???? \
451 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,4,5:???? \
452 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,4,5:???? \
453 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,4,5:???? \
454 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:4,5:???? \
455 ricsim_g1_9:me1_ricsim_g1_9,me2_ricsim_g1_9:5:???? \
456 ricsim_g1_10:me1_ricsim_g1_10,me2_ricsim_g1_10:NOTYPE:???? "
457
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200458 sleep_wait 120
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200459
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100460 if [ "$A1PMS_VERSION" == "V2" ]; then
461 a1pms_equal json:policy-instances 0
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100462 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100463 a1pms_equal json:policy_ids 0
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100464 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200465
466 sim_equal ricsim_g1_9 num_instances 0
467
468
469 sim_delete_policy_type 204 ricsim_g1_4 4
470 sim_delete_policy_type 204 ricsim_g1_5 4
471 sim_delete_policy_type 204 ricsim_g1_6 4
472 sim_delete_policy_type 204 ricsim_g1_7 4
473
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200474 sleep_wait 120
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200475
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100476 if [ "$A1PMS_VERSION" == "V2" ]; then
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200477
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100478 a1pms_equal json:policy-types 5 120
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200479
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100480 a1pms_equal json:policy-types?ric_id=ricsim_g1_1 1 120
481 a1pms_equal json:policy-types?ric_id=ricsim_g1_2 2 120
482 a1pms_equal json:policy-types?ric_id=ricsim_g1_3 3 120
483 a1pms_equal json:policy-types?ric_id=ricsim_g1_4 3 120
484 a1pms_equal json:policy-types?ric_id=ricsim_g1_5 4 120
485 a1pms_equal json:policy-types?ric_id=ricsim_g1_6 3 120
486 a1pms_equal json:policy-types?ric_id=ricsim_g1_7 2 120
487 a1pms_equal json:policy-types?ric_id=ricsim_g1_8 2 120
488 a1pms_equal json:policy-types?ric_id=ricsim_g1_9 1 120
489 a1pms_equal json:policy-types?ric_id=ricsim_g1_10 0 120
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100490 else
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200491
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100492 a1pms_equal json:policy_types 5 120
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200493
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100494 a1pms_equal json:policy_types?ric=ricsim_g1_1 1 120
495 a1pms_equal json:policy_types?ric=ricsim_g1_2 2 120
496 a1pms_equal json:policy_types?ric=ricsim_g1_3 3 120
497 a1pms_equal json:policy_types?ric=ricsim_g1_4 3 120
498 a1pms_equal json:policy_types?ric=ricsim_g1_5 4 120
499 a1pms_equal json:policy_types?ric=ricsim_g1_6 3 120
500 a1pms_equal json:policy_types?ric=ricsim_g1_7 2 120
501 a1pms_equal json:policy_types?ric=ricsim_g1_8 2 120
502 a1pms_equal json:policy_types?ric=ricsim_g1_9 1 120
503 a1pms_equal json:policy_types?ric=ricsim_g1_10 0 120
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100504 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200505
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100506 a1pms_api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200507 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
508 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \
509 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3:???? \
510 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,5:???? \
511 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,5:???? \
512 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,5:???? \
513 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:4,5:???? \
514 ricsim_g1_9:me1_ricsim_g1_9,me2_ricsim_g1_9:5:???? \
515 ricsim_g1_10:me1_ricsim_g1_10,me2_ricsim_g1_10:NOTYPE:???? "
516
517 sim_delete_policy_type 204 ricsim_g1_8 4
518
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100519 if [ "$A1PMS_VERSION" == "V2" ]; then
520 a1pms_equal json:policy-types 5 120
521 a1pms_equal json:policy-types?ric_id=ricsim_g1_8 1 120
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100522 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100523 a1pms_equal json:policy_types 5 120
524 a1pms_equal json:policy_types?ric=ricsim_g1_8 1 120
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100525 fi
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200526
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100527 a1pms_api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200528 ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
529 ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \
530 ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3:???? \
531 ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,5:???? \
532 ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,5:???? \
533 ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,5:???? \
534 ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:5:???? \
535 ricsim_g1_9:me1_ricsim_g1_9,me2_ricsim_g1_9:5:???? \
536 ricsim_g1_10:me1_ricsim_g1_10,me2_ricsim_g1_10:NOTYPE:???? "
537
538
539
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100540 check_a1pms_logs
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100541 if [[ $interface = *"SDNC"* ]]; then
542 check_sdnc_logs
543 fi
544
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200545 store_logs ${interface}
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200546
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200547done
548
549
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200550#### TEST COMPLETE ####
551
552
553print_result
554
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100555auto_clean_environment