Removal of older test profiles
[nonrtric.git] / test / auto-test / FTC1100.sh
index 0ff083c..2c3cd3b 100755 (executable)
@@ -20,7 +20,7 @@
 
 TC_ONELINE_DESCR="ICS full interfaces walkthrough - with or without istio enabled"
 
-USE_ISTIO=1
+USE_ISTIO=0
 
 #App names to include in the test when running docker, space separated list
 DOCKER_INCLUDED_IMAGES="ICS PRODSTUB CR RICSIM CP HTTPPROXY NGW KUBEPROXY"
@@ -40,7 +40,7 @@ KUBE_PRESTARTED_IMAGES=""
 CONDITIONALLY_IGNORED_IMAGES="NGW"
 
 #Supported test environment profiles
-SUPPORTED_PROFILES="ONAP-HONOLULU ONAP-ISTANBUL ONAP-JAKARTA ORAN-CHERRY ORAN-D-RELEASE ORAN-E-RELEASE ORAN-F-RELEASE"
+SUPPORTED_PROFILES="ONAP-JAKARTA ONAP-KOHN ONAP-LONDON  ORAN-F-RELEASE ORAN-G-RELEASE ORAN-H-RELEASE"
 #Supported run modes
 SUPPORTED_RUNMODES="DOCKER KUBE"
 
@@ -54,6 +54,11 @@ FLAT_A1_EI="1"
 
 clean_environment
 
+if [ $RUNMODE != "KUBE" ]; then
+    USE_ISTIO=0
+    echo "ISTIO not supported by docker - setting USE-ISTIO=0"
+fi
+
 if [ $USE_ISTIO -eq 1 ]; then
     echo -e $RED"#########################################"$ERED
     echo -e $RED"# Work around istio jwks cache"$ERED
@@ -63,9 +68,11 @@ if [ $USE_ISTIO -eq 1 ]; then
     __kube_scale deployment istiod istio-system 1
     echo -e $RED"# Cycle istiod done"
     echo -e $RED"#########################################"$ERED
+    echo ""
 
     istio_enable_istio_namespace $KUBE_SIM_NAMESPACE
     istio_enable_istio_namespace $KUBE_NONRTRIC_NAMESPACE
+    istio_enable_istio_namespace $KUBE_A1SIM_NAMESPACE
 fi
 
 start_kube_proxy
@@ -100,6 +107,8 @@ if [ $USE_ISTIO -eq 1 ]; then
     keycloak_api_create_confidential_client     nrtrealm   icsc
     keycloak_api_generate_client_secret         nrtrealm   icsc
     keycloak_api_get_client_secret              nrtrealm   icsc
+    keycloak_api_create_client_roles            nrtrealm   icsc nrtrole
+    keycloak_api_map_client_roles               nrtrealm   icsc nrtrole
 
     keycloak_api_get_client_token               nrtrealm   icsc
 
@@ -113,13 +122,13 @@ if [ $USE_ISTIO -eq 1 ]; then
     istio_auth_policy_by_issuer         $PROD_STUB_APP_NAME $KUBE_SIM_NAMESPACE KUBEPROXY
 
     istio_req_auth_by_jwksuri           $PROD_STUB_APP_NAME $KUBE_SIM_NAMESPACE nrtrealm
-    istio_auth_policy_by_realm          $PROD_STUB_APP_NAME $KUBE_SIM_NAMESPACE nrtrealm
+    istio_auth_policy_by_realm          $PROD_STUB_APP_NAME $KUBE_SIM_NAMESPACE nrtrealm icsc nrtrole
 
     istio_req_auth_by_jwks              $CR_APP_NAME $KUBE_SIM_NAMESPACE KUBEPROXY "$KUBE_PROXY_ISTIO_JWKS_KEYS"
     istio_auth_policy_by_issuer         $CR_APP_NAME $KUBE_SIM_NAMESPACE KUBEPROXY
 
     istio_req_auth_by_jwksuri           $CR_APP_NAME $KUBE_SIM_NAMESPACE nrtrealm
-    istio_auth_policy_by_realm          $CR_APP_NAME $KUBE_SIM_NAMESPACE nrtrealm
+    istio_auth_policy_by_realm          $CR_APP_NAME $KUBE_SIM_NAMESPACE nrtrealm icsc nrtrole
 
     ics_configure_sec nrtrealm icsc $ICS_SEC
 
@@ -141,12 +150,15 @@ if [ ! -z "$NRT_GATEWAY_APP_NAME" ]; then
     start_gateway $SIM_GROUP/$NRT_GATEWAY_COMPOSE_DIR/$NRT_GATEWAY_CONFIG_FILE
 fi
 
-if [ "$A1PMS_VERSION" == "V2" ]; then
-    start_ric_simulators ricsim_g3 4  STD_2.0.0
-fi
+start_ric_simulators ricsim_g3 4  STD_2.0.0
 
 start_cr 1
 
+if [ $USE_ISTIO -eq 1 ]; then
+    echo "Sleep 120 to let istio settle - enabling istio on workloads may cause initial dns disturbances - temporary unavailable dns names"
+    sleep 120
+fi
+
 CB_JOB="$PROD_STUB_SERVICE_PATH$PROD_STUB_JOB_CALLBACK"
 CB_SV="$PROD_STUB_SERVICE_PATH$PROD_STUB_SUPERVISION_CALLBACK"
 #Targets for ei jobs
@@ -1440,7 +1452,7 @@ ics_api_edp_get_type_2 200 type101 testdata/ics/info-type-1.json
 ics_api_edp_put_producer_2 201 prod-ia $CB_JOB/prod-ia $CB_SV/prod-ia type101
 ics_api_edp_put_producer_2 200 prod-ia $CB_JOB/prod-ia $CB_SV/prod-ia type101
 
-if [[ "$ICS_FEATURE_LEVEL" == *"RESP_CODE_CHANGE_1" ]]; then
+if [[ "$ICS_FEATURE_LEVEL" == *"RESP_CODE_CHANGE_1"* ]]; then
     ics_api_edp_delete_type_2 409 type101
 else
     ics_api_edp_delete_type_2 406 type101
@@ -1960,25 +1972,44 @@ else
     cr_equal 0 received_callbacks 12
 fi
 ### Test of pre and post validation
+if [[ "$ICS_FEATURE_LEVEL" != *"DEFAULT_TYPE_VALIDATION"* ]]; then
+    ics_api_idc_get_type_ids 200 type1 type2 type4 type6 type101 type102 type104 type106
+    ics_api_idc_put_job 404 job150 type150 $TARGET150 info-owner-1 $INFOSTATUS150 testdata/ics/job-template.json VALIDATE
+    ics_api_idc_put_job 201 job160 type160 $TARGET160 info-owner-1 $INFOSTATUS160 testdata/ics/job-template.json
 
-ics_api_idc_get_type_ids 200 type1 type2 type4 type6 type101 type102 type104 type106
-ics_api_idc_put_job 404 job150 type150 $TARGET150 info-owner-1 $INFOSTATUS150 testdata/ics/job-template.json VALIDATE
-ics_api_idc_put_job 201 job160 type160 $TARGET160 info-owner-1 $INFOSTATUS160 testdata/ics/job-template.json
 
-ics_api_idc_get_job_status2 404 job150
-ics_api_idc_get_job_status2 200 job160 DISABLED EMPTYPROD 60
+    ics_api_idc_get_job_status2 404 job150
+    ics_api_idc_get_job_status2 200 job160 DISABLED EMPTYPROD 60
 
-prodstub_arm_producer 200 prod-ig
-prodstub_arm_job_create 200 prod-ig job150
-prodstub_arm_job_create 200 prod-ig job160
+    prodstub_arm_producer 200 prod-ig
+    prodstub_arm_job_create 200 prod-ig job150
+    prodstub_arm_job_create 200 prod-ig job160
 
-ics_api_edp_put_producer_2 201 prod-ig $CB_JOB/prod-ig $CB_SV/prod-ig NOTYPE
-ics_api_edp_get_producer_status 200 prod-ig ENABLED 360
+    ics_api_edp_put_producer_2 201 prod-ig $CB_JOB/prod-ig $CB_SV/prod-ig NOTYPE
+    ics_api_edp_get_producer_status 200 prod-ig ENABLED 360
 
-ics_api_edp_get_producer_2 200 prod-ig $CB_JOB/prod-ig $CB_SV/prod-ig EMPTY
+    ics_api_edp_get_producer_2 200 prod-ig $CB_JOB/prod-ig $CB_SV/prod-ig EMPTY
 
-ics_api_idc_get_job_status2 404 job150
-ics_api_idc_get_job_status2 200 job160 DISABLED EMPTYPROD 60
+    ics_api_idc_get_job_status2 404 job150
+    ics_api_idc_get_job_status2 200 job160 DISABLED EMPTYPROD 60
+else
+    ics_api_idc_get_type_ids 200 type1 type2 type4 type6 type101 type102 type104 type106
+    ics_api_idc_put_job 404 job150 type150 $TARGET150 info-owner-1 $INFOSTATUS150 testdata/ics/job-template.json VALIDATE
+
+    ics_api_idc_get_job_status2 404 job150
+
+    prodstub_arm_producer 200 prod-ig
+    prodstub_arm_job_create 200 prod-ig job150
+    prodstub_arm_job_create 200 prod-ig job160
+
+    ics_api_edp_put_producer_2 201 prod-ig $CB_JOB/prod-ig $CB_SV/prod-ig NOTYPE
+    ics_api_edp_get_producer_status 200 prod-ig ENABLED 360
+
+    ics_api_edp_get_producer_2 200 prod-ig $CB_JOB/prod-ig $CB_SV/prod-ig EMPTY
+
+    ics_api_idc_get_job_status2 404 job150
+    #ics_api_idc_get_job_status2 200 job160 DISABLED EMPTYPROD 60
+fi
 
 prodstub_arm_type 200 prod-ig type160
 
@@ -1992,12 +2023,14 @@ ics_api_edp_get_producer_2 200 prod-ig $CB_JOB/prod-ig $CB_SV/prod-ig type160
 ics_api_idc_put_job 404 job150 type150 $TARGET150 info-owner-1 $INFOSTATUS150 testdata/ics/job-template.json VALIDATE
 
 ics_api_idc_get_job_status2 404 job150
-ics_api_idc_get_job_status2 200 job160 ENABLED 1 prod-ig 60
+if [[ "$ICS_FEATURE_LEVEL" != *"DEFAULT_TYPE_VALIDATION"* ]]; then
+    ics_api_idc_get_job_status2 200 job160 ENABLED 1 prod-ig 60
 
-prodstub_check_jobdata_3 200 prod-ig job160 type160 $TARGET160 info-owner-1 testdata/ics/job-template.json
+    prodstub_check_jobdata_3 200 prod-ig job160 type160 $TARGET160 info-owner-1 testdata/ics/job-template.json
 
-prodstub_equal create/prod-ig/job160 1
-prodstub_equal delete/prod-ig/job160 0
+    prodstub_equal create/prod-ig/job160 1
+    prodstub_equal delete/prod-ig/job160 0
+fi
 
 prodstub_arm_type 200 prod-ig type150
 
@@ -2017,6 +2050,10 @@ ics_api_edp_get_producer_status 200 prod-ig ENABLED 360
 
 ics_api_edp_get_producer_2 200 prod-ig $CB_JOB/prod-ig $CB_SV/prod-ig type160 type150
 
+if [[ "$ICS_FEATURE_LEVEL" == *"DEFAULT_TYPE_VALIDATION"* ]]; then
+    ics_api_idc_put_job 201 job160 type160 $TARGET160 info-owner-1 $INFOSTATUS160 testdata/ics/job-template.json
+fi
+
 ics_api_idc_get_job_status2 404 job150
 ics_api_idc_get_job_status2 200 job160 ENABLED  1 prod-ig
 
@@ -2036,7 +2073,7 @@ fi
 
 if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
 
-    if [[ "$ICS_FEATURE_LEVEL" == *"RESP_CODE_CHANGE_1" ]]; then
+    if [[ "$ICS_FEATURE_LEVEL" == *"RESP_CODE_CHANGE_1"* ]]; then
         ics_api_edp_delete_type_2 409 type104
     else
         ics_api_edp_delete_type_2 406 type104