Adaptation of test env to helm chart
[nonrtric.git] / test / auto-test / FTC2001.sh
index ab48c6e..f194817 100755 (executable)
@@ -20,7 +20,7 @@
 TC_ONELINE_DESCR="Testing southbound proxy for PMS and ECS"
 
 #App names to include in the test when running docker, space separated list
-DOCKER_INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM ECS PRODSTUB HTTPPROXY NGW"
+DOCKER_INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM ECS PRODSTUB HTTPPROXY NGW KUBEPROXY"
 
 #App names to include in the test when running kubernetes, space separated list
 KUBE_INCLUDED_IMAGES=" MR CR PA PRODSTUB RICSIM CP ECS HTTPPROXY KUBEPROXY NGW"
@@ -33,7 +33,7 @@ KUBE_PRESTARTED_IMAGES=""
 CONDITIONALLY_IGNORED_IMAGES="NGW"
 
 #Supported test environment profiles
-SUPPORTED_PROFILES="ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-D-RELEASE"
+SUPPORTED_PROFILES="ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-D-RELEASE ORAN-E-RELEASE"
 #Supported run modes
 SUPPORTED_RUNMODES="DOCKER KUBE"
 
@@ -64,7 +64,7 @@ use_ecs_rest_https
 use_prod_stub_https
 
 if [ "$PMS_VERSION" == "V2" ]; then
-    notificationurl=$CR_SERVICE_PATH"/test"
+    notificationurl=$CR_SERVICE_APP_PATH"/test"
 else
    echo "PMS VERSION 2 (V2) is required"
    exit 1
@@ -72,9 +72,7 @@ fi
 
 clean_environment
 
-if [ $RUNMODE == "KUBE" ]; then
-    start_kube_proxy
-fi
+start_kube_proxy
 
 STD_NUM_RICS=2
 
@@ -146,7 +144,7 @@ done
 #Check the number of types
 api_equal json:policy-types 2 300
 
-api_put_service 201 "Emergency-response-app" 0 "$CR_SERVICE_PATH/1"
+api_put_service 201 "Emergency-response-app" 0 "$CR_SERVICE_APP_PATH/1"
 
 # Create policies in STD
 for ((i=1; i<=$STD_NUM_RICS; i++))
@@ -184,8 +182,8 @@ fi
 TARGET1="$RIC_SIM_HTTPX://$RIC_G1_1:$RIC_SIM_PORT/datadelivery"
 TARGET2="$RIC_SIM_HTTPX://$RIC_G1_1:$RIC_SIM_PORT/datadelivery"
 
-STATUS1="$CR_SERVICE_PATH/job1-status"
-STATUS2="$CR_SERVICE_PATH/job2-status"
+STATUS1="$CR_SERVICE_APP_PATH/job1-status"
+STATUS2="$CR_SERVICE_APP_PATH/job2-status"
 
 prodstub_arm_producer 200 prod-a
 prodstub_arm_type 200 prod-a type1
@@ -195,6 +193,15 @@ prodstub_arm_job_create 200 prod-a job2
 ### ecs status
 ecs_api_service_status 200
 
+if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
+    #Type registration status callbacks
+    TYPESTATUS1="$CR_SERVICE_APP_PATH/type-status1"
+
+    ecs_api_idc_put_subscription 201 subscription-id-1 owner1 $TYPESTATUS1
+
+    ecs_api_idc_get_subscription_ids 200 owner1 subscription-id-1
+fi
+
 ## Setup prod-a
 if [ $ECS_VERSION == "V1-1" ]; then
     ecs_api_edp_put_producer 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
@@ -223,7 +230,11 @@ fi
 if [ $ECS_VERSION == "V1-1" ]; then
     prodstub_check_jobdata 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
 else
-    prodstub_check_jobdata_2 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
+    if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
+        prodstub_check_jobdata_2 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
+    else
+        prodstub_check_jobdata_3 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
+    fi
 fi
 
 
@@ -239,7 +250,11 @@ fi
 if [ $ECS_VERSION == "V1-1" ]; then
     prodstub_check_jobdata 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json
 else
-    prodstub_check_jobdata_2 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json
+    if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
+        prodstub_check_jobdata_2 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json
+    else
+        prodstub_check_jobdata_3 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json
+    fi
 fi
 
 # Arm producer prod-a for supervision failure
@@ -248,12 +263,24 @@ prodstub_arm_producer 200 prod-a 400
 # Wait for producer prod-a to go disabled
 ecs_api_edp_get_producer_status 200 prod-a DISABLED 360
 
-ecs_equal json:ei-producer/v1/eiproducers 0 1000
+if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then
+    ecs_equal json:data-producer/v1/info-producers 0 1000
+else
+    ecs_equal json:ei-producer/v1/eiproducers 0 1000
+fi
+
+if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
+    cr_equal received_callbacks 3 30
+    cr_api_check_all_ecs_subscription_events 200 type-status1 type1 testdata/ecs/ei-type-1.json REGISTERED
+    cr_api_check_all_ecs_events 200 job1-status DISABLED
+    cr_api_check_all_ecs_events 200 job2-status DISABLED
+else
+    cr_equal received_callbacks 2 30
+    cr_api_check_all_ecs_events 200 job1-status DISABLED
+    cr_api_check_all_ecs_events 200 job2-status DISABLED
+fi
 
-echo -e $YELLOW"Verify that ECS has send status notification to the callback recevier"$EYELLOW
-echo -e $YELLOW"and check the source of the call in the log to be from the httpproxy"$EYELLOW
-echo -e $YELLOW"Check for 'Calling host'"$EYELLOW
-echo -e $YELLOW"cmd: docker logs <callback-receiver-container-name>"$EYELLOW
+cr_contains_str remote_hosts $HTTP_PROXY_APP_NAME
 
 check_policy_agent_logs
 check_ecs_logs