blob: dfcee33234936974551f4169f25395ac541099b3 [file] [log] [blame]
BjornMagnussonXA70e878f2020-05-11 14:11:30 +02001#!/bin/bash
BjornMagnussonXA80a92002020-03-19 14:31:06 +01002
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
20
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +010021TC_ONELINE_DESCR="Full a1pms API walkthrough using a1pms REST/DMAAP and with/without SDNC A1 Controller"
BjornMagnussonXA80a92002020-03-19 14:31:06 +010022
BjornMagnussonXAcd938442022-05-11 10:01:24 +020023USE_ISTIO=1
24
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010025#App names to include in the test when running docker, space separated list
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +010026DOCKER_INCLUDED_IMAGES="CBS CONSUL CP CR MR A1PMS RICSIM SDNC NGW KUBEPROXY"
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +020027
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010028#App names to include in the test when running kubernetes, space separated list
BjornMagnussonXAcd938442022-05-11 10:01:24 +020029if [ $USE_ISTIO -eq 0 ]; then
30 KUBE_INCLUDED_IMAGES="CP CR MR A1PMS RICSIM SDNC KUBEPROXY NGW"
31else
32 KUBE_INCLUDED_IMAGES="CP CR MR A1PMS RICSIM SDNC KUBEPROXY NGW KEYCLOAK ISTIO AUTHSIDECAR"
33fi
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010034#Prestarted app (not started by script) to include in the test when running kubernetes, space separated list
35KUBE_PRESTARTED_IMAGES=""
36
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010037#Ignore image in DOCKER_INCLUDED_IMAGES, KUBE_INCLUDED_IMAGES if
38#the image is not configured in the supplied env_file
39#Used for images not applicable to all supported profile
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +010040CONDITIONALLY_IGNORED_IMAGES="CBS CONSUL NGW"
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010041
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010042#Supported test environment profiles
BjornMagnussonXAe60d04e2021-12-27 13:38:01 +010043SUPPORTED_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 +010044#Supported run modes
45SUPPORTED_RUNMODES="DOCKER KUBE"
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +010046
BjornMagnussonXA79e37002021-11-22 13:36:04 +010047. ../common/testcase_common.sh $@
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010048
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010049setup_testenvironment
BjornMagnussonXA80a92002020-03-19 14:31:06 +010050
51#### TEST BEGIN ####
52
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010053generate_policy_uuid
BjornMagnussonXAad047782020-06-08 15:54:11 +020054
BjornMagnussonXAcd938442022-05-11 10:01:24 +020055if [ $USE_ISTIO -eq 0 ]; then
56 # Tested variants of REST/DMAAP/SDNC config
57 TESTED_VARIANTS="REST DMAAP REST+SDNC DMAAP+SDNC"
BjornMagnussonXA4207b832020-11-03 09:52:49 +010058
BjornMagnussonXAcd938442022-05-11 10:01:24 +020059 #Test a1pms and simulator protocol versions (others are http only)
60 TESTED_PROTOCOLS="HTTP HTTPS"
61else
62 if [ $USE_ISTIO -eq 1 ]; then
63 echo -e $RED"#########################################"$ERED
64 echo -e $RED"# No test of https when running with istio"$ERED
65 echo -e $RED"# No test of SDNC when running with istio"$ERED
66 echo -e $RED"#########################################"$ERED
67 fi
68 # Tested variants of REST/DMAAP/SDNC config
69 TESTED_VARIANTS="REST DMAAP"
70
71 #Test a1pms and simulator protocol versions (others are http only)
72 TESTED_PROTOCOLS="HTTP"
73fi
BjornMagnussonXA4207b832020-11-03 09:52:49 +010074
BjornMagnussonXA72667f12020-04-24 09:20:18 +020075for __httpx in $TESTED_PROTOCOLS ; do
76 for interface in $TESTED_VARIANTS ; do
BjornMagnussonXA80a92002020-03-19 14:31:06 +010077
BjornMagnussonXA72667f12020-04-24 09:20:18 +020078 echo "#####################################################################"
79 echo "#####################################################################"
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +010080 echo "### Testing a1pms: $interface using $__httpx"
BjornMagnussonXA72667f12020-04-24 09:20:18 +020081 echo "#####################################################################"
82 echo "#####################################################################"
BjornMagnussonXA80a92002020-03-19 14:31:06 +010083
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +010084 # Clean container and start all needed containers #
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010085 clean_environment
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +010086
BjornMagnussonXAcd938442022-05-11 10:01:24 +020087 if [ $RUNMODE != "KUBE" ]; then
88 USE_ISTIO=0
89 echo "ISTIO not supported by docker - setting USE-ISTIO=0"
90 fi
91
92 if [ $USE_ISTIO -eq 1 ]; then
93 echo -e $RED"#########################################"$ERED
94 echo -e $RED"# Work around istio jwks cache"$ERED
95 echo -e $RED"# Cycle istiod down and up to clear cache"$ERED
96 echo ""
97 __kube_scale deployment istiod istio-system 0
98 __kube_scale deployment istiod istio-system 1
99 echo -e $RED"# Cycle istiod done"
100 echo -e $RED"#########################################"$ERED
101
102 istio_enable_istio_namespace $KUBE_SIM_NAMESPACE
103 istio_enable_istio_namespace $KUBE_NONRTRIC_NAMESPACE
104 istio_enable_istio_namespace $KUBE_A1SIM_NAMESPACE
105 fi
106
107
BjornMagnussonXA663566c2021-11-08 10:25:07 +0100108 start_kube_proxy
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +0100109
BjornMagnussonXAcd938442022-05-11 10:01:24 +0200110 if [ $USE_ISTIO -eq 1 ]; then
111 start_keycloak
112
113 keycloak_api_obtain_admin_token
114
115 keycloak_api_create_realm nrtrealm true 60
116 keycloak_api_create_confidential_client nrtrealm a1pmsc
117 keycloak_api_generate_client_secret nrtrealm a1pmsc
118 keycloak_api_get_client_secret nrtrealm a1pmsc
119 keycloak_api_create_client_roles nrtrealm a1pmsc nrtrole
120 keycloak_api_map_client_roles nrtrealm a1pmsc nrtrole
121
122 keycloak_api_get_client_token nrtrealm a1pmsc
123
124 CLIENT_TOKEN=$(keycloak_api_read_client_token nrtrealm a1pmsc)
125 echo "CLIENT_TOKEN: "$CLIENT_TOKEN
126
127 A1PMS_SEC=$(keycloak_api_read_client_secret nrtrealm a1pmsc)
128 echo "A1PMS_SEC: "$A1PMS_SEC
129
130 # Protect ricsim-g3
131 istio_req_auth_by_jwks ricsim-g1 $KUBE_A1SIM_NAMESPACE KUBEPROXY "$KUBE_PROXY_ISTIO_JWKS_KEYS"
132 istio_auth_policy_by_issuer ricsim-g1 $KUBE_A1SIM_NAMESPACE KUBEPROXY
133
134 istio_req_auth_by_jwksuri ricsim-g1 $KUBE_A1SIM_NAMESPACE nrtrealm
135 istio_auth_policy_by_realm ricsim-g1 $KUBE_A1SIM_NAMESPACE nrtrealm a1pmsc nrtrole
136
137 # Protect ricsim-g2
138 istio_req_auth_by_jwks ricsim-g2 $KUBE_A1SIM_NAMESPACE KUBEPROXY "$KUBE_PROXY_ISTIO_JWKS_KEYS"
139 istio_auth_policy_by_issuer ricsim-g2 $KUBE_A1SIM_NAMESPACE KUBEPROXY
140
141 istio_req_auth_by_jwksuri ricsim-g2 $KUBE_A1SIM_NAMESPACE nrtrealm
142 istio_auth_policy_by_realm ricsim-g2 $KUBE_A1SIM_NAMESPACE nrtrealm a1pmsc nrtrole
143
144 # Protect ricsim-g3
145 istio_req_auth_by_jwks ricsim-g3 $KUBE_A1SIM_NAMESPACE KUBEPROXY "$KUBE_PROXY_ISTIO_JWKS_KEYS"
146 istio_auth_policy_by_issuer ricsim-g3 $KUBE_A1SIM_NAMESPACE KUBEPROXY
147
148 istio_req_auth_by_jwksuri ricsim-g3 $KUBE_A1SIM_NAMESPACE nrtrealm
149 istio_auth_policy_by_realm ricsim-g3 $KUBE_A1SIM_NAMESPACE nrtrealm a1pmsc nrtrole
150
151 # Protect CR
152 istio_req_auth_by_jwks $CR_APP_NAME $KUBE_SIM_NAMESPACE KUBEPROXY "$KUBE_PROXY_ISTIO_JWKS_KEYS"
153 istio_auth_policy_by_issuer $CR_APP_NAME $KUBE_SIM_NAMESPACE KUBEPROXY
154
155 istio_req_auth_by_jwksuri $CR_APP_NAME $KUBE_SIM_NAMESPACE nrtrealm
156 istio_auth_policy_by_realm $CR_APP_NAME $KUBE_SIM_NAMESPACE nrtrealm a1pmsc nrtrole
157
158 a1pms_configure_sec nrtrealm a1pmsc $A1PMS_SEC
159 fi
160
BjornMagnussonXA496156d2020-08-10 14:16:24 +0200161 if [ $__httpx == "HTTPS" ]; then
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100162 use_cr_https
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100163 use_a1pms_rest_https
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100164 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100165 use_a1pms_rest_http
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100166 use_cr_http
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100167 fi
168
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100169 start_a1pms NORPOXY $SIM_GROUP/$A1PMS_COMPOSE_DIR/$A1PMS_CONFIG_FILE
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100170
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100171 set_a1pms_debug
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100172
173 # Create service to be able to receive events when rics becomes available
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100174 # Must use rest towards the a1pms since dmaap is not configured yet
175 a1pms_api_put_service 201 "ric-registration" 0 "$CR_SERVICE_APP_PATH_0/ric-registration"
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100176
177
178 if [ $__httpx == "HTTPS" ]; then
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200179 use_simulator_https
180 use_mr_https
181 if [[ $interface = *"SDNC"* ]]; then
182 use_sdnc_https
183 fi
184 if [[ $interface = *"DMAAP"* ]]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100185 use_a1pms_dmaap_https
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200186 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100187 use_a1pms_rest_https
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200188 fi
BjornMagnussonXA496156d2020-08-10 14:16:24 +0200189 else
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200190 use_simulator_http
191 use_mr_http
192 if [[ $interface = *"SDNC"* ]]; then
193 use_sdnc_http
194 fi
195 if [[ $interface = *"DMAAP"* ]]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100196 use_a1pms_dmaap_http
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200197 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100198 use_a1pms_rest_http
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200199 fi
BjornMagnussonXA496156d2020-08-10 14:16:24 +0200200 fi
BjornMagnussonXA80a92002020-03-19 14:31:06 +0100201
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200202 start_ric_simulators ricsim_g1 1 OSC_2.1.0
203 start_ric_simulators ricsim_g2 1 STD_1.1.3
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100204
205 sim_put_policy_type 201 ricsim_g1_1 1 testdata/OSC/sim_1.json
206 sim_put_policy_type 201 ricsim_g1_1 2 testdata/OSC/sim_2.json
207
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100208 if [ "$A1PMS_VERSION" == "V2" ]; then
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100209 start_ric_simulators ricsim_g3 1 STD_2.0.0
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100210 sim_put_policy_type 201 ricsim_g3_1 STD_QOS_0_2_0 testdata/STD2/sim_qos.json
211 sim_put_policy_type 201 ricsim_g3_1 STD_QOS2_0.1.0 testdata/STD2/sim_qos2.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100212 fi
BjornMagnussonXA80a92002020-03-19 14:31:06 +0100213
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200214 start_mr
BjornMagnussonXA80a92002020-03-19 14:31:06 +0100215
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100216 start_cr 1
BjornMagnussonXA80a92002020-03-19 14:31:06 +0100217
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +0100218 start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/$CONTROL_PANEL_CONFIG_FILE
219
220 if [ ! -z "$NRT_GATEWAY_APP_NAME" ]; then
221 start_gateway $SIM_GROUP/$NRT_GATEWAY_COMPOSE_DIR/$NRT_GATEWAY_CONFIG_FILE
222 fi
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100223
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200224 if [[ $interface = *"SDNC"* ]]; then
225 start_sdnc
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200226 prepare_consul_config SDNC ".consul_config.json"
227 else
228 prepare_consul_config NOSDNC ".consul_config.json"
229 fi
BjornMagnussonXA80a92002020-03-19 14:31:06 +0100230
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100231 if [ $RUNMODE == "KUBE" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100232 a1pms_load_config ".consul_config.json"
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100233 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100234 if [[ "$A1PMS_FEATURE_LEVEL" == *"NOCONSUL"* ]]; then
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100235 #Temporary switch to http/https if dmaap use. Otherwise it is not possibble to push config
236 if [ $__httpx == "HTTPS" ]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100237 use_a1pms_rest_https
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100238 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100239 use_a1pms_rest_http
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100240 fi
241
242 if [[ $interface != *"DMAAP"* ]]; then
243 echo "{}" > ".consul_config_incorrect.json"
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100244 a1pms_api_put_configuration 400 ".consul_config_incorrect.json"
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100245 fi
246
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100247 a1pms_api_put_configuration 200 ".consul_config.json"
248 a1pms_api_get_configuration 200 ".consul_config.json"
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100249 if [ $__httpx == "HTTPS" ]; then
250 if [[ $interface = *"DMAAP"* ]]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100251 use_a1pms_dmaap_https
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100252 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100253 use_a1pms_rest_https
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100254 fi
255 else
256 if [[ $interface = *"DMAAP"* ]]; then
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100257 use_a1pms_dmaap_http
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100258 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100259 use_a1pms_rest_http
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100260 fi
261 fi
262
263 else
264 start_consul_cbs
265 consul_config_app ".consul_config.json"
266 fi
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100267 fi
BjornMagnussonXA80a92002020-03-19 14:31:06 +0100268
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100269 if [ "$A1PMS_VERSION" == "V2" ]; then
270 a1pms_equal json:rics 3 300
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200271
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100272 a1pms_equal json:policy-types 5 120
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200273
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100274 a1pms_equal json:policies 0
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200275
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100276 a1pms_equal json:policy-instances 0
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100277 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100278 a1pms_equal json:rics 2 300
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100279
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100280 a1pms_equal json:policy_schemas 3 120
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100281
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100282 a1pms_equal json:policy_types 3
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100283
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100284 a1pms_equal json:policies 0
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100285
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100286 a1pms_equal json:policy_ids 0
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100287 fi
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200288
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100289 if [ "$A1PMS_VERSION" == "V2" ]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100290 cr_equal 0 received_callbacks 3 120
291 cr_api_check_all_sync_events 200 0 ric-registration ricsim_g1_1 ricsim_g2_1 ricsim_g3_1
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100292 fi
293 mr_equal requests_submitted 0
294
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200295
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200296 echo "############################################"
297 echo "############## Health check ################"
298 echo "############################################"
299
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100300 a1pms_api_get_status 200
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200301
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100302 a1pms_api_get_status_root 200
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100303
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200304 echo "############################################"
305 echo "##### Service registry and supervision #####"
306 echo "############################################"
307
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100308 a1pms_api_get_services 404 "service1"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200309
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100310 a1pms_api_put_service 201 "service1" 1000 "$CR_SERVICE_APP_PATH_0/1"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200311
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100312 a1pms_api_put_service 200 "service1" 2000 "$CR_SERVICE_APP_PATH_0/1"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200313
314
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100315 a1pms_api_put_service 400 "service2" -1 "$CR_SERVICE_APP_PATH_0/2"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200316
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100317 a1pms_api_put_service 400 "service2" "wrong" "$CR_SERVICE_APP_PATH_0/2"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200318
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100319 a1pms_api_put_service 400 "service2" 100 "/test"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200320
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100321 a1pms_api_put_service 400 "service2" 100 "test-path"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200322
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100323 a1pms_api_put_service 201 "service2" 300 "ftp://localhost:80/test"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200324
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100325 a1pms_api_get_services 200 "service1" "service1" 2000 "$CR_SERVICE_APP_PATH_0/1"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200326
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100327 a1pms_api_get_service_ids 200 "service1" "service2" "ric-registration"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200328
329
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100330 a1pms_api_put_service 201 "service3" 5000 "$CR_SERVICE_APP_PATH_0/3"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200331
332
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100333 a1pms_api_get_service_ids 200 "service1" "service2" "service3" "ric-registration"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200334
335
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100336 a1pms_api_get_services 200 "service1" "service1" 2000 "$CR_SERVICE_APP_PATH_0/1"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200337
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100338 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 +0200339
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100340 a1pms_api_get_services 200
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200341
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200342 deviation "TR2 - Keep alive shall return 200/201 according to doc, only 200 works - test combo $interface and $__httpx"
343 #The below should work, keept here until fixed or other decision made
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100344 #a1pms_api_put_services_keepalive 201 "service1"
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200345 #Using the below until decision
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100346 a1pms_api_put_services_keepalive 200 "service1"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200347
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200348 deviation "TR2 - Keep alive shall return 200/201 according to doc, only 200 works - test combo $interface and $__httpx"
349 #The below should work, keept here until fixed or other decision made
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100350 #a1pms_api_put_services_keepalive 201 "service3"
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200351 #Using the below until decision
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100352 a1pms_api_put_services_keepalive 200 "service3"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200353
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100354 a1pms_api_put_services_keepalive 200 "service1"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200355
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100356 a1pms_api_put_services_keepalive 200 "service3"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200357
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100358 a1pms_api_put_services_keepalive 404 "service5"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200359
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100360 a1pms_api_get_service_ids 200 "service1" "service2" "service3" "ric-registration"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200361
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100362 a1pms_api_delete_services 204 "service1"
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200363
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100364 a1pms_api_get_service_ids 200 "service2" "service3" "ric-registration"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200365
366
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100367 a1pms_api_put_service 201 "service1" 50 "$CR_SERVICE_APP_PATH_0/1"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200368
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100369 a1pms_api_get_service_ids 200 "service1" "service2" "service3" "ric-registration"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200370
371
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100372 a1pms_api_delete_services 204 "service1"
373 a1pms_api_delete_services 204 "service3"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200374
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100375 a1pms_equal json:services 2
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200376
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100377 a1pms_api_delete_services 204 "service2"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200378
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100379 a1pms_equal json:services 1
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200380
381
382 echo "############################################"
383 echo "############## RIC Repository ##############"
384 echo "############################################"
385
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100386 if [ "$A1PMS_VERSION" == "V2" ]; then
387 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"
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100388 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100389 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"
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100390 fi
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100391 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 +0200392
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100393 a1pms_api_get_rics 404 47
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200394
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100395 a1pms_api_get_rics 404 "test"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200396
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100397 if [ "$A1PMS_VERSION" == "V2" ]; then
398 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 +0200399
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100400 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 +0200401
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100402 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 +0200403
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100404 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 +0200405
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100406 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 +0100407
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100408 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 +0100409
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100410 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 +0200411
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100412 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 +0200413
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100414 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 +0100415
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100416 a1pms_api_get_ric 404 NOME test1
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100417
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100418 a1pms_api_get_ric 404 test NORIC
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100419
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100420 a1pms_api_get_ric 400 me1_ricsim_g1_1 ricsim_g1_1
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100421
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100422 a1pms_api_get_ric 400 me1_ricsim_g1_1 TESTRIC
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100423
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100424 a1pms_api_get_ric 400 TESTME ricsim_g1_1
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100425
426 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100427 a1pms_api_get_ric 200 me1_ricsim_g1_1 ricsim_g1_1
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100428
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100429 a1pms_api_get_ric 200 me2_ricsim_g1_1 ricsim_g1_1
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100430
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100431 a1pms_api_get_ric 200 me1_ricsim_g2_1 ricsim_g2_1
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100432
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100433 a1pms_api_get_ric 200 me2_ricsim_g2_1 ricsim_g2_1
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100434
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100435 a1pms_api_get_ric 404 test
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100436 fi
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200437
438 echo "############################################"
439 echo "########### A1 Policy Management ###########"
440 echo "############################################"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200441
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100442 if [ "$A1PMS_VERSION" == "V2" ]; then
443 deviation "TR9 - a1pms modify the type with type id - test combo $interface and $__httpx"
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100444 #Behaviour accepted for now
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100445 a1pms_api_get_policy_type 200 1 testdata/OSC/1-a1pms-modified.json
446 deviation "TR9 - a1pms modify the type with type id - test combo $interface and $__httpx"
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100447 #Behaviour accepted for now
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100448 a1pms_api_get_policy_type 200 2 testdata/OSC/2-a1pms-modified.json
449 deviation "TR9 - a1pms modify the type with type id - test combo $interface and $__httpx"
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100450 #Behaviour accepted for now
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100451 a1pms_api_get_policy_type 200 STD_QOS_0_2_0 testdata/STD2/qos-a1pms-modified.json
452 deviation "TR9 - a1pms modify the type with type id - test combo $interface and $__httpx"
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100453 #Behaviour accepted for now
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100454 a1pms_api_get_policy_type 200 STD_QOS2_0.1.0 testdata/STD2/qos2-a1pms-modified.json
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200455
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100456 a1pms_api_get_policy_type 404 3
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100457 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100458 deviation "TR9 - a1pms modify the type with type id - test combo $interface and $__httpx"
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100459 #Behaviour accepted for now
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100460 a1pms_api_get_policy_schema 200 1 testdata/OSC/1-a1pms-modified.json
461 deviation "TR9 - a1pms modify the type with type id - test combo $interface and $__httpx"
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100462 #Behaviour accepted for now
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100463 a1pms_api_get_policy_schema 200 2 testdata/OSC/2-a1pms-modified.json
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200464
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100465 a1pms_api_get_policy_schema 404 3
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100466 fi
467
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100468 if [ "$A1PMS_VERSION" == "V2" ]; then
469 a1pms_api_get_policy_schemas 404
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100470 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100471 deviation "TR9 - a1pms modify the type with type id - test combo $interface and $__httpx"
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100472 #Behaviour accepted for now
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100473 a1pms_api_get_policy_schemas 200 NORIC testdata/OSC/1-a1pms-modified.json testdata/OSC/2-a1pms-modified.json NOFILE
474 deviation "TR9 - a1pms modify the type with type id - test combo $interface and $__httpx"
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100475 #Behaviour accepted for now
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100476 a1pms_api_get_policy_schemas 200 ricsim_g1_1 testdata/OSC/1-a1pms-modified.json testdata/OSC/2-a1pms-modified.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100477
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100478 a1pms_api_get_policy_schemas 200 ricsim_g2_1 NOFILE
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100479
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100480 a1pms_api_get_policy_schemas 404 test
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100481 fi
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200482
483
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100484 if [ "$A1PMS_VERSION" == "V2" ]; then
485 a1pms_api_get_policy_types 200 NORIC 1 2 EMPTY STD_QOS_0_2_0 STD_QOS2_0.1.0
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100486 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100487 a1pms_api_get_policy_types 200 NORIC 1 2 EMPTY
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100488 fi
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200489
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100490 a1pms_api_get_policy_types 200 ricsim_g1_1 1 2
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200491
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100492 a1pms_api_get_policy_types 200 ricsim_g2_1 EMPTY
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200493
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100494 if [ "$A1PMS_VERSION" == "V2" ]; then
495 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 +0100496 fi
497
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100498 a1pms_api_get_policy_types 404 dummy-ric
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200499
500
501
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100502 a1pms_api_put_service 201 "service10" 3600 "$CR_SERVICE_APP_PATH_0/1"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200503
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100504 if [ "$A1PMS_VERSION" == "V2" ]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100505 notificationurl=$CR_SERVICE_APP_PATH_0"/test"
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100506 else
507 notificationurl=""
508 fi
BjornMagnussonXA8fbb2262022-01-24 15:20:15 +0100509 if [[ $interface != *"DMAAP"* ]]; then
510 # Badly formatted json is not possible to send via dmaap
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100511 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 +0100512 fi
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100513 deviation "TR10 - a1pms allows policy creation on unregistered service (orig problem) - test combo $interface and $__httpx"
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200514 #Kept until decison
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100515 #a1pms_api_put_policy 400 "unregistered-service" ricsim_g1_1 1 2000 NOTRANSIENT testdata/OSC/pi1_template.json
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200516 #Allow 201 for now
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100517 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 +0200518
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100519 a1pms_api_put_policy 201 "service10" ricsim_g1_1 1 5000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json
520 a1pms_api_put_policy 200 "service10" ricsim_g1_1 1 5000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200521
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100522 a1pms_api_put_policy 200 "service10" ricsim_g1_1 1 5000 true $notificationurl testdata/OSC/pi1_template.json
523 a1pms_api_put_policy 200 "service10" ricsim_g1_1 1 5000 false $notificationurl testdata/OSC/pi1_template.json
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200524
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100525 a1pms_api_put_policy 201 "service10" ricsim_g2_1 NOTYPE 5100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json
526 a1pms_api_put_policy 200 "service10" ricsim_g2_1 NOTYPE 5100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json
BjornMagnussonXAbbd2e9d2020-05-27 21:24:06 +0200527
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100528 a1pms_api_put_policy 200 "service10" ricsim_g2_1 NOTYPE 5100 true $notificationurl testdata/STD/pi1_template.json
529 a1pms_api_put_policy 200 "service10" ricsim_g2_1 NOTYPE 5100 false $notificationurl testdata/STD/pi1_template.json
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200530
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100531 if [ "$A1PMS_VERSION" == "V2" ]; then
532 a1pms_api_put_policy 201 "service10" ricsim_g3_1 STD_QOS2_0.1.0 5200 NOTRANSIENT $notificationurl testdata/STD2/pi_qos2_template.json
533 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 +0100534
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100535 a1pms_api_put_policy 200 "service10" ricsim_g3_1 STD_QOS2_0.1.0 5200 true $notificationurl testdata/STD2/pi_qos2_template.json
536 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 +0100537 fi
538
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100539 a1pms_api_get_policy_status 404 1
540 a1pms_api_get_policy_status 404 2
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200541 VAL='NOT IN EFFECT'
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100542 a1pms_api_get_policy_status 200 5000 OSC "$VAL" "false"
543 a1pms_api_get_policy_status 200 5100 STD "UNDEFINED"
544 if [ "$A1PMS_VERSION" == "V2" ]; then
545 a1pms_api_get_policy_status 200 5200 STD2 EMPTY EMPTY
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100546 fi
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200547
548
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100549 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 +0200550 #kept until decision
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100551 #a1pms_equal json:policies 2
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200552 #Allow 3 for now
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100553 if [ "$A1PMS_VERSION" == "V2" ]; then
554 a1pms_equal json:policies 4
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100555 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100556 a1pms_equal json:policies 3
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100557 fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200558
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100559 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 +0200560 #kept until decision
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100561 #a1pms_equal json:policy_ids 2
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200562 #Allow 3 for now
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100563 if [ "$A1PMS_VERSION" == "V2" ]; then
564 a1pms_equal json:policy-instances 4
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100565 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100566 a1pms_equal json:policy_ids 3
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100567 fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200568
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100569 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 +0200570 #kept until decision
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100571 #a1pms_api_get_policy_ids 200 NORIC NOSERVICE NOTYPE 5000 5100
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200572 #Allow policy create with unregistered service for now
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100573 if [ "$A1PMS_VERSION" == "V2" ]; then
574 a1pms_api_get_policy_ids 200 NORIC NOSERVICE NOTYPE 5000 5100 2000 5200
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100575 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100576 a1pms_api_get_policy_ids 200 NORIC NOSERVICE NOTYPE 5000 5100 2000
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100577 fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200578
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100579 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 +0200580 #kept until decision
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100581 #a1pms_api_get_policy_ids 200 ricsim_g1_1 NOSERVICE NOTYPE 5000
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200582 #Allow policy create with unregistered service for now
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100583 if [ "$A1PMS_VERSION" == "V2" ]; then
584 a1pms_api_get_policy_ids 200 ricsim_g1_1 NOSERVICE NOTYPE 5000 2000
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200585
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100586 a1pms_api_get_policy_ids 200 ricsim_g2_1 NOSERVICE NOTYPE 5100
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100587
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100588 a1pms_api_get_policy_ids 200 ricsim_g3_1 NOSERVICE NOTYPE 5200
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100589
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100590 a1pms_api_get_policy_ids 200 NORIC "service10" NOTYPE 5000 5100 5200
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100591 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100592 a1pms_api_get_policy_ids 200 ricsim_g1_1 NOSERVICE NOTYPE 5000 2000
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100593
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100594 a1pms_api_get_policy_ids 200 ricsim_g2_1 NOSERVICE NOTYPE 5100
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200595
596
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100597 a1pms_api_get_policy_ids 200 NORIC "service10" NOTYPE 5000 5100
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100598 fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200599
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100600 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 +0200601 #kept until decision
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100602 #a1pms_api_get_policy_ids 200 NORIC NOSERVICE 1 5000
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200603 #Allow policy create with unregistered service for now
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100604
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100605 a1pms_api_get_policy_ids 200 NORIC NOSERVICE 1 5000 2000
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200606
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100607 a1pms_api_get_policy_ids 200 NORIC NOSERVICE 2 NOID
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200608
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100609 if [ "$A1PMS_VERSION" == "V2" ]; then
610 a1pms_api_get_policy_ids 200 NORIC NOSERVICE STD_QOS2_0.1.0 5200
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100611 fi
612
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100613 a1pms_api_get_policy_ids 200 ricsim_g2_1 NOSERVICE 1 NOID
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200614
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100615 if [ "$A1PMS_VERSION" == "V2" ]; then
616 a1pms_api_get_policy 200 5000 testdata/OSC/pi1_template.json "service10" ricsim_g1_1 1 false $notificationurl
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200617
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100618 a1pms_api_get_policy 200 5100 testdata/STD/pi1_template.json "service10" ricsim_g2_1 NOTYPE false $notificationurl
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200619
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100620 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 +0100621
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100622 a1pms_api_get_policies 200 ricsim_g1_1 "service10" 1 5000 ricsim_g1_1 "service10" 1 false $notificationurl testdata/OSC/pi1_template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100623 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100624 a1pms_api_get_policy 200 5000 testdata/OSC/pi1_template.json
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200625
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100626 a1pms_api_get_policy 200 5100 testdata/STD/pi1_template.json
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200627
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100628 a1pms_api_get_policies 200 ricsim_g1_1 "service10" 1 5000 ricsim_g1_1 "service10" 1 testdata/OSC/pi1_template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100629 fi
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200630
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100631 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 +0200632 #kept until decision
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100633 #a1pms_api_delete_policy 404 2000
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200634 #Allow policy create with unregistered service for now
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100635 a1pms_api_delete_policy 204 2000
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200636
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100637 a1pms_api_delete_policy 404 1500
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200638
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100639 a1pms_api_delete_policy 204 5000
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200640
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100641 if [ "$A1PMS_VERSION" == "V2" ]; then
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100642
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100643 a1pms_api_delete_policy 204 5200
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100644 fi
645
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100646 a1pms_equal json:policies 1
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200647
BjornMagnussonXA2791e082020-11-12 00:52:08 +0100648
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100649 if [ "$A1PMS_VERSION" == "V2" ]; then
650 a1pms_equal json:policy-instances 1
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100651 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100652 a1pms_equal json:policy_ids 1
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100653 fi
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200654
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100655 a1pms_api_delete_policy 204 5100
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200656
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100657 a1pms_equal json:policies 0
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200658
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100659 if [ "$A1PMS_VERSION" == "V2" ]; then
660 a1pms_equal json:policy-instances 0
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100661 else
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100662 a1pms_equal json:policy_ids 0
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100663 fi
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200664
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100665 if [ "$A1PMS_VERSION" == "V2" ]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100666 cr_equal 0 received_callbacks 3
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100667 fi
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200668
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200669 if [[ $interface = *"DMAAP"* ]]; then
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200670 mr_greater requests_submitted 0
671 VAL=$(mr_read requests_submitted)
672 mr_equal requests_fetched $VAL
673 mr_equal responses_submitted $VAL
674 mr_equal responses_fetched $VAL
675 mr_equal current_requests 0
676 mr_equal current_responses 0
677 else
678 mr_equal requests_submitted 0
679 fi
BjornMagnussonXAcd938442022-05-11 10:01:24 +0200680 if [ $USE_ISTIO -eq 0 ]; then
681 if [[ $interface = *"SDNC"* ]]; then
682 sim_contains_str ricsim_g1_1 remote_hosts $SDNC_APP_NAME
683 sim_contains_str ricsim_g2_1 remote_hosts $SDNC_APP_NAME
684 if [ "$A1PMS_VERSION" == "V2" ]; then
685 sim_contains_str ricsim_g3_1 remote_hosts $SDNC_APP_NAME
686 fi
687 else
688 sim_contains_str ricsim_g1_1 remote_hosts $A1PMS_APP_NAME
689 sim_contains_str ricsim_g2_1 remote_hosts $A1PMS_APP_NAME
690 if [ "$A1PMS_VERSION" == "V2" ]; then
691 sim_contains_str ricsim_g3_1 remote_hosts $A1PMS_APP_NAME
692 fi
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100693 fi
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200694 fi
695
BjornMagnussonXAd2aeca82022-03-07 11:04:55 +0100696 check_a1pms_logs
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200697
BjornMagnussonXA49f0e5a2020-11-08 22:41:39 +0100698 if [[ $interface = *"SDNC"* ]]; then
699 check_sdnc_logs
700 fi
701
BjornMagnussonXA70e878f2020-05-11 14:11:30 +0200702 store_logs "${__httpx}__${interface}"
BjornMagnussonXA72667f12020-04-24 09:20:18 +0200703
704 done
BjornMagnussonXA80a92002020-03-19 14:31:06 +0100705
706done
707
708#### TEST COMPLETE ####
709
710
711print_result
712
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100713auto_clean_environment