blob: a473338700022597b3aceac9bbaf63957b9623a5 [file] [log] [blame]
BjornMagnussonXA70e878f2020-05-11 14:11:30 +02001#!/bin/bash
BjornMagnussonXA80a92002020-03-19 14:31:06 +01002
3# ============LICENSE_START===============================================
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +02004# Copyright (C) 2020-2023 Nordix Foundation. All rights reserved.
rohithrajneesh927c17e2023-12-01 14:26:03 +00005# Copyright (C) 2023 OpenInfra Foundation Europe. All rights reserved.
BjornMagnussonXA80a92002020-03-19 14:31:06 +01006# ========================================================================
7# Licensed under the Apache License, Version 2.0 (the "License");
8# you may not use this file except in compliance with the License.
9# You may obtain a copy of the License at
10#
11# http://www.apache.org/licenses/LICENSE-2.0
12#
13# Unless required by applicable law or agreed to in writing, software
14# distributed under the License is distributed on an "AS IS" BASIS,
15# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16# See the License for the specific language governing permissions and
17# limitations under the License.
18# ============LICENSE_END=================================================
19#
20
21
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +020022TC_ONELINE_DESCR="Full a1pms API walkthrough using a1pms REST and with/without SDNC A1 Controller"
BjornMagnussonXA80a92002020-03-19 14:31:06 +010023
BjornMagnussonXAf4a7e422022-09-01 16:35:17 +020024USE_ISTIO=0
BjornMagnussonXAcd938442022-05-11 10:01:24 +020025
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010026#App names to include in the test when running docker, space separated list
BjornMagnussonXAf83c3622023-02-28 10:05:51 +010027DOCKER_INCLUDED_IMAGES="CP CR MR A1PMS RICSIM SDNC NGW KUBEPROXY"
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020028
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010029#App names to include in the test when running kubernetes, space separated list
BjornMagnussonXAcd938442022-05-11 10:01:24 +020030if [ $USE_ISTIO -eq 0 ]; then
31 KUBE_INCLUDED_IMAGES="CP CR MR A1PMS RICSIM SDNC KUBEPROXY NGW"
32else
33 KUBE_INCLUDED_IMAGES="CP CR MR A1PMS RICSIM SDNC KUBEPROXY NGW KEYCLOAK ISTIO AUTHSIDECAR"
34fi
BjornMagnussonXAd54225b2023-04-19 14:03:49 +020035#Pre-started app (not started by script) to include in the test when running kubernetes, space separated list
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010036KUBE_PRESTARTED_IMAGES=""
37
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010038#Ignore image in DOCKER_INCLUDED_IMAGES, KUBE_INCLUDED_IMAGES if
39#the image is not configured in the supplied env_file
40#Used for images not applicable to all supported profile
BjornMagnussonXAf83c3622023-02-28 10:05:51 +010041CONDITIONALLY_IGNORED_IMAGES="NGW"
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010042
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010043#Supported test environment profiles
rohithrajneesh927c17e2023-12-01 14:26:03 +000044SUPPORTED_PROFILES="ONAP-KOHN ONAP-LONDON ONAP-MONTREAL ORAN-G-RELEASE ORAN-H-RELEASE ORAN-I-RELEASE"
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010045#Supported run modes
46SUPPORTED_RUNMODES="DOCKER KUBE"
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +010047
BjornMagnussonXA79e37002021-11-22 13:36:04 +010048. ../common/testcase_common.sh $@
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010049
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010050setup_testenvironment
BjornMagnussonXA80a92002020-03-19 14:31:06 +010051
52#### TEST BEGIN ####
53
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +020054sim_generate_policy_uuid
BjornMagnussonXAad047782020-06-08 15:54:11 +020055
BjornMagnussonXAcd938442022-05-11 10:01:24 +020056if [ $USE_ISTIO -eq 0 ]; then
57 # Tested variants of REST/DMAAP/SDNC config
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +020058 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
59 TESTED_VARIANTS="REST REST+SDNC"
60 else
61 TESTED_VARIANTS="REST DMAAP REST+SDNC DMAAP+SDNC"
62 fi
BjornMagnussonXA4207b832020-11-03 09:52:49 +010063
BjornMagnussonXAcd938442022-05-11 10:01:24 +020064 #Test a1pms and simulator protocol versions (others are http only)
65 TESTED_PROTOCOLS="HTTP HTTPS"
66else
67 if [ $USE_ISTIO -eq 1 ]; then
68 echo -e $RED"#########################################"$ERED
69 echo -e $RED"# No test of https when running with istio"$ERED
70 echo -e $RED"# No test of SDNC when running with istio"$ERED
71 echo -e $RED"#########################################"$ERED
72 fi
73 # Tested variants of REST/DMAAP/SDNC config
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +020074 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
75 TESTED_VARIANTS="REST DMAAP"
76 else
77 TESTED_VARIANTS="REST"
78 fi
BjornMagnussonXAcd938442022-05-11 10:01:24 +020079
80 #Test a1pms and simulator protocol versions (others are http only)
81 TESTED_PROTOCOLS="HTTP"
82fi
BjornMagnussonXA4207b832020-11-03 09:52:49 +010083
BjornMagnussonXA72667f12020-04-24 09:20:18 +020084for __httpx in $TESTED_PROTOCOLS ; do
85 for interface in $TESTED_VARIANTS ; do
BjornMagnussonXA80a92002020-03-19 14:31:06 +010086
BjornMagnussonXA72667f12020-04-24 09:20:18 +020087 echo "#####################################################################"
88 echo "#####################################################################"
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +010089 echo "### Testing a1pms: $interface using $__httpx"
BjornMagnussonXA72667f12020-04-24 09:20:18 +020090 echo "#####################################################################"
91 echo "#####################################################################"
BjornMagnussonXA80a92002020-03-19 14:31:06 +010092
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +010093 # Clean container and start all needed containers #
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010094 clean_environment
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +010095
BjornMagnussonXAcd938442022-05-11 10:01:24 +020096 if [ $RUNMODE != "KUBE" ]; then
97 USE_ISTIO=0
98 echo "ISTIO not supported by docker - setting USE-ISTIO=0"
99 fi
100
101 if [ $USE_ISTIO -eq 1 ]; then
102 echo -e $RED"#########################################"$ERED
103 echo -e $RED"# Work around istio jwks cache"$ERED
104 echo -e $RED"# Cycle istiod down and up to clear cache"$ERED
105 echo ""
106 __kube_scale deployment istiod istio-system 0
107 __kube_scale deployment istiod istio-system 1
108 echo -e $RED"# Cycle istiod done"
109 echo -e $RED"#########################################"$ERED
110
111 istio_enable_istio_namespace $KUBE_SIM_NAMESPACE
112 istio_enable_istio_namespace $KUBE_NONRTRIC_NAMESPACE
113 istio_enable_istio_namespace $KUBE_A1SIM_NAMESPACE
114 fi
115
116
BjornMagnussonXA663566c2021-11-08 10:25:07 +0100117 start_kube_proxy
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +0100118
BjornMagnussonXAcd938442022-05-11 10:01:24 +0200119 if [ $USE_ISTIO -eq 1 ]; then
120 start_keycloak
121
122 keycloak_api_obtain_admin_token
123
124 keycloak_api_create_realm nrtrealm true 60
125 keycloak_api_create_confidential_client nrtrealm a1pmsc
126 keycloak_api_generate_client_secret nrtrealm a1pmsc
127 keycloak_api_get_client_secret nrtrealm a1pmsc
128 keycloak_api_create_client_roles nrtrealm a1pmsc nrtrole
129 keycloak_api_map_client_roles nrtrealm a1pmsc nrtrole
130
131 keycloak_api_get_client_token nrtrealm a1pmsc
132
133 CLIENT_TOKEN=$(keycloak_api_read_client_token nrtrealm a1pmsc)
134 echo "CLIENT_TOKEN: "$CLIENT_TOKEN
135
136 A1PMS_SEC=$(keycloak_api_read_client_secret nrtrealm a1pmsc)
137 echo "A1PMS_SEC: "$A1PMS_SEC
138
139 # Protect ricsim-g3
140 istio_req_auth_by_jwks ricsim-g1 $KUBE_A1SIM_NAMESPACE KUBEPROXY "$KUBE_PROXY_ISTIO_JWKS_KEYS"
141 istio_auth_policy_by_issuer ricsim-g1 $KUBE_A1SIM_NAMESPACE KUBEPROXY
142
143 istio_req_auth_by_jwksuri ricsim-g1 $KUBE_A1SIM_NAMESPACE nrtrealm
144 istio_auth_policy_by_realm ricsim-g1 $KUBE_A1SIM_NAMESPACE nrtrealm a1pmsc nrtrole
145
146 # Protect ricsim-g2
147 istio_req_auth_by_jwks ricsim-g2 $KUBE_A1SIM_NAMESPACE KUBEPROXY "$KUBE_PROXY_ISTIO_JWKS_KEYS"
148 istio_auth_policy_by_issuer ricsim-g2 $KUBE_A1SIM_NAMESPACE KUBEPROXY
149
150 istio_req_auth_by_jwksuri ricsim-g2 $KUBE_A1SIM_NAMESPACE nrtrealm
151 istio_auth_policy_by_realm ricsim-g2 $KUBE_A1SIM_NAMESPACE nrtrealm a1pmsc nrtrole
152
153 # Protect ricsim-g3
154 istio_req_auth_by_jwks ricsim-g3 $KUBE_A1SIM_NAMESPACE KUBEPROXY "$KUBE_PROXY_ISTIO_JWKS_KEYS"
155 istio_auth_policy_by_issuer ricsim-g3 $KUBE_A1SIM_NAMESPACE KUBEPROXY
156
157 istio_req_auth_by_jwksuri ricsim-g3 $KUBE_A1SIM_NAMESPACE nrtrealm
158 istio_auth_policy_by_realm ricsim-g3 $KUBE_A1SIM_NAMESPACE nrtrealm a1pmsc nrtrole
159
160 # Protect CR
161 istio_req_auth_by_jwks $CR_APP_NAME $KUBE_SIM_NAMESPACE KUBEPROXY "$KUBE_PROXY_ISTIO_JWKS_KEYS"
162 istio_auth_policy_by_issuer $CR_APP_NAME $KUBE_SIM_NAMESPACE KUBEPROXY
163
164 istio_req_auth_by_jwksuri $CR_APP_NAME $KUBE_SIM_NAMESPACE nrtrealm
165 istio_auth_policy_by_realm $CR_APP_NAME $KUBE_SIM_NAMESPACE nrtrealm a1pmsc nrtrole
166
167 a1pms_configure_sec nrtrealm a1pmsc $A1PMS_SEC
168 fi
169
BjornMagnussonXA496156d2020-08-10 14:16:24 +0200170 if [ $__httpx == "HTTPS" ]; then
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100171 use_cr_https
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100172 use_a1pms_rest_https
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100173 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100174 use_a1pms_rest_http
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100175 use_cr_http
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100176 fi
177
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100178 start_a1pms NORPOXY $SIM_GROUP/$A1PMS_COMPOSE_DIR/$A1PMS_CONFIG_FILE
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100179
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100180 set_a1pms_debug
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100181
182 # Create service to be able to receive events when rics becomes available
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100183 # Must use rest towards the a1pms since dmaap is not configured yet
184 a1pms_api_put_service 201 "ric-registration" 0 "$CR_SERVICE_APP_PATH_0/ric-registration"
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100185
186
187 if [ $__httpx == "HTTPS" ]; then
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200188 use_simulator_https
189 use_mr_https
190 if [[ $interface = *"SDNC"* ]]; then
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200191 if [[ "$SDNC_FEATURE_LEVEL" == *"NO_NB_HTTPS"* ]]; then
192 deviation "SDNC does not support NB https"
193 use_sdnc_http
194 else
195 use_sdnc_https
196 fi
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200197 fi
198 if [[ $interface = *"DMAAP"* ]]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100199 use_a1pms_dmaap_https
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200200 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100201 use_a1pms_rest_https
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200202 fi
BjornMagnussonXA496156d2020-08-10 14:16:24 +0200203 else
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200204 use_simulator_http
205 use_mr_http
206 if [[ $interface = *"SDNC"* ]]; then
207 use_sdnc_http
208 fi
209 if [[ $interface = *"DMAAP"* ]]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100210 use_a1pms_dmaap_http
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200211 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100212 use_a1pms_rest_http
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200213 fi
BjornMagnussonXA496156d2020-08-10 14:16:24 +0200214 fi
BjornMagnussonXA80a92002020-03-19 14:31:06 +0100215
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200216 start_ric_simulators ricsim_g1 1 OSC_2.1.0
217 start_ric_simulators ricsim_g2 1 STD_1.1.3
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100218
219 sim_put_policy_type 201 ricsim_g1_1 1 testdata/OSC/sim_1.json
220 sim_put_policy_type 201 ricsim_g1_1 2 testdata/OSC/sim_2.json
221
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100222 start_ric_simulators ricsim_g3 1 STD_2.0.0
223 sim_put_policy_type 201 ricsim_g3_1 STD_QOS_0_2_0 testdata/STD2/sim_qos.json
224 sim_put_policy_type 201 ricsim_g3_1 STD_QOS2_0.1.0 testdata/STD2/sim_qos2.json
BjornMagnussonXA80a92002020-03-19 14:31:06 +0100225
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200226 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
227 :
228 else
229 start_mr
230 fi
BjornMagnussonXA80a92002020-03-19 14:31:06 +0100231
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100232 start_cr 1
BjornMagnussonXA80a92002020-03-19 14:31:06 +0100233
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +0100234 start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/$CONTROL_PANEL_CONFIG_FILE
235
236 if [ ! -z "$NRT_GATEWAY_APP_NAME" ]; then
237 start_gateway $SIM_GROUP/$NRT_GATEWAY_COMPOSE_DIR/$NRT_GATEWAY_CONFIG_FILE
238 fi
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100239
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100240
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200241 if [[ $interface = *"SDNC"* ]]; then
242 start_sdnc
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200243 controller_api_wait_for_status_ok 200 ricsim_g1_1
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100244 prepare_a1pms_config SDNC ".a1pms_config.json"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200245 else
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100246 prepare_a1pms_config NOSDNC ".a1pms_config.json"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200247 fi
BjornMagnussonXA80a92002020-03-19 14:31:06 +0100248
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100249 if [ $RUNMODE == "KUBE" ]; then
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100250 a1pms_load_config ".a1pms_config.json"
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100251 else
BjornMagnussonXAd54225b2023-04-19 14:03:49 +0200252 #Temporary switch to http/https if dmaap use. Otherwise it is not possible to push config
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100253 if [ $__httpx == "HTTPS" ]; then
254 use_a1pms_rest_https
255 else
256 use_a1pms_rest_http
257 fi
258
259 if [[ $interface != *"DMAAP"* ]]; then
260 echo "{}" > ".a1pms_config_incorrect.json"
261 a1pms_api_put_configuration 400 ".a1pms_config_incorrect.json"
262 fi
263
264 a1pms_api_put_configuration 200 ".a1pms_config.json"
265 a1pms_api_get_configuration 200 ".a1pms_config.json"
266 if [ $__httpx == "HTTPS" ]; then
267 if [[ $interface = *"DMAAP"* ]]; then
268 use_a1pms_dmaap_https
269 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100270 use_a1pms_rest_https
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100271 fi
272 else
273 if [[ $interface = *"DMAAP"* ]]; then
274 use_a1pms_dmaap_http
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100275 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100276 use_a1pms_rest_http
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100277 fi
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100278 fi
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100279 fi
BjornMagnussonXA80a92002020-03-19 14:31:06 +0100280
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100281 a1pms_equal json:rics 3 300
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200282
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100283 a1pms_equal json:policy-types 5 120
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200284
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100285 a1pms_equal json:policies 0
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200286
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100287 a1pms_equal json:policy-instances 0
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100288
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100289 cr_equal 0 received_callbacks 3 120
290 cr_api_check_all_sync_events 200 0 ric-registration ricsim_g1_1 ricsim_g2_1 ricsim_g3_1
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100291
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200292 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
293 :
294 else
295 mr_equal requests_submitted 0
296 fi
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100297
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200298
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200299 echo "############################################"
300 echo "############## Health check ################"
301 echo "############################################"
302
BjornMagnussonXAd54225b2023-04-19 14:03:49 +0200303 sleep_wait 120 "Let A1PMS configuration take effect"
BjornMagnussonXAf4a7e422022-09-01 16:35:17 +0200304
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100305 a1pms_api_get_status 200
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200306
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100307 a1pms_api_get_status_root 200
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100308
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200309 echo "############################################"
310 echo "##### Service registry and supervision #####"
311 echo "############################################"
312
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100313 a1pms_api_get_services 404 "service1"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200314
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100315 a1pms_api_put_service 201 "service1" 1000 "$CR_SERVICE_APP_PATH_0/1"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200316
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100317 a1pms_api_put_service 200 "service1" 2000 "$CR_SERVICE_APP_PATH_0/1"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200318
319
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100320 a1pms_api_put_service 400 "service2" -1 "$CR_SERVICE_APP_PATH_0/2"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200321
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100322 a1pms_api_put_service 400 "service2" "wrong" "$CR_SERVICE_APP_PATH_0/2"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200323
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100324 a1pms_api_put_service 400 "service2" 100 "/test"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200325
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100326 a1pms_api_put_service 400 "service2" 100 "test-path"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200327
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100328 a1pms_api_put_service 201 "service2" 300 "ftp://localhost:80/test"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200329
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100330 a1pms_api_get_services 200 "service1" "service1" 2000 "$CR_SERVICE_APP_PATH_0/1"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200331
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100332 a1pms_api_get_service_ids 200 "service1" "service2" "ric-registration"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200333
334
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100335 a1pms_api_put_service 201 "service3" 5000 "$CR_SERVICE_APP_PATH_0/3"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200336
337
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100338 a1pms_api_get_service_ids 200 "service1" "service2" "service3" "ric-registration"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200339
340
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100341 a1pms_api_get_services 200 "service1" "service1" 2000 "$CR_SERVICE_APP_PATH_0/1"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200342
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100343 a1pms_api_get_services 200 NOSERVICE "service1" 2000 "$CR_SERVICE_APP_PATH_0/1" "service2" 300 "ftp://localhost:80/test" "service3" 5000 "$CR_SERVICE_APP_PATH_0/3" "ric-registration" 0 "$CR_SERVICE_APP_PATH_0/ric-registration"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200344
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100345 a1pms_api_get_services 200
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200346
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200347 deviation "TR2 - Keep alive shall return 200/201 according to doc, only 200 works - test combo $interface and $__httpx"
348 #The below should work, keept here until fixed or other decision made
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100349 #a1pms_api_put_services_keepalive 201 "service1"
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200350 #Using the below until decision
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100351 a1pms_api_put_services_keepalive 200 "service1"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200352
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200353 deviation "TR2 - Keep alive shall return 200/201 according to doc, only 200 works - test combo $interface and $__httpx"
354 #The below should work, keept here until fixed or other decision made
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100355 #a1pms_api_put_services_keepalive 201 "service3"
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200356 #Using the below until decision
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100357 a1pms_api_put_services_keepalive 200 "service3"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200358
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100359 a1pms_api_put_services_keepalive 200 "service1"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200360
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100361 a1pms_api_put_services_keepalive 200 "service3"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200362
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100363 a1pms_api_put_services_keepalive 404 "service5"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200364
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100365 a1pms_api_get_service_ids 200 "service1" "service2" "service3" "ric-registration"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200366
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100367 a1pms_api_delete_services 204 "service1"
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200368
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100369 a1pms_api_get_service_ids 200 "service2" "service3" "ric-registration"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200370
371
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100372 a1pms_api_put_service 201 "service1" 50 "$CR_SERVICE_APP_PATH_0/1"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200373
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100374 a1pms_api_get_service_ids 200 "service1" "service2" "service3" "ric-registration"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200375
376
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100377 a1pms_api_delete_services 204 "service1"
378 a1pms_api_delete_services 204 "service3"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200379
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100380 a1pms_equal json:services 2
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200381
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100382 a1pms_api_delete_services 204 "service2"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200383
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100384 a1pms_equal json:services 1
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200385
386
387 echo "############################################"
388 echo "############## RIC Repository ##############"
389 echo "############################################"
390
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100391 a1pms_api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2:AVAILABLE ricsim_g2_1:me1_ricsim_g2_1,me2_ricsim_g2_1:EMPTYTYPE:AVAILABLE ricsim_g3_1:me1_ricsim_g3_1,me2_ricsim_g3_1:STD_QOS_0_2_0,STD_QOS2_0.1.0:AVAILABLE"
392
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100393 a1pms_api_get_rics 200 1 "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2:AVAILABLE"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200394
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100395 a1pms_api_get_rics 404 47
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200396
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100397 a1pms_api_get_rics 404 "test"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200398
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100399 a1pms_api_get_ric 200 me1_ricsim_g1_1 NORIC "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2:AVAILABLE"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200400
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100401 a1pms_api_get_ric 200 me2_ricsim_g1_1 NORIC "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2:AVAILABLE"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200402
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100403 a1pms_api_get_ric 200 me1_ricsim_g2_1 NORIC "ricsim_g2_1:me1_ricsim_g2_1,me2_ricsim_g2_1:EMPTYTYPE:AVAILABLE"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200404
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100405 a1pms_api_get_ric 200 me2_ricsim_g2_1 NORIC "ricsim_g2_1:me1_ricsim_g2_1,me2_ricsim_g2_1:EMPTYTYPE:AVAILABLE"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200406
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100407 a1pms_api_get_ric 200 me1_ricsim_g3_1 NORIC "ricsim_g3_1:me1_ricsim_g3_1,me2_ricsim_g3_1:STD_QOS_0_2_0,STD_QOS2_0.1.0:AVAILABLE"
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100408
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100409 a1pms_api_get_ric 200 me2_ricsim_g3_1 NORIC "ricsim_g3_1:me1_ricsim_g3_1,me2_ricsim_g3_1:STD_QOS_0_2_0,STD_QOS2_0.1.0:AVAILABLE"
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100410
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100411 a1pms_api_get_ric 200 NOME ricsim_g1_1 "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2:AVAILABLE"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200412
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100413 a1pms_api_get_ric 200 NOME ricsim_g2_1 "ricsim_g2_1:me1_ricsim_g2_1,me2_ricsim_g2_1:EMPTYTYPE:AVAILABLE"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200414
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100415 a1pms_api_get_ric 200 NOME ricsim_g3_1 "ricsim_g3_1:me1_ricsim_g3_1,me2_ricsim_g3_1:STD_QOS_0_2_0,STD_QOS2_0.1.0:AVAILABLE"
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100416
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100417 a1pms_api_get_ric 404 NOME test1
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100418
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100419 a1pms_api_get_ric 404 test NORIC
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100420
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100421 a1pms_api_get_ric 400 me1_ricsim_g1_1 ricsim_g1_1
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100422
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100423 a1pms_api_get_ric 400 me1_ricsim_g1_1 TESTRIC
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100424
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100425 a1pms_api_get_ric 400 TESTME ricsim_g1_1
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200426
427 echo "############################################"
428 echo "########### A1 Policy Management ###########"
429 echo "############################################"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200430
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100431 deviation "TR9 - a1pms modify the type with type id - test combo $interface and $__httpx"
432 #Behaviour accepted for now
433 a1pms_api_get_policy_type 200 1 testdata/OSC/1-a1pms-modified.json
434 deviation "TR9 - a1pms modify the type with type id - test combo $interface and $__httpx"
435 #Behaviour accepted for now
436 a1pms_api_get_policy_type 200 2 testdata/OSC/2-a1pms-modified.json
437 deviation "TR9 - a1pms modify the type with type id - test combo $interface and $__httpx"
438 #Behaviour accepted for now
439 a1pms_api_get_policy_type 200 STD_QOS_0_2_0 testdata/STD2/qos-a1pms-modified.json
440 deviation "TR9 - a1pms modify the type with type id - test combo $interface and $__httpx"
441 #Behaviour accepted for now
442 a1pms_api_get_policy_type 200 STD_QOS2_0.1.0 testdata/STD2/qos2-a1pms-modified.json
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200443
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100444 a1pms_api_get_policy_type 404 3
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200445
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100446 a1pms_api_get_policy_schemas 404
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200447
448
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100449 a1pms_api_get_policy_types 200 NORIC 1 2 EMPTY STD_QOS_0_2_0 STD_QOS2_0.1.0
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200450
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100451 a1pms_api_get_policy_types 200 ricsim_g1_1 1 2
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200452
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100453 a1pms_api_get_policy_types 200 ricsim_g2_1 EMPTY
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200454
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100455 a1pms_api_get_policy_types 200 ricsim_g3_1 STD_QOS_0_2_0 STD_QOS2_0.1.0
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100456
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100457 a1pms_api_get_policy_types 404 dummy-ric
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200458
459
460
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100461 a1pms_api_put_service 201 "service10" 3600 "$CR_SERVICE_APP_PATH_0/1"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200462
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100463 notificationurl=$CR_SERVICE_APP_PATH_0"/test"
464
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100465 if [[ $interface != *"DMAAP"* ]]; then
466 # Badly formatted json is not possible to send via dmaap
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100467 a1pms_api_put_policy 400 "unregistered-service" ricsim_g1_1 1 2000 NOTRANSIENT $notificationurl testdata/OSC/pi_bad_template.json
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100468 fi
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100469 deviation "TR10 - a1pms allows policy creation on unregistered service (orig problem) - test combo $interface and $__httpx"
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200470 #Kept until decison
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100471 #a1pms_api_put_policy 400 "unregistered-service" ricsim_g1_1 1 2000 NOTRANSIENT testdata/OSC/pi1_template.json
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200472 #Allow 201 for now
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100473 a1pms_api_put_policy 201 "unregistered-service" ricsim_g1_1 1 2000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200474
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100475 a1pms_api_put_policy 201 "service10" ricsim_g1_1 1 5000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json
476 a1pms_api_put_policy 200 "service10" ricsim_g1_1 1 5000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200477
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100478 a1pms_api_put_policy 200 "service10" ricsim_g1_1 1 5000 true $notificationurl testdata/OSC/pi1_template.json
479 a1pms_api_put_policy 200 "service10" ricsim_g1_1 1 5000 false $notificationurl testdata/OSC/pi1_template.json
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200480
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100481 a1pms_api_put_policy 201 "service10" ricsim_g2_1 NOTYPE 5100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json
482 a1pms_api_put_policy 200 "service10" ricsim_g2_1 NOTYPE 5100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200483
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100484 a1pms_api_put_policy 200 "service10" ricsim_g2_1 NOTYPE 5100 true $notificationurl testdata/STD/pi1_template.json
485 a1pms_api_put_policy 200 "service10" ricsim_g2_1 NOTYPE 5100 false $notificationurl testdata/STD/pi1_template.json
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200486
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100487 a1pms_api_put_policy 201 "service10" ricsim_g3_1 STD_QOS2_0.1.0 5200 NOTRANSIENT $notificationurl testdata/STD2/pi_qos2_template.json
488 a1pms_api_put_policy 200 "service10" ricsim_g3_1 STD_QOS2_0.1.0 5200 NOTRANSIENT $notificationurl testdata/STD2/pi_qos2_template.json
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100489
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100490 a1pms_api_put_policy 200 "service10" ricsim_g3_1 STD_QOS2_0.1.0 5200 true $notificationurl testdata/STD2/pi_qos2_template.json
491 a1pms_api_put_policy 200 "service10" ricsim_g3_1 STD_QOS2_0.1.0 5200 false $notificationurl testdata/STD2/pi_qos2_template.json
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100492
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100493 a1pms_api_get_policy_status 404 1
494 a1pms_api_get_policy_status 404 2
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200495 VAL='NOT IN EFFECT'
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100496 a1pms_api_get_policy_status 200 5000 OSC "$VAL" "false"
497 a1pms_api_get_policy_status 200 5100 STD "UNDEFINED"
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100498 a1pms_api_get_policy_status 200 5200 STD2 EMPTY EMPTY
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200499
500
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100501 deviation "TR10 - a1pms allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx"
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200502 #kept until decision
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100503 #a1pms_equal json:policies 2
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200504 #Allow 3 for now
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100505 a1pms_equal json:policies 4
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200506
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100507 deviation "TR10 - a1pms allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx"
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200508 #kept until decision
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100509 #a1pms_equal json:policy_ids 2
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200510 #Allow 3 for now
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100511 a1pms_equal json:policy-instances 4
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200512
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100513 deviation "TR10 - a1pms allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx"
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200514 #kept until decision
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100515 #a1pms_api_get_policy_ids 200 NORIC NOSERVICE NOTYPE 5000 5100
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200516 #Allow policy create with unregistered service for now
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100517 a1pms_api_get_policy_ids 200 NORIC NOSERVICE NOTYPE 5000 5100 2000 5200
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200518
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100519 deviation "TR10 - a1pms allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx"
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200520 #kept until decision
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100521 #a1pms_api_get_policy_ids 200 ricsim_g1_1 NOSERVICE NOTYPE 5000
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200522 #Allow policy create with unregistered service for now
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100523 a1pms_api_get_policy_ids 200 ricsim_g1_1 NOSERVICE NOTYPE 5000 2000
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200524
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100525 a1pms_api_get_policy_ids 200 ricsim_g2_1 NOSERVICE NOTYPE 5100
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100526
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100527 a1pms_api_get_policy_ids 200 ricsim_g3_1 NOSERVICE NOTYPE 5200
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100528
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100529 a1pms_api_get_policy_ids 200 NORIC "service10" NOTYPE 5000 5100 5200
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200530
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100531 deviation "TR10 - a1pms allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx"
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200532 #kept until decision
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100533 #a1pms_api_get_policy_ids 200 NORIC NOSERVICE 1 5000
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200534 #Allow policy create with unregistered service for now
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100535
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100536 a1pms_api_get_policy_ids 200 NORIC NOSERVICE 1 5000 2000
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200537
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100538 a1pms_api_get_policy_ids 200 NORIC NOSERVICE 2 NOID
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200539
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100540 a1pms_api_get_policy_ids 200 NORIC NOSERVICE STD_QOS2_0.1.0 5200
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100541
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100542 a1pms_api_get_policy_ids 200 ricsim_g2_1 NOSERVICE 1 NOID
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200543
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100544 a1pms_api_get_policy 200 5000 testdata/OSC/pi1_template.json "service10" ricsim_g1_1 1 false $notificationurl
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200545
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100546 a1pms_api_get_policy 200 5100 testdata/STD/pi1_template.json "service10" ricsim_g2_1 NOTYPE false $notificationurl
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200547
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100548 a1pms_api_get_policy 200 5200 testdata/STD2/pi_qos2_template.json "service10" ricsim_g3_1 STD_QOS2_0.1.0 false $notificationurl
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100549
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100550 a1pms_api_get_policies 200 ricsim_g1_1 "service10" 1 5000 ricsim_g1_1 "service10" 1 false $notificationurl testdata/OSC/pi1_template.json
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200551
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100552 deviation "TR10 - a1pms allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx"
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200553 #kept until decision
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100554 #a1pms_api_delete_policy 404 2000
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200555 #Allow policy create with unregistered service for now
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100556 a1pms_api_delete_policy 204 2000
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200557
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100558 a1pms_api_delete_policy 404 1500
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200559
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100560 a1pms_api_delete_policy 204 5000
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200561
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100562 a1pms_api_delete_policy 204 5200
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100563
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100564 a1pms_equal json:policies 1
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200565
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100566
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100567 a1pms_equal json:policy-instances 1
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200568
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100569 a1pms_api_delete_policy 204 5100
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200570
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100571 a1pms_equal json:policies 0
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200572
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100573 a1pms_equal json:policy-instances 0
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200574
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100575 cr_equal 0 received_callbacks 3
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200576
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200577 if [[ $interface = *"DMAAP"* ]]; then
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200578 mr_greater requests_submitted 0
579 VAL=$(mr_read requests_submitted)
580 mr_equal requests_fetched $VAL
581 mr_equal responses_submitted $VAL
582 mr_equal responses_fetched $VAL
583 mr_equal current_requests 0
584 mr_equal current_responses 0
585 else
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200586 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
587 :
588 else
589 mr_equal requests_submitted 0
590 fi
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200591 fi
BjornMagnussonXAcd938442022-05-11 10:01:24 +0200592 if [ $USE_ISTIO -eq 0 ]; then
593 if [[ $interface = *"SDNC"* ]]; then
594 sim_contains_str ricsim_g1_1 remote_hosts $SDNC_APP_NAME
595 sim_contains_str ricsim_g2_1 remote_hosts $SDNC_APP_NAME
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100596 sim_contains_str ricsim_g3_1 remote_hosts $SDNC_APP_NAME
BjornMagnussonXAcd938442022-05-11 10:01:24 +0200597 else
598 sim_contains_str ricsim_g1_1 remote_hosts $A1PMS_APP_NAME
599 sim_contains_str ricsim_g2_1 remote_hosts $A1PMS_APP_NAME
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100600 sim_contains_str ricsim_g3_1 remote_hosts $A1PMS_APP_NAME
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100601 fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200602 fi
603
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100604 check_a1pms_logs
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200605
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100606 if [[ $interface = *"SDNC"* ]]; then
607 check_sdnc_logs
608 fi
609
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200610 store_logs "${__httpx}__${interface}"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200611
612 done
BjornMagnussonXA80a92002020-03-19 14:31:06 +0100613
614done
615
616#### TEST COMPLETE ####
617
618
619print_result
620
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100621auto_clean_environment