Test updates for ECS, PMS and SDNC

Proxy in SDNC
Autodelete jobs in ECS
Persistent subscriptions in ECS
Extended info in types
Image uplifts

Issue-ID: NONRTRIC-596

Signed-off-by: BjornMagnussonXA <bjorn.magnusson@est.tech>
Change-Id: Ibc6d80db0edd0188825ec0920d5de5061d571682
diff --git a/test/common/controller_api_functions.sh b/test/common/controller_api_functions.sh
index 3ed3933..d703d83 100644
--- a/test/common/controller_api_functions.sh
+++ b/test/common/controller_api_functions.sh
@@ -272,6 +272,57 @@
     return 0
 }
 
+
+# Stop the sndc
+# args: -
+# args: -
+# (Function for test scripts)
+stop_sdnc() {
+	echo -e $BOLD"Stopping $SDNC_DISPLAY_NAME"$EBOLD
+
+	if [ $RUNMODE == "KUBE" ]; then
+		__log_conf_fail_not_supported " Cannot stop sndc in KUBE mode"
+		return 1
+	else
+		docker stop $SDNC_APP_NAME &> ./tmp/.dockererr
+		if [ $? -ne 0 ]; then
+			__print_err "Could not stop $SDNC_APP_NAME" $@
+			cat ./tmp/.dockererr
+			((RES_CONF_FAIL++))
+			return 1
+		fi
+	fi
+	echo -e $BOLD$GREEN"Stopped"$EGREEN$EBOLD
+	echo ""
+	return 0
+}
+
+# Start a previously stopped sdnc
+# args: -
+# (Function for test scripts)
+start_stopped_sdnc() {
+	echo -e $BOLD"Starting (the previously stopped) $SDNC_DISPLAY_NAME"$EBOLD
+
+	if [ $RUNMODE == "KUBE" ]; then
+		__log_conf_fail_not_supported " Cannot restart sndc in KUBE mode"
+		return 1
+	else
+		docker start $SDNC_APP_NAME &> ./tmp/.dockererr
+		if [ $? -ne 0 ]; then
+			__print_err "Could not start (the stopped) $SDNC_APP_NAME" $@
+			cat ./tmp/.dockererr
+			((RES_CONF_FAIL++))
+			return 1
+		fi
+	fi
+	__check_service_start $SDNC_APP_NAME $SDNC_PATH$SDNC_ALIVE_URL
+	if [ $? -ne 0 ]; then
+		return 1
+	fi
+	echo ""
+	return 0
+}
+
 # Check the agent logs for WARNINGs and ERRORs
 # args: -
 # (Function for test scripts)
diff --git a/test/common/ecs_api_functions.sh b/test/common/ecs_api_functions.sh
index 805fae4..9bde835 100644
--- a/test/common/ecs_api_functions.sh
+++ b/test/common/ecs_api_functions.sh
@@ -1225,7 +1225,7 @@
 
 # API Test function: GET /ei-producer/v1/eitypes/{eiTypeId}
 # API Test function: GET /data-producer/v1/info-types/{infoTypeId}
-# args: (v1_2) <response-code> <type-id> [<job-schema-file> ]
+# args: (v1_2) <response-code> <type-id> [<job-schema-file> [ <info-type-info> ]]
 # (Function for test scripts)
 ecs_api_edp_get_type_2() {
 	__log_test_start $@
@@ -1237,8 +1237,13 @@
 	if [ $# -eq 3 ]; then
 		paramError=0
 	fi
+	if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPE-INFO"* ]]; then
+		if [ $# -eq 4 ]; then
+			paramError=0
+		fi
+	fi
     if [ $paramError -ne 0 ]; then
-		__print_err "<response-code> <type-id> [<job-schema-file> ]" $@
+		__print_err "<response-code> <type-id> [<job-schema-file> [ <info-type-info> ]]" $@
 		return 1
 	fi
 	if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then
@@ -1254,7 +1259,7 @@
 		__log_test_fail_status_code $1 $status
 		return 1
 	fi
-	if [ $# -eq 3 ]; then
+	if [ $# -ge 3 ]; then
 		body=${res:0:${#res}-3}
 
 		if [ -f $3 ]; then
@@ -1263,8 +1268,18 @@
 			__log_test_fail_general "Job template file "$3", does not exist"
 			return 1
 		fi
+		info_data=""
+		if [ $# -gt 3 ]; then
+			if [ -f $4 ]; then
+				info_data=$(cat $4)
+			else
+				__log_test_fail_general "Info-data file "$4", does not exist"
+				return 1
+			fi
+			info_data=",\"info_type_information\":$info_data"
+		fi
 		if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then
-			targetJson="{\"info_job_data_schema\":$schema}"
+			targetJson="{\"info_job_data_schema\":$schema $info_data}"
 		else
 			targetJson="{\"ei_job_data_schema\":$schema}"
 		fi
@@ -1283,23 +1298,42 @@
 
 # API Test function: PUT /ei-producer/v1/eitypes/{eiTypeId}
 # API Test function: PUT /data-producer/v1/info-types/{infoTypeId}
-# args: (v1_2) <response-code> <type-id> <job-schema-file>
+# args: (v1_2) <response-code> <type-id> <job-schema-file> [ <info-type-info> ]
 # (Function for test scripts)
 ecs_api_edp_put_type_2() {
 	__log_test_start $@
 
-    if [ $# -ne 3 ]; then
-		__print_err "<response-code> <type-id> <job-schema-file>" $@
-		return 1
+	if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPE-INFO"* ]]; then
+		if [ $# -lt 3 ] || [ $# -gt 4 ]; then
+			__print_err "<response-code> <type-id> <job-schema-file> [ <info-type-info> ]" $@
+			return 1
+		fi
+	else
+		if [ $# -ne 3 ]; then
+			__print_err "<response-code> <type-id> <job-schema-file>" $@
+			return 1
+		fi
 	fi
 
 	if [ ! -f $3 ]; then
 		__log_test_fail_general "Job schema file "$3", does not exist"
 		return 1
 	fi
+
+	info_data=""
+	if [ $# -gt 3 ]; then
+		if [ -f $4 ]; then
+			info_data=$(cat $4)
+		else
+			__log_test_fail_general "Info-data file "$4", does not exist"
+			return 1
+		fi
+		info_data=",\"info_type_information\":$info_data"
+	fi
+
 	if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then
 		schema=$(cat $3)
-		input_json="{\"info_job_data_schema\":$schema}"
+		input_json="{\"info_job_data_schema\":$schema $info_data}"
 		file="./tmp/put_type.json"
 		echo $input_json > $file
 
diff --git a/test/common/test_env-onap-honolulu.sh b/test/common/test_env-onap-honolulu.sh
index 0797912..54e6fbe 100755
--- a/test/common/test_env-onap-honolulu.sh
+++ b/test/common/test_env-onap-honolulu.sh
@@ -76,10 +76,10 @@
 
 # SDNC A1 Controller remote image and tag
 SDNC_A1_CONTROLLER_IMAGE_BASE="onap/sdnc-image"
-SDNC_A1_CONTROLLER_IMAGE_TAG_LOCAL="2.1.3-SNAPSHOT" ###CHECK THIS
-SDNC_A1_CONTROLLER_IMAGE_TAG_REMOTE_SNAPSHOT="2.1.3-STAGING-latest"
-SDNC_A1_CONTROLLER_IMAGE_TAG_REMOTE="2.1.3-STAGING-latest"  #Will use snapshot repo
-SDNC_A1_CONTROLLER_IMAGE_TAG_REMOTE_RELEASE="2.1.2"
+SDNC_A1_CONTROLLER_IMAGE_TAG_LOCAL="2.1.7-SNAPSHOT" ###CHECK THIS
+SDNC_A1_CONTROLLER_IMAGE_TAG_REMOTE_SNAPSHOT="2.1.7-STAGING-latest"
+SDNC_A1_CONTROLLER_IMAGE_TAG_REMOTE="2.1.7-STAGING-latest"  #Will use snapshot repo
+SDNC_A1_CONTROLLER_IMAGE_TAG_REMOTE_RELEASE="2.1.6"
 
 #SDNC DB remote image and tag
 #The DB is part of SDNC so handled in the same way as SDNC
@@ -320,6 +320,7 @@
 SDNC_KARAF_LOG="/opt/opendaylight/data/log/karaf.log"    # Path to karaf log
 #SDNC_RESPONSE_JSON_KEY="A1-ADAPTER-API:output"           # Key name for output json in replies from sdnc (for upgraded sdnc)
 SDNC_RESPONSE_JSON_KEY="output"                          # Key name for output json in replies from sdnc
+SDNC_FEATURE_LEVEL=""                                    # Space separated list of features
 
 RAPP_CAT_APP_NAME="rappcatalogueservice"                 # Name for the RAPP Catalogue
 RAPP_CAT_DISPLAY_NAME="RAPP Catalogue Service"
diff --git a/test/common/test_env-onap-istanbul.sh b/test/common/test_env-onap-istanbul.sh
index a99ad9d..4982e19 100644
--- a/test/common/test_env-onap-istanbul.sh
+++ b/test/common/test_env-onap-istanbul.sh
@@ -69,9 +69,9 @@
 
 # Policy Agent image and tags
 POLICY_AGENT_IMAGE_BASE="onap/ccsdk-oran-a1policymanagementservice"
-POLICY_AGENT_IMAGE_TAG_LOCAL="1.2.1-SNAPSHOT"
-POLICY_AGENT_IMAGE_TAG_REMOTE_SNAPSHOT="1.2.1-SNAPSHOT"
-POLICY_AGENT_IMAGE_TAG_REMOTE="1.2.1-STAGING-latest" #Will use snapshot repo
+POLICY_AGENT_IMAGE_TAG_LOCAL="1.2.2-SNAPSHOT"
+POLICY_AGENT_IMAGE_TAG_REMOTE_SNAPSHOT="1.2-SNAPSHOT"
+POLICY_AGENT_IMAGE_TAG_REMOTE="1.2.2-STAGING-latest" #Will use snapshot repo
 POLICY_AGENT_IMAGE_TAG_REMOTE_RELEASE="1.2.1"
 
 # SDNC A1 Controller remote image and tag
@@ -86,22 +86,25 @@
 SDNC_DB_IMAGE_BASE="mariadb"
 SDNC_DB_IMAGE_TAG_REMOTE_PROXY="10.5"
 
-# ECS image and tag - uses cherry release
+# ECS image and tag - uses d release
 ECS_IMAGE_BASE="o-ran-sc/nonrtric-enrichment-coordinator-service"
-ECS_IMAGE_TAG_REMOTE_RELEASE_ORAN="1.0.1"
+ECS_IMAGE_TAG_REMOTE_RELEASE_ORAN="1.1.0"
 #Note: Update var ECS_FEATURE_LEVEL if image version is changed
 
-# Control Panel image and tag - uses cherry release
+# Control Panel image and tag - uses d release
 CONTROL_PANEL_IMAGE_BASE="o-ran-sc/nonrtric-controlpanel"
-CONTROL_PANEL_IMAGE_TAG_REMOTE_RELEASE_ORAN="2.1.1"
+CONTROL_PANEL_IMAGE_TAG_REMOTE_RELEASE_ORAN="2.2.0"
 
+# Gateway image and tags - uses d release
+NRT_GATEWAY_IMAGE_BASE="o-ran-sc/nonrtric-gateway"
+NRT_GATEWAY_IMAGE_TAG_REMOTE_RELEASE_ORAN="1.0.0"
 
-# RAPP Catalogue image and tags - uses cherry release
+# RAPP Catalogue image and tags - uses d release
 RAPP_CAT_IMAGE_BASE="o-ran-sc/nonrtric-r-app-catalogue"
 RAPP_CAT_IMAGE_TAG_REMOTE_RELEASE_ORAN="1.0.1"
 
 
-# Near RT RIC Simulator image and tags - uses cherry release
+# Near RT RIC Simulator image and tags - uses d release
 RIC_SIM_IMAGE_BASE="o-ran-sc/a1-simulator"
 RIC_SIM_IMAGE_TAG_REMOTE_RELEASE_ORAN="2.1.0"
 
@@ -165,7 +168,7 @@
 PROJECT_IMAGES_APP_NAMES="PA SDNC"
 
 # List of app short names which images pulled from ORAN
-ORAN_IMAGES_APP_NAMES="CP ECS RICSIM RC"
+ORAN_IMAGES_APP_NAMES="CP ECS RICSIM RC NGW"
 
 # List of app short names which images pulled from ONAP
 ONAP_IMAGES_APP_NAMES=""   # Not used
@@ -224,7 +227,7 @@
 ECS_CONFIG_MOUNT_PATH=/opt/app/enrichment-coordinator-service/config # Internal container path for configuration
 ECS_CONFIG_FILE=application.yaml                         # Config file name
 ECS_VERSION="V1-2"                                       # Version where the types are added in the producer registration
-ECS_FEATURE_LEVEL=""                                     # Space separated list of features
+ECS_FEATURE_LEVEL="INFO-TYPES"                           # Space separated list of features
 
 MR_DMAAP_APP_NAME="dmaap-mr"                             # Name for the Dmaap MR
 MR_STUB_APP_NAME="mr-stub"                               # Name of the MR stub
@@ -320,6 +323,8 @@
 SDNC_KARAF_LOG="/opt/opendaylight/data/log/karaf.log"    # Path to karaf log
 #SDNC_RESPONSE_JSON_KEY="A1-ADAPTER-API:output"           # Key name for output json in replies from sdnc (for upgraded sdnc)
 SDNC_RESPONSE_JSON_KEY="output"                          # Key name for output json in replies from sdnc
+SDNC_FEATURE_LEVEL="TRANS_RESP_CODE"                     # Space separated list of features
+                                                         # TRANS_RESP_CODE: SDNC return southbound response code
 
 RAPP_CAT_APP_NAME="rappcatalogueservice"                 # Name for the RAPP Catalogue
 RAPP_CAT_DISPLAY_NAME="RAPP Catalogue Service"
@@ -343,6 +348,21 @@
 CONTROL_PANEL_CONFIG_FILE=application.properties         # Config file name
 CONTROL_PANEL_HOST_MNT_DIR="./mnt"                       # Mounted dir, relative to compose file, on the host
 
+NRT_GATEWAY_APP_NAME="nonrtricgateway"                   # Name of the Gateway container
+NRT_GATEWAY_DISPLAY_NAME="NonRT-RIC Gateway"
+NRT_GATEWAY_EXTERNAL_PORT=9090                           # Gateway container external port (host -> container)
+NRT_GATEWAY_INTERNAL_PORT=9090                           # Gateway container internal port (container -> container)
+NRT_GATEWAY_EXTERNAL_SECURE_PORT=9091                    # Gateway container external port (host -> container)
+NRT_GATEWAY_INTERNAL_SECURE_PORT=9091                    # Gateway container internal port (container -> container)
+NRT_GATEWAY_LOGPATH="/var/log/nonrtric-gateway/application.log" # Path the application log in the Gateway container
+NRT_GATEWAY_HOST_MNT_DIR="./mnt"                         # Mounted dir, relative to compose file, on the host
+NRT_GATEWAY_ALIVE_URL="/actuator/metrics"                # Base path for alive check
+NRT_GATEWAY_COMPOSE_DIR="ngw"                            # Dir in simulator_group for docker-compose
+NRT_GATEWAY_CONFIG_MOUNT_PATH=/opt/app/nonrtric-gateway/config  # Container internal path for config
+NRT_GATEWAY_CONFIG_FILE=application.yaml                 # Config file name
+NRT_GATEWAY_PKG_NAME="org.springframework.cloud.gateway" # Java base package name
+NRT_GATEWAY_ACTUATOR="/actuator/loggers/$NRT_GATEWAY_PKG_NAME" # Url for trace/debug
+
 HTTP_PROXY_APP_NAME="httpproxy"                          # Name of the Http Proxy container
 HTTP_PROXY_DISPLAY_NAME="Http Proxy"
 HTTP_PROXY_EXTERNAL_PORT=8740                            # Http Proxy container external port (host -> container)
diff --git a/test/common/test_env-oran-d-release.sh b/test/common/test_env-oran-d-release.sh
index 399f362..385dafe 100755
--- a/test/common/test_env-oran-d-release.sh
+++ b/test/common/test_env-oran-d-release.sh
@@ -89,9 +89,9 @@
 NRT_GATEWAY_IMAGE_TAG_REMOTE_RELEASE="1.0.0"
 
 
-# SDNC A1 Controller image and tags - Note using ONAP image
+# SDNC A1 Controller image and tags - Note using Honolulu ONAP image
 SDNC_A1_CONTROLLER_IMAGE_BASE="onap/sdnc-image"
-SDNC_A1_CONTROLLER_IMAGE_TAG_REMOTE_RELEASE_ONAP="2.1.2"
+SDNC_A1_CONTROLLER_IMAGE_TAG_REMOTE_RELEASE_ONAP="2.1.6"
 #No local image for ONAP SDNC, remote release image always used
 
 # ORAN SDNC adapter kept as reference
@@ -364,6 +364,7 @@
 SDNC_KARAF_LOG="/opt/opendaylight/data/log/karaf.log"    # Path to karaf log
 #SDNC_RESPONSE_JSON_KEY="A1-ADAPTER-API:output"           # Key name for output json in replies from sdnc (for upgraded sdnc)
 SDNC_RESPONSE_JSON_KEY="output"                          # Key name for output json in replies from sdnc
+SDNC_FEATURE_LEVEL=""                                    # Space separated list of features
 
 RAPP_CAT_APP_NAME="rappcatalogueservice"                 # Name for the RAPP Catalogue
 RAPP_CAT_DISPLAY_NAME="RAPP Catalogue"
diff --git a/test/common/test_env-oran-e-release.sh b/test/common/test_env-oran-e-release.sh
index e468d03..0f6e977 100755
--- a/test/common/test_env-oran-e-release.sh
+++ b/test/common/test_env-oran-e-release.sh
@@ -89,9 +89,9 @@
 NRT_GATEWAY_IMAGE_TAG_REMOTE_RELEASE="1.1.0"
 
 
-# SDNC A1 Controller image and tags - Note using ONAP image
+# SDNC A1 Controller image and tags - Note using released honolulu ONAP image
 SDNC_A1_CONTROLLER_IMAGE_BASE="onap/sdnc-image"
-SDNC_A1_CONTROLLER_IMAGE_TAG_REMOTE_RELEASE_ONAP="2.1.2"
+SDNC_A1_CONTROLLER_IMAGE_TAG_REMOTE_RELEASE_ONAP="2.1.6"
 #No local image for ONAP SDNC, remote release image always used
 
 # ORAN SDNC adapter kept as reference
@@ -247,7 +247,7 @@
 ECS_CONFIG_MOUNT_PATH=/opt/app/enrichment-coordinator-service/config # Internal container path for configuration
 ECS_CONFIG_FILE=application.yaml                         # Config file name
 ECS_VERSION="V1-2"                                       # Version where the types are decoupled from the producer registration
-ECS_FEATURE_LEVEL="INFO-TYPES TYPE-SUBSCRIPTIONS"        # Space separated list of features
+ECS_FEATURE_LEVEL="INFO-TYPES TYPE-SUBSCRIPTIONS INFO-TYPE-INFO"  # Space separated list of features
 
 MR_DMAAP_APP_NAME="dmaap-mr"                             # Name for the Dmaap MR
 MR_STUB_APP_NAME="mr-stub"                               # Name of the MR stub
@@ -364,6 +364,7 @@
 SDNC_KARAF_LOG="/opt/opendaylight/data/log/karaf.log"    # Path to karaf log
 #SDNC_RESPONSE_JSON_KEY="A1-ADAPTER-API:output"           # Key name for output json in replies from sdnc (for upgraded sdnc)
 SDNC_RESPONSE_JSON_KEY="output"                          # Key name for output json in replies from sdnc
+SDNC_FEATURE_LEVEL=""                                    # Space separated list of features
 
 RAPP_CAT_APP_NAME="rappcatalogueservice"                 # Name for the RAPP Catalogue
 RAPP_CAT_DISPLAY_NAME="RAPP Catalogue"
diff --git a/test/common/testcase_common.sh b/test/common/testcase_common.sh
index 5f1b097..b63d4d1 100755
--- a/test/common/testcase_common.sh
+++ b/test/common/testcase_common.sh
@@ -310,6 +310,14 @@
 	__check_stop_at_error
 }
 
+# Function to log a configuration that is not supported
+__log_conf_fail_not_supported() {
+	echo -e $RED" FAIL, function not supported"$ERED$@
+	((RES_CONF_FAIL++))
+	__print_current_stats
+	__check_stop_at_error
+}
+
 # Function to log a passed configuration setup
 __log_conf_ok() {
 	if [ $# -gt 0 ]; then