Merge "Added function test of ecs type subscriptions"
[nonrtric.git] / test / auto-test / FTC2001.sh
index 7ebd682..fffef91 100755 (executable)
@@ -33,7 +33,7 @@ KUBE_PRESTARTED_IMAGES=""
 CONDITIONALLY_IGNORED_IMAGES="NGW"
 
 #Supported test environment profiles
-SUPPORTED_PROFILES="ONAP-HONOLULU  ORAN-CHERRY ORAN-DAWN"
+SUPPORTED_PROFILES="ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-D-RELEASE ORAN-E-RELEASE"
 #Supported run modes
 SUPPORTED_RUNMODES="DOCKER KUBE"
 
@@ -195,6 +195,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_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 +232,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 +252,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,7 +265,22 @@ 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