3 # ============LICENSE_START===============================================
4 # Copyright (C) 2020-2023 Nordix Foundation. All rights reserved.
5 # Copyright (C) 2023 OpenInfra Foundation Europe. All rights reserved.
6 # ========================================================================
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
11 # http://www.apache.org/licenses/LICENSE-2.0
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=================================================
21 TC_ONELINE_DESCR="Basic use case, register service, create/update policy, delete policy, de-register service using both STD and OSC interface while mixing REST"
23 #App names to include in the test when running docker, space separated list
24 DOCKER_INCLUDED_IMAGES="CP CR MR A1PMS RICSIM NGW KUBEPROXY"
26 #App names to include in the test when running kubernetes, space separated list
27 KUBE_INCLUDED_IMAGES=" MR CR A1PMS RICSIM CP KUBEPROXY NGW"
28 #Pre-started app (not started by script) to include in the test when running kubernetes, space separated list
29 KUBE_PRESTARTED_IMAGES=""
31 #Ignore image in DOCKER_INCLUDED_IMAGES, KUBE_INCLUDED_IMAGES if
32 #the image is not configured in the supplied env_file
33 #Used for images not applicable to all supported profile
34 CONDITIONALLY_IGNORED_IMAGES="NGW"
36 #Supported test environment profiles
37 SUPPORTED_PROFILES="ONAP-KOHN ONAP-LONDON ONAP-MONTREAL ORAN-G-RELEASE ORAN-H-RELEASE ORAN-I-RELEASE"
39 SUPPORTED_RUNMODES="DOCKER KUBE"
41 . ../common/testcase_common.sh $@
47 sim_generate_policy_uuid
58 start_ric_simulators ricsim_g1 3 OSC_2.1.0
60 start_ric_simulators ricsim_g2 5 STD_1.1.3
62 start_ric_simulators ricsim_g3 1 STD_2.0.0
64 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
73 start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/$CONTROL_PANEL_CONFIG_FILE
75 if [ ! -z "$NRT_GATEWAY_APP_NAME" ]; then
76 start_gateway $SIM_GROUP/$NRT_GATEWAY_COMPOSE_DIR/$NRT_GATEWAY_CONFIG_FILE
79 start_a1pms NORPOXY $SIM_GROUP/$A1PMS_COMPOSE_DIR/$A1PMS_CONFIG_FILE
86 prepare_a1pms_config NOSDNC ".a1pms_config.json"
88 if [ $RUNMODE == "KUBE" ]; then
89 a1pms_load_config ".a1pms_config.json"
91 a1pms_api_put_configuration 200 ".a1pms_config.json"
94 sleep_wait 120 "Let A1PMS configuration take effect"
96 a1pms_api_get_status 200
98 sim_print ricsim_g1_1 interface
100 sim_print ricsim_g2_1 interface
102 sim_print ricsim_g3_1 interface
104 sim_put_policy_type 201 ricsim_g1_1 1 testdata/OSC/sim_1.json
106 sim_put_policy_type 201 ricsim_g3_1 STD_QOS_0_2_0 testdata/STD2/sim_qos.json
107 a1pms_equal json:policy-types 3 300
111 notificationurl=$CR_SERVICE_APP_PATH_0"/test"
115 a1pms_api_put_service 201 "service1" 3600 "$CR_SERVICE_APP_PATH_0/1"
117 a1pms_api_put_policy 201 "service1" ricsim_g1_1 1 2000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json 1
119 sim_equal ricsim_g1_1 num_instances 1
121 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
127 a1pms_api_put_policy 201 "service1" ricsim_g1_1 1 3000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json 1
129 sim_equal ricsim_g1_1 num_instances 2
134 a1pms_api_put_policy 201 "service1" ricsim_g2_1 NOTYPE 2100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json 1
136 sim_equal ricsim_g2_1 num_instances 1
139 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
145 a1pms_api_put_policy 201 "service1" ricsim_g2_1 NOTYPE 3100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json 1
147 sim_equal ricsim_g2_1 num_instances 2
151 a1pms_api_put_policy 201 "service1" ricsim_g3_1 STD_QOS_0_2_0 2200 true $notificationurl testdata/STD2/pi_qos_template.json 1
153 sim_equal ricsim_g3_1 num_instances 1
155 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
161 a1pms_api_put_policy 201 "service1" ricsim_g3_1 STD_QOS_0_2_0 3200 NOTRANSIENT $notificationurl testdata/STD2/pi_qos_template.json 1
163 sim_equal ricsim_g3_1 num_instances 2
168 a1pms_api_put_service 200 "service1" 3600 "$CR_SERVICE_APP_PATH_0/1"
170 a1pms_api_put_policy 200 "service1" ricsim_g1_1 1 2000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json 1
172 sim_equal ricsim_g1_1 num_instances 2
175 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
181 a1pms_api_put_policy 200 "service1" ricsim_g1_1 1 3000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json 1
183 sim_equal ricsim_g1_1 num_instances 2
189 a1pms_api_put_policy 200 "service1" ricsim_g2_1 NOTYPE 2100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json 1
191 sim_equal ricsim_g2_1 num_instances 2
194 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
200 a1pms_api_put_policy 200 "service1" ricsim_g2_1 NOTYPE 3100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json 1
202 sim_equal ricsim_g2_1 num_instances 2
206 a1pms_api_put_policy 200 "service1" ricsim_g3_1 STD_QOS_0_2_0 2200 true $notificationurl testdata/STD2/pi_qos_template.json 1
208 sim_equal ricsim_g3_1 num_instances 2
211 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
217 a1pms_api_put_policy 200 "service1" ricsim_g3_1 STD_QOS_0_2_0 3200 true $notificationurl testdata/STD2/pi_qos_template.json 1
219 sim_equal ricsim_g3_1 num_instances 2
222 a1pms_api_get_policy 200 2000 testdata/OSC/pi1_template.json "service1" ricsim_g1_1 1 false $notificationurl
223 a1pms_api_get_policy 200 3000 testdata/OSC/pi1_template.json "service1" ricsim_g1_1 1 false $notificationurl
224 a1pms_api_get_policy 200 2100 testdata/STD/pi1_template.json "service1" ricsim_g2_1 NOTYPE false $notificationurl
225 a1pms_api_get_policy 200 3100 testdata/STD/pi1_template.json "service1" ricsim_g2_1 NOTYPE false $notificationurl
226 a1pms_api_get_policy 200 2200 testdata/STD2/pi_qos_template.json "service1" ricsim_g3_1 STD_QOS_0_2_0 true $notificationurl
227 a1pms_api_get_policy 200 3200 testdata/STD2/pi_qos_template.json "service1" ricsim_g3_1 STD_QOS_0_2_0 true $notificationurl
229 sim_equal ricsim_g1_1 num_instances 2
230 sim_equal ricsim_g2_1 num_instances 2
232 sim_equal ricsim_g3_1 num_instances 2
236 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
241 a1pms_api_delete_policy 204 2000
243 a1pms_api_delete_policy 204 3000
244 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
249 a1pms_api_delete_policy 204 2100
251 a1pms_api_delete_policy 204 3100
252 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
257 a1pms_api_delete_policy 204 2200
259 a1pms_api_delete_policy 204 3200
261 sim_equal ricsim_g1_1 num_instances 0
262 sim_equal ricsim_g2_1 num_instances 0
264 sim_equal ricsim_g3_1 num_instances 0
266 # Check remote host access to simulator
268 sim_contains_str ricsim_g1_1 remote_hosts $A1PMS_APP_NAME
269 sim_contains_str ricsim_g2_1 remote_hosts $A1PMS_APP_NAME
270 sim_contains_str ricsim_g3_1 remote_hosts $A1PMS_APP_NAME
272 # Check policy removal
274 a1pms_api_get_policy 404 2000
275 a1pms_api_get_policy 404 3000
276 a1pms_api_get_policy 404 2100
277 a1pms_api_get_policy 404 3100
279 a1pms_api_get_policy 404 2200
280 a1pms_api_get_policy 404 3200
283 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
288 a1pms_api_delete_services 204 "service1"
290 a1pms_api_get_services 404 "service1"
294 #### TEST COMPLETE ####
300 auto_clean_environment