3 # ============LICENSE_START===============================================
4 # Copyright (C) 2020-2023 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
10 # http://www.apache.org/licenses/LICENSE-2.0
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=================================================
20 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"
22 #App names to include in the test when running docker, space separated list
23 DOCKER_INCLUDED_IMAGES="CP CR MR A1PMS RICSIM NGW KUBEPROXY"
25 #App names to include in the test when running kubernetes, space separated list
26 KUBE_INCLUDED_IMAGES=" MR CR A1PMS RICSIM CP KUBEPROXY NGW"
27 #Pre-started app (not started by script) to include in the test when running kubernetes, space separated list
28 KUBE_PRESTARTED_IMAGES=""
30 #Ignore image in DOCKER_INCLUDED_IMAGES, KUBE_INCLUDED_IMAGES if
31 #the image is not configured in the supplied env_file
32 #Used for images not applicable to all supported profile
33 CONDITIONALLY_IGNORED_IMAGES="NGW"
35 #Supported test environment profiles
36 SUPPORTED_PROFILES="ONAP-JAKARTA ONAP-KOHN ONAP-LONDON ORAN-F-RELEASE ORAN-G-RELEASE ORAN-H-RELEASE"
38 SUPPORTED_RUNMODES="DOCKER KUBE"
40 . ../common/testcase_common.sh $@
46 sim_generate_policy_uuid
57 start_ric_simulators ricsim_g1 3 OSC_2.1.0
59 start_ric_simulators ricsim_g2 5 STD_1.1.3
61 start_ric_simulators ricsim_g3 1 STD_2.0.0
63 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
72 start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/$CONTROL_PANEL_CONFIG_FILE
74 if [ ! -z "$NRT_GATEWAY_APP_NAME" ]; then
75 start_gateway $SIM_GROUP/$NRT_GATEWAY_COMPOSE_DIR/$NRT_GATEWAY_CONFIG_FILE
78 start_a1pms NORPOXY $SIM_GROUP/$A1PMS_COMPOSE_DIR/$A1PMS_CONFIG_FILE
85 prepare_a1pms_config NOSDNC ".a1pms_config.json"
87 if [ $RUNMODE == "KUBE" ]; then
88 a1pms_load_config ".a1pms_config.json"
90 a1pms_api_put_configuration 200 ".a1pms_config.json"
93 sleep_wait 120 "Let A1PMS configuration take effect"
95 a1pms_api_get_status 200
97 sim_print ricsim_g1_1 interface
99 sim_print ricsim_g2_1 interface
101 sim_print ricsim_g3_1 interface
103 sim_put_policy_type 201 ricsim_g1_1 1 testdata/OSC/sim_1.json
105 sim_put_policy_type 201 ricsim_g3_1 STD_QOS_0_2_0 testdata/STD2/sim_qos.json
106 a1pms_equal json:policy-types 3 300
110 notificationurl=$CR_SERVICE_APP_PATH_0"/test"
114 a1pms_api_put_service 201 "service1" 3600 "$CR_SERVICE_APP_PATH_0/1"
116 a1pms_api_put_policy 201 "service1" ricsim_g1_1 1 2000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json 1
118 sim_equal ricsim_g1_1 num_instances 1
120 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
126 a1pms_api_put_policy 201 "service1" ricsim_g1_1 1 3000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json 1
128 sim_equal ricsim_g1_1 num_instances 2
133 a1pms_api_put_policy 201 "service1" ricsim_g2_1 NOTYPE 2100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json 1
135 sim_equal ricsim_g2_1 num_instances 1
138 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
144 a1pms_api_put_policy 201 "service1" ricsim_g2_1 NOTYPE 3100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json 1
146 sim_equal ricsim_g2_1 num_instances 2
150 a1pms_api_put_policy 201 "service1" ricsim_g3_1 STD_QOS_0_2_0 2200 true $notificationurl testdata/STD2/pi_qos_template.json 1
152 sim_equal ricsim_g3_1 num_instances 1
154 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
160 a1pms_api_put_policy 201 "service1" ricsim_g3_1 STD_QOS_0_2_0 3200 NOTRANSIENT $notificationurl testdata/STD2/pi_qos_template.json 1
162 sim_equal ricsim_g3_1 num_instances 2
167 a1pms_api_put_service 200 "service1" 3600 "$CR_SERVICE_APP_PATH_0/1"
169 a1pms_api_put_policy 200 "service1" ricsim_g1_1 1 2000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json 1
171 sim_equal ricsim_g1_1 num_instances 2
174 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
180 a1pms_api_put_policy 200 "service1" ricsim_g1_1 1 3000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json 1
182 sim_equal ricsim_g1_1 num_instances 2
188 a1pms_api_put_policy 200 "service1" ricsim_g2_1 NOTYPE 2100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json 1
190 sim_equal ricsim_g2_1 num_instances 2
193 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
199 a1pms_api_put_policy 200 "service1" ricsim_g2_1 NOTYPE 3100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json 1
201 sim_equal ricsim_g2_1 num_instances 2
205 a1pms_api_put_policy 200 "service1" ricsim_g3_1 STD_QOS_0_2_0 2200 true $notificationurl testdata/STD2/pi_qos_template.json 1
207 sim_equal ricsim_g3_1 num_instances 2
210 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
216 a1pms_api_put_policy 200 "service1" ricsim_g3_1 STD_QOS_0_2_0 3200 true $notificationurl testdata/STD2/pi_qos_template.json 1
218 sim_equal ricsim_g3_1 num_instances 2
221 a1pms_api_get_policy 200 2000 testdata/OSC/pi1_template.json "service1" ricsim_g1_1 1 false $notificationurl
222 a1pms_api_get_policy 200 3000 testdata/OSC/pi1_template.json "service1" ricsim_g1_1 1 false $notificationurl
223 a1pms_api_get_policy 200 2100 testdata/STD/pi1_template.json "service1" ricsim_g2_1 NOTYPE false $notificationurl
224 a1pms_api_get_policy 200 3100 testdata/STD/pi1_template.json "service1" ricsim_g2_1 NOTYPE false $notificationurl
225 a1pms_api_get_policy 200 2200 testdata/STD2/pi_qos_template.json "service1" ricsim_g3_1 STD_QOS_0_2_0 true $notificationurl
226 a1pms_api_get_policy 200 3200 testdata/STD2/pi_qos_template.json "service1" ricsim_g3_1 STD_QOS_0_2_0 true $notificationurl
228 sim_equal ricsim_g1_1 num_instances 2
229 sim_equal ricsim_g2_1 num_instances 2
231 sim_equal ricsim_g3_1 num_instances 2
235 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
240 a1pms_api_delete_policy 204 2000
242 a1pms_api_delete_policy 204 3000
243 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
248 a1pms_api_delete_policy 204 2100
250 a1pms_api_delete_policy 204 3100
251 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
256 a1pms_api_delete_policy 204 2200
258 a1pms_api_delete_policy 204 3200
260 sim_equal ricsim_g1_1 num_instances 0
261 sim_equal ricsim_g2_1 num_instances 0
263 sim_equal ricsim_g3_1 num_instances 0
265 # Check remote host access to simulator
267 sim_contains_str ricsim_g1_1 remote_hosts $A1PMS_APP_NAME
268 sim_contains_str ricsim_g2_1 remote_hosts $A1PMS_APP_NAME
269 sim_contains_str ricsim_g3_1 remote_hosts $A1PMS_APP_NAME
271 # Check policy removal
273 a1pms_api_get_policy 404 2000
274 a1pms_api_get_policy 404 3000
275 a1pms_api_get_policy 404 2100
276 a1pms_api_get_policy 404 3100
278 a1pms_api_get_policy 404 2200
279 a1pms_api_get_policy 404 3200
282 if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
287 a1pms_api_delete_services 204 "service1"
289 a1pms_api_get_services 404 "service1"
293 #### TEST COMPLETE ####
299 auto_clean_environment