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="Testing southbound proxy for Dmaap Adapter"
23 #App names to include in the test when running docker, space separated list
24 DOCKER_INCLUDED_IMAGES="CR MR ICS HTTPPROXY KUBEPROXY DMAAPADP"
26 #App names to include in the test when running kubernetes, space separated list
27 KUBE_INCLUDED_IMAGES=" CR MR ICS HTTPPROXY KUBEPROXY DMAAPADP"
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=""
36 #Supported test environment profiles
37 SUPPORTED_PROFILES="ORAN-G-RELEASE ORAN-H-RELEASE ORAN-I-RELEASE"
39 SUPPORTED_RUNMODES="DOCKER KUBE"
41 . ../common/testcase_common.sh $@
47 #Local vars in test script
48 ##########################
65 start_ics NOPROXY $SIM_GROUP/$ICS_COMPOSE_DIR/$ICS_CONFIG_FILE
71 start_dmaapadp PROXY $SIM_GROUP/$DMAAP_ADP_COMPOSE_DIR/$DMAAP_ADP_CONFIG_FILE_TEMPLATE $SIM_GROUP/$DMAAP_ADP_COMPOSE_DIR/$DMAAP_ADP_DATA_FILE
75 ics_equal json:data-producer/v1/info-producers 1 60
77 ics_api_idc_get_job_ids 200 NOTYPE NOWNER EMPTY
78 ics_api_idc_get_type_ids 200 ExampleInformationType ExampleInformationTypeKafka
81 if [[ "$DMAAP_ADP_FEATURE_LEVEL" == *"GENERATED_PROD_NAME"* ]]; then
82 if [ $RUNMODE == "KUBE" ]; then
83 __NAME="https:__$DMAAP_ADP_APP_NAME.$KUBE_NONRTRIC_NAMESPACE:$DMAAP_ADP_EXTERNAL_SECURE_PORT"
85 __NAME="https:__$DMAAP_ADP_APP_NAME:$DMAAP_ADP_INTERNAL_SECURE_PORT"
87 ics_api_edp_get_producer_ids_2 200 NOTYPE $__NAME
89 ics_api_edp_get_producer_ids_2 200 NOTYPE DmaapGenericInfoProducer
92 if [[ "$DMAAP_ADP_FEATURE_LEVEL" == *"FILTERSCHEMA"* ]]; then
93 _template_json=job-template1.1.json
95 _template_json=job-template1.json
97 for ((i=1; i<=$NUM_JOBS; i++))
99 ics_api_idc_put_job 201 joby$i ExampleInformationType $CR_SERVICE_MR_PATH_0/joby-data$i info-ownery$i $CR_SERVICE_MR_PATH_0/job_status_info-ownery$i testdata/dmaap-adapter/$_template_json
102 for ((i=1; i<=$NUM_JOBS; i++))
104 ics_api_a1_get_job_status 200 joby$i ENABLED 30
109 mr_api_send_json "/events/unauthenticated.dmaapadp.json" '{"msg":"msg-1"}'
110 mr_api_send_json "/events/unauthenticated.dmaapadp.json" '{"msg":"msg-3"}'
112 cr_equal 0 received_callbacks $(($NUM_JOBS*2)) 60
114 for ((i=1; i<=$NUM_JOBS; i++))
116 cr_equal 0 received_callbacks?id=joby-data$i 2
119 for ((i=1; i<=$NUM_JOBS; i++))
121 cr_api_check_single_generic_json_event 200 0 joby-data$i '{"msg":"msg-1"}'
122 cr_api_check_single_generic_json_event 200 0 joby-data$i '{"msg":"msg-3"}'
125 cr_contains_str 0 remote_hosts $HTTP_PROXY_APP_NAME
127 #### TEST COMPLETE ####
133 auto_clean_environment