Upgraded test env with Kubernetes support 21/5421/2
authorBjornMagnussonXA <bjorn.magnusson@est.tech>
Fri, 8 Jan 2021 21:19:18 +0000 (22:19 +0100)
committerBjornMagnussonXA <bjorn.magnusson@est.tech>
Thu, 14 Jan 2021 07:57:37 +0000 (08:57 +0100)
Issue-ID: NONRTRIC-356

Signed-off-by: BjornMagnussonXA <bjorn.magnusson@est.tech>
Change-Id: I942b37c05077b3ba753b3327455d6babed8f6061

88 files changed:
test/auto-test/.gitignore
test/auto-test/FTC1.sh
test/auto-test/FTC10.sh
test/auto-test/FTC100.sh
test/auto-test/FTC110.sh
test/auto-test/FTC1100.sh
test/auto-test/FTC150.sh
test/auto-test/FTC1800.sh
test/auto-test/FTC300.sh
test/auto-test/FTC310.sh
test/auto-test/FTC350.sh
test/auto-test/FTC800.sh
test/auto-test/FTC810.sh
test/auto-test/FTC850.sh
test/auto-test/FTC900.sh
test/auto-test/FTC_HELM-RECEPIE.sh [new file with mode: 0755]
test/auto-test/PM_DEMO.sh
test/auto-test/PM_EI_DEMO.sh
test/common/.gitignore [new file with mode: 0644]
test/common/agent_api_functions.sh
test/common/api_curl.sh
test/common/clean_kube.sh [new file with mode: 0755]
test/common/consul_cbs_functions.sh [new file with mode: 0644]
test/common/control_panel_api_functions.sh [new file with mode: 0644]
test/common/controller_api_functions.sh
test/common/cr_api_functions.sh
test/common/ecs_api_functions.sh
test/common/http_proxy_api_functions.sh [new file with mode: 0644]
test/common/mr_api_functions.sh [new file with mode: 0644]
test/common/prodstub_api_functions.sh
test/common/rapp_catalogue_api_functions.sh
test/common/ricsimulator_api_functions.sh
test/common/test_env-onap-guilin.sh
test/common/test_env-onap-honolulu.sh
test/common/test_env-oran-cherry.sh
test/common/test_env-oran-dawn.sh
test/common/test_env.sh [deleted file]
test/common/testcase_common.sh
test/mrstub/app/main.py
test/mrstub/app/nginx.conf
test/mrstub/app/requirements.txt
test/mrstub/basic_test.sh
test/mrstub/mrstub-build-start.sh
test/simulator-group/control_panel/app.yaml [new file with mode: 0644]
test/simulator-group/control_panel/application.properties [new file with mode: 0644]
test/simulator-group/control_panel/docker-compose.yml
test/simulator-group/control_panel/svc.yaml [new file with mode: 0644]
test/simulator-group/cr/app.yaml [new file with mode: 0644]
test/simulator-group/cr/svc.yaml [new file with mode: 0644]
test/simulator-group/dmaapmr/app.yaml [new file with mode: 0644]
test/simulator-group/dmaapmr/docker-compose.yaml [new file with mode: 0644]
test/simulator-group/dmaapmr/mnt/kafka/zk_client_jaas.conf [new file with mode: 0644]
test/simulator-group/dmaapmr/mnt/mr/KUBE-MsgRtrApi.properties [new file with mode: 0644]
test/simulator-group/dmaapmr/mnt/mr/MsgRtrApi.properties [new file with mode: 0644]
test/simulator-group/dmaapmr/mnt/mr/cadi.properties [new file with mode: 0644]
test/simulator-group/dmaapmr/mnt/mr/logback.xml [new file with mode: 0644]
test/simulator-group/dmaapmr/mnt/zk/zk_server_jaas.conf [new file with mode: 0644]
test/simulator-group/dmaapmr/svc.yaml [new file with mode: 0644]
test/simulator-group/ecs/app.yaml [new file with mode: 0644]
test/simulator-group/ecs/application.yaml [new file with mode: 0644]
test/simulator-group/ecs/pvc.yaml [new file with mode: 0644]
test/simulator-group/ecs/svc.yaml [new file with mode: 0644]
test/simulator-group/httpproxy/.gitignore [new file with mode: 0644]
test/simulator-group/httpproxy/app.yaml [new file with mode: 0644]
test/simulator-group/httpproxy/docker-compose.yaml [moved from test/simulator-group/mr/docker-compose.yml with 79% similarity]
test/simulator-group/httpproxy/svc.yaml [new file with mode: 0644]
test/simulator-group/mrstub/.gitignore [moved from test/simulator-group/mr/.gitignore with 100% similarity]
test/simulator-group/mrstub/app.yaml [new file with mode: 0644]
test/simulator-group/mrstub/cert/cert.crt [moved from test/simulator-group/mr/cert/cert.crt with 100% similarity]
test/simulator-group/mrstub/cert/key.crt [moved from test/simulator-group/mr/cert/key.crt with 100% similarity]
test/simulator-group/mrstub/cert/pass [moved from test/simulator-group/mr/cert/pass with 100% similarity]
test/simulator-group/mrstub/docker-compose.yml [moved from test/simulator-group/consul_cbs/consul/cbs_localhost_config.hcl with 63% similarity]
test/simulator-group/mrstub/svc.yaml [new file with mode: 0644]
test/simulator-group/policy_agent/app.yaml [new file with mode: 0644]
test/simulator-group/policy_agent/application.yaml [new file with mode: 0644]
test/simulator-group/policy_agent/docker-compose.yml
test/simulator-group/policy_agent/mnt/application.yaml [new file with mode: 0644]
test/simulator-group/policy_agent/svc.yaml [new file with mode: 0644]
test/simulator-group/prodstub/app.yaml [new file with mode: 0644]
test/simulator-group/prodstub/svc.yaml [new file with mode: 0644]
test/simulator-group/rapp_catalogue/app.yaml [new file with mode: 0644]
test/simulator-group/rapp_catalogue/docker-compose.yml
test/simulator-group/rapp_catalogue/svc.yaml [new file with mode: 0644]
test/simulator-group/ric/app.yaml [new file with mode: 0644]
test/simulator-group/ric/svc.yaml [new file with mode: 0644]
test/simulator-group/sdnc/app.yaml [new file with mode: 0644]
test/simulator-group/sdnc/docker-compose.yml
test/simulator-group/sdnc/svc.yaml [new file with mode: 0644]

index 6091e4a..6009a54 100644 (file)
@@ -15,3 +15,4 @@ logs
 .pid*
 .result*
 tmp
+NO-CHECKIN
index 9c0254f..8ecd60a 100755 (executable)
 
 TC_ONELINE_DESCR="Sanity test, create service and then create,update and delete a policy using http/https and Agent REST/DMAAP with/without SDNC controller"
 
-#App names to include in the test, space separated list
-INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC"
+#App names to include in the test when running docker, space separated list
+DOCKER_INCLUDED_IMAGES="CBS CONSUL CP CR MR DMAAPMR PA RICSIM SDNC"
 
-#SUPPORTED TEST ENV FILE
+#App names to include in the test when running kubernetes, space separated list
+KUBE_INCLUDED_IMAGES="CP CR MR PA RICSIM SDNC"
+#Prestarted app (not started by script) to include in the test when running kubernetes, space separated list
+KUBE_PRESTARTED_IMAGES=""
+
+#Supported test environment profiles
 SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU  ORAN-CHERRY ORAN-DAWN"
+#Supported run modes
+SUPPORTED_RUNMODES="DOCKER KUBE"
 
 . ../common/testcase_common.sh  $@
 . ../common/agent_api_functions.sh
-. ../common/ricsimulator_api_functions.sh
+. ../common/consul_cbs_functions.sh
+. ../common/control_panel_api_functions.sh
+. ../common/controller_api_functions.sh
 . ../common/cr_api_functions.sh
+. ../common/mr_api_functions.sh
+. ../common/ricsimulator_api_functions.sh
 
-#### TEST BEGIN ####
 
+#### TEST BEGIN ####
 
 generate_uuid
 
@@ -49,8 +60,7 @@ for __httpx in $TESTED_PROTOCOLS ; do
         echo "#####################################################################"
         echo "#####################################################################"
 
-        # Clean container and start all needed containers #
-        clean_containers
+        clean_environment
 
         if [ $__httpx == "HTTPS" ]; then
             use_agent_rest_https
@@ -58,13 +68,13 @@ for __httpx in $TESTED_PROTOCOLS ; do
             use_agent_rest_http
         fi
 
-        start_policy_agent
+        start_policy_agent NORPOXY $SIM_GROUP/$POLICY_AGENT_COMPOSE_DIR/application.yaml
 
         set_agent_trace
 
         # Create service to be able to receive events when rics becomes available
         # Must use rest towards the agent since dmaap is not configured yet
-        api_put_service 201 "ric-registration" 0 "$CR_PATH/ric-registration"
+        api_put_service 201 "ric-registration" 0 "$CR_SERVICE_PATH/ric-registration"
 
         if [ $__httpx == "HTTPS" ]; then
             use_cr_https
@@ -102,9 +112,11 @@ for __httpx in $TESTED_PROTOCOLS ; do
 
         start_cr
 
-        start_control_panel
+        start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/application.properties
 
-        start_consul_cbs
+        if [ $RUNMODE == "DOCKER" ]; then
+            start_consul_cbs
+        fi
 
         if [[ $interface = *"SDNC"* ]]; then
             start_sdnc
@@ -113,7 +125,11 @@ for __httpx in $TESTED_PROTOCOLS ; do
             prepare_consul_config      NOSDNC  ".consul_config.json"
         fi
 
-        consul_config_app                      ".consul_config.json"
+        if [ $RUNMODE == "KUBE" ]; then
+            agent_load_config                       ".consul_config.json"
+        else
+            consul_config_app                      ".consul_config.json"
+        fi
 
         mr_equal requests_submitted 0
 
@@ -123,7 +139,7 @@ for __httpx in $TESTED_PROTOCOLS ; do
 
             sim_put_policy_type 201 ricsim_g3_1 STD_QOS_0_2_0 testdata/STD2/sim_qos.json
 
-            api_equal json:rics 3 60
+            api_equal json:rics 3 300
 
             api_equal json:policy-types 3 120
 
@@ -136,7 +152,7 @@ for __httpx in $TESTED_PROTOCOLS ; do
             cr_api_check_all_sync_events 200 ric-registration ricsim_g1_1 ricsim_g2_1 ricsim_g3_1
 
         else
-            api_equal json:rics 2 60
+            api_equal json:rics 2 300
 
             api_equal json:policy_schemas 2 120
 
@@ -157,7 +173,7 @@ for __httpx in $TESTED_PROTOCOLS ; do
         echo "##### Service registry and supervision #####"
         echo "############################################"
 
-        api_put_service 201 "serv1" 1000 "$CR_PATH/1"
+        api_put_service 201 "serv1" 1000 "$CR_SERVICE_PATH/1"
 
         api_get_service_ids 200 "serv1" "ric-registration"
 
@@ -178,7 +194,7 @@ for __httpx in $TESTED_PROTOCOLS ; do
         echo "############################################"
 
         if [ "$PMS_VERSION" == "V2" ]; then
-            notificationurl=$CR_PATH"/test"
+            notificationurl=$CR_SERVICE_PATH"/test"
         else
             notificationurl=""
         fi
@@ -237,16 +253,16 @@ for __httpx in $TESTED_PROTOCOLS ; do
         fi
 
         if [[ $interface = *"SDNC"* ]]; then
-            sim_contains_str ricsim_g1_1 remote_hosts "a1-controller"
-            sim_contains_str ricsim_g2_1 remote_hosts "a1-controller"
+            sim_contains_str ricsim_g1_1 remote_hosts $SDNC_APP_NAME
+            sim_contains_str ricsim_g2_1 remote_hosts $SDNC_APP_NAME
             if [ "$PMS_VERSION" == "V2" ]; then
-                sim_contains_str ricsim_g3_1 remote_hosts "a1-controller"
+                sim_contains_str ricsim_g3_1 remote_hosts $SDNC_APP_NAME
             fi
         else
-            sim_contains_str ricsim_g1_1 remote_hosts "policy-agent"
-            sim_contains_str ricsim_g2_1 remote_hosts "policy-agent"
+            sim_contains_str ricsim_g1_1 remote_hosts $POLICY_AGENT_APP_NAME
+            sim_contains_str ricsim_g2_1 remote_hosts $POLICY_AGENT_APP_NAME
             if [ "$PMS_VERSION" == "V2" ]; then
-                sim_contains_str ricsim_g3_1 remote_hosts "policy-agent"
+                sim_contains_str ricsim_g3_1 remote_hosts $POLICY_AGENT_APP_NAME
             fi
         fi
 
@@ -268,4 +284,4 @@ done
 
 print_result
 
-auto_clean_containers
+auto_clean_environment
index 77a6c34..01ba86f 100755 (executable)
 
 TC_ONELINE_DESCR="Basic use case, register service, create/update policy, delete policy, de-register service using both STD and OSC interface while mixing REST and Dmaap"
 
-#App names to include in the test, space separated list
-INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM"
+#App names to include in the test when running docker, space separated list
+DOCKER_INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM"
 
-#SUPPORTED TEST ENV FILE
+#App names to include in the test when running kubernetes, space separated list
+KUBE_INCLUDED_IMAGES=" MR CR PA RICSIM CP"
+#Prestarted app (not started by script) to include in the test when running kubernetes, space separated list
+KUBE_PRESTARTED_IMAGES=""
+
+#Supported test environment profiles
 SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU  ORAN-CHERRY ORAN-DAWN"
+#Supported run modes
+SUPPORTED_RUNMODES="DOCKER KUBE"
 
 . ../common/testcase_common.sh $@
 . ../common/agent_api_functions.sh
+. ../common/consul_cbs_functions.sh
+. ../common/control_panel_api_functions.sh
+. ../common/controller_api_functions.sh
+. ../common/cr_api_functions.sh
+. ../common/mr_api_functions.sh
 . ../common/ricsimulator_api_functions.sh
 
 #### TEST BEGIN ####
@@ -38,7 +50,7 @@ use_mr_http
 use_agent_rest_http
 
 
-clean_containers
+clean_environment
 
 start_ric_simulators  ricsim_g1 3 OSC_2.1.0
 
@@ -50,19 +62,28 @@ fi
 
 start_mr
 
-start_consul_cbs
+start_cr
 
-prepare_consul_config      NOSDNC  ".consul_config.json"
-consul_config_app                  ".consul_config.json"
+if [ $RUNMODE == "DOCKER" ]; then
+    start_consul_cbs
+fi
 
-start_control_panel
+start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/application.properties
 
-start_policy_agent
+start_policy_agent NORPOXY $SIM_GROUP/$POLICY_AGENT_COMPOSE_DIR/application.yaml
 
 set_agent_debug
 
 use_agent_rest_http
 
+prepare_consul_config      NOSDNC  ".consul_config.json"
+
+if [ $RUNMODE == "KUBE" ]; then
+    agent_load_config                       ".consul_config.json"
+else
+    consul_config_app                      ".consul_config.json"
+fi
+
 api_get_status 200
 
 sim_print ricsim_g1_1 interface
@@ -77,22 +98,22 @@ sim_put_policy_type 201 ricsim_g1_1 1 testdata/OSC/sim_1.json
 
 if [ "$PMS_VERSION" == "V2" ]; then
     sim_put_policy_type 201 ricsim_g3_1 STD_QOS_0_2_0 testdata/STD2/sim_qos.json
-    api_equal json:policy-types 3 60
+    api_equal json:policy-types 3 300
 else
-    api_equal json:policy_types 2 60
+    api_equal json:policy_types 2 300
 fi
 
 # Create policies
 
 if [ "$PMS_VERSION" == "V2" ]; then
-    notificationurl=$CR_PATH"/test"
+    notificationurl=$CR_SERVICE_PATH"/test"
 else
     notificationurl=""
 fi
 
 use_agent_rest_http
 
-api_put_service 201 "service1" 3600 "$CR_PATH/1"
+api_put_service 201 "service1" 3600 "$CR_SERVICE_PATH/1"
 
 api_put_policy 201 "service1" ricsim_g1_1 1 2000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json 1
 
@@ -137,7 +158,7 @@ fi
 #Update policies
 use_agent_rest_http
 
-api_put_service 200 "service1" 3600 "$CR_PATH/1"
+api_put_service 200 "service1" 3600 "$CR_SERVICE_PATH/1"
 
 api_put_policy 200 "service1" ricsim_g1_1 1 2000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json 1
 
@@ -228,10 +249,10 @@ fi
 
 # Check remote host access to simulator
 
-sim_contains_str ricsim_g1_1 remote_hosts "policy-agent"
-sim_contains_str ricsim_g2_1 remote_hosts "policy-agent"
+sim_contains_str ricsim_g1_1 remote_hosts $POLICY_AGENT_APP_NAME
+sim_contains_str ricsim_g2_1 remote_hosts $POLICY_AGENT_APP_NAME
 if [ "$PMS_VERSION" == "V2" ]; then
-    sim_contains_str ricsim_g3_1 remote_hosts "policy-agent"
+    sim_contains_str ricsim_g3_1 remote_hosts $POLICY_AGENT_APP_NAME
 fi
 
 # Check policy removal
@@ -260,4 +281,4 @@ store_logs          END
 
 print_result
 
-auto_clean_containers
\ No newline at end of file
+auto_clean_environment
\ No newline at end of file
index 34705f4..3b9dcd7 100755 (executable)
 
 TC_ONELINE_DESCR="Full agent API walkthrough using agent REST/DMAAP and with/without SDNC A1 Controller"
 
-#App names to include in the test, space separated list
-INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC"
+#App names to include in the test when running docker, space separated list
+DOCKER_INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC"
 
-#SUPPORTED TEST ENV FILE
+#App names to include in the test when running kubernetes, space separated list
+KUBE_INCLUDED_IMAGES="CP CR MR PA RICSIM SDNC"
+#Prestarted app (not started by script) to include in the test when running kubernetes, space separated list
+KUBE_PRESTARTED_IMAGES=""
+
+#Supported test environment profiles
 SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU  ORAN-CHERRY ORAN-DAWN"
+#Supported run modes
+SUPPORTED_RUNMODES="DOCKER KUBE"
 
 . ../common/testcase_common.sh  $@
 . ../common/agent_api_functions.sh
-. ../common/ricsimulator_api_functions.sh
+. ../common/consul_cbs_functions.sh
+. ../common/control_panel_api_functions.sh
+. ../common/controller_api_functions.sh
 . ../common/cr_api_functions.sh
+. ../common/mr_api_functions.sh
+. ../common/ricsimulator_api_functions.sh
+
 
 #### TEST BEGIN ####
 
@@ -51,7 +63,7 @@ for __httpx in $TESTED_PROTOCOLS ; do
         echo "#####################################################################"
 
         # Clean container and start all needed containers #
-        clean_containers
+        clean_environment
 
         if [ $__httpx == "HTTPS" ]; then
             use_cr_https
@@ -61,13 +73,13 @@ for __httpx in $TESTED_PROTOCOLS ; do
             use_cr_http
         fi
 
-        start_policy_agent
+        start_policy_agent NORPOXY $SIM_GROUP/$POLICY_AGENT_COMPOSE_DIR/application.yaml
 
-        set_agent_trace
+        set_agent_debug
 
         # Create service to be able to receive events when rics becomes available
         # Must use rest towards the agent since dmaap is not configured yet
-        api_put_service 201 "ric-registration" 0 "$CR_PATH/ric-registration"
+        api_put_service 201 "ric-registration" 0 "$CR_SERVICE_PATH/ric-registration"
 
 
         if [ $__httpx == "HTTPS" ]; then
@@ -104,9 +116,11 @@ for __httpx in $TESTED_PROTOCOLS ; do
 
         start_cr
 
-        start_control_panel
+        start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/application.properties
 
-        start_consul_cbs
+        if [ $RUNMODE == "DOCKER" ]; then
+            start_consul_cbs
+        fi
 
         if [[ $interface = *"SDNC"* ]]; then
             start_sdnc
@@ -115,7 +129,11 @@ for __httpx in $TESTED_PROTOCOLS ; do
             prepare_consul_config      NOSDNC  ".consul_config.json"
         fi
 
-        consul_config_app                      ".consul_config.json"
+        if [ $RUNMODE == "KUBE" ]; then
+            agent_load_config                       ".consul_config.json"
+        else
+            consul_config_app                      ".consul_config.json"
+        fi
 
         sim_put_policy_type 201 ricsim_g1_1 1 testdata/OSC/sim_1.json
         sim_put_policy_type 201 ricsim_g1_1 2 testdata/OSC/sim_2.json
@@ -124,7 +142,7 @@ for __httpx in $TESTED_PROTOCOLS ; do
             sim_put_policy_type 201 ricsim_g3_1 STD_QOS_0_2_0 testdata/STD2/sim_qos.json
             sim_put_policy_type 201 ricsim_g3_1 STD_QOS2_0.1.0 testdata/STD2/sim_qos2.json
 
-            api_equal json:rics 3 60
+            api_equal json:rics 3 300
 
             api_equal json:policy-types 5 120
 
@@ -132,7 +150,7 @@ for __httpx in $TESTED_PROTOCOLS ; do
 
             api_equal json:policy-instances 0
         else
-            api_equal json:rics 2 60
+            api_equal json:rics 2 300
 
             api_equal json:policy_schemas 3 120
 
@@ -162,14 +180,14 @@ for __httpx in $TESTED_PROTOCOLS ; do
 
         api_get_services 404 "service1"
 
-        api_put_service 201 "service1" 1000 "$CR_PATH/1"
+        api_put_service 201 "service1" 1000 "$CR_SERVICE_PATH/1"
 
-        api_put_service 200 "service1" 2000 "$CR_PATH/1"
+        api_put_service 200 "service1" 2000 "$CR_SERVICE_PATH/1"
 
 
-        api_put_service 400 "service2" -1 "$CR_PATH/2"
+        api_put_service 400 "service2" -1 "$CR_SERVICE_PATH/2"
 
-        api_put_service 400 "service2" "wrong" "$CR_PATH/2"
+        api_put_service 400 "service2" "wrong" "$CR_SERVICE_PATH/2"
 
         api_put_service 400 "service2" 100 "/test"
 
@@ -177,20 +195,20 @@ for __httpx in $TESTED_PROTOCOLS ; do
 
         api_put_service 201 "service2" 300 "ftp://localhost:80/test"
 
-        api_get_services 200 "service1" "service1" 2000 "$CR_PATH/1"
+        api_get_services 200 "service1" "service1" 2000 "$CR_SERVICE_PATH/1"
 
         api_get_service_ids 200 "service1" "service2" "ric-registration"
 
 
-        api_put_service 201 "service3" 5000 "$CR_PATH/3"
+        api_put_service 201 "service3" 5000 "$CR_SERVICE_PATH/3"
 
 
         api_get_service_ids 200 "service1" "service2" "service3" "ric-registration"
 
 
-        api_get_services 200 "service1" "service1" 2000 "$CR_PATH/1"
+        api_get_services 200 "service1" "service1" 2000 "$CR_SERVICE_PATH/1"
 
-        api_get_services 200 NOSERVICE "service1" 2000 "$CR_PATH/1" "service2" 300 "ftp://localhost:80/test" "service3" 5000 "$CR_PATH/3"  "ric-registration" 0 "$CR_PATH/ric-registration"
+        api_get_services 200 NOSERVICE "service1" 2000 "$CR_SERVICE_PATH/1" "service2" 300 "ftp://localhost:80/test" "service3" 5000 "$CR_SERVICE_PATH/3"  "ric-registration" 0 "$CR_SERVICE_PATH/ric-registration"
 
         api_get_services 200
 
@@ -219,7 +237,7 @@ for __httpx in $TESTED_PROTOCOLS ; do
         api_get_service_ids 200 "service2" "service3" "ric-registration"
 
 
-        api_put_service 201 "service1" 50 "$CR_PATH/1"
+        api_put_service 201 "service1" 50 "$CR_SERVICE_PATH/1"
 
         api_get_service_ids 200 "service1" "service2" "service3"  "ric-registration"
 
@@ -354,10 +372,10 @@ for __httpx in $TESTED_PROTOCOLS ; do
 
 
 
-        api_put_service 201 "service10" 3600 "$CR_PATH/1"
+        api_put_service 201 "service10" 3600 "$CR_SERVICE_PATH/1"
 
         if [ "$PMS_VERSION" == "V2" ]; then
-            notificationurl=$CR_PATH"/test"
+            notificationurl=$CR_SERVICE_PATH"/test"
         else
             notificationurl=""
         fi
@@ -528,16 +546,16 @@ for __httpx in $TESTED_PROTOCOLS ; do
         fi
 
         if [[ $interface = *"SDNC"* ]]; then
-            sim_contains_str ricsim_g1_1 remote_hosts "a1-controller"
-            sim_contains_str ricsim_g2_1 remote_hosts "a1-controller"
+            sim_contains_str ricsim_g1_1 remote_hosts $SDNC_APP_NAME
+            sim_contains_str ricsim_g2_1 remote_hosts $SDNC_APP_NAME
             if [ "$PMS_VERSION" == "V2" ]; then
-                sim_contains_str ricsim_g3_1 remote_hosts "a1-controller"
+                sim_contains_str ricsim_g3_1 remote_hosts $SDNC_APP_NAME
             fi
         else
-            sim_contains_str ricsim_g1_1 remote_hosts "policy-agent"
-            sim_contains_str ricsim_g2_1 remote_hosts "policy-agent"
+            sim_contains_str ricsim_g1_1 remote_hosts $POLICY_AGENT_APP_NAME
+            sim_contains_str ricsim_g2_1 remote_hosts $POLICY_AGENT_APP_NAME
             if [ "$PMS_VERSION" == "V2" ]; then
-                sim_contains_str ricsim_g3_1 remote_hosts "policy-agent"
+                sim_contains_str ricsim_g3_1 remote_hosts $POLICY_AGENT_APP_NAME
             fi
         fi
 
@@ -559,4 +577,4 @@ done
 
 print_result
 
-auto_clean_containers
+auto_clean_environment
index 50e3f37..81aa95c 100755 (executable)
 
 TC_ONELINE_DESCR="Testing of service registration timeouts and keepalive"
 
-#App names to include in the test, space separated list
-INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM"
+#App names to include in the test when running docker, space separated list
+DOCKER_INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM"
 
-#SUPPORTED TEST ENV FILE
+#App names to include in the test when running kubernetes, space separated list
+KUBE_INCLUDED_IMAGES="CP CR MR PA RICSIM"
+#Prestarted app (not started by script) to include in the test when running kubernetes, space separated list
+KUBE_PRESTARTED_IMAGES=""
+
+#Supported test environment profiles
 SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU  ORAN-CHERRY ORAN-DAWN"
+#Supported run modes
+SUPPORTED_RUNMODES="DOCKER KUBE"
 
 . ../common/testcase_common.sh  $@
 . ../common/agent_api_functions.sh
-. ../common/ricsimulator_api_functions.sh
+. ../common/consul_cbs_functions.sh
+. ../common/control_panel_api_functions.sh
 . ../common/cr_api_functions.sh
+. ../common/mr_api_functions.sh
+. ../common/ricsimulator_api_functions.sh
 
 generate_uuid
 
@@ -41,7 +51,7 @@ use_agent_rest_http
 
 #### TEST BEGIN ####
 
-clean_containers
+clean_environment
 
 start_ric_simulators ricsim_g1 1  OSC_2.1.0
 start_ric_simulators ricsim_g2 1  STD_1.1.3
@@ -53,14 +63,21 @@ start_mr
 
 start_cr
 
-start_consul_cbs
+if [ $RUNMODE == "DOCKER" ]; then
+    start_consul_cbs
+fi
 
-prepare_consul_config      NOSDNC  ".consul_config.json"
-consul_config_app                  ".consul_config.json"
+start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/application.properties
 
-start_control_panel
+start_policy_agent NORPOXY $SIM_GROUP/$POLICY_AGENT_COMPOSE_DIR/application.yaml
 
-start_policy_agent
+prepare_consul_config      NOSDNC  ".consul_config.json"
+
+if [ $RUNMODE == "KUBE" ]; then
+    agent_load_config                       ".consul_config.json"
+else
+    consul_config_app                      ".consul_config.json"
+fi
 
 set_agent_debug
 
@@ -76,60 +93,60 @@ if [ "$PMS_VERSION" == "V2" ]; then
     sim_print ricsim_g3_1 interface
 fi
 
-api_put_service 201 "service1" 15 "$CR_PATH/service1"
+api_put_service 201 "service1" 15 "$CR_SERVICE_PATH/service1"
 
-api_get_services 200 "service1" "service1" 15 "$CR_PATH/service1"
+api_get_services 200 "service1" "service1" 15 "$CR_SERVICE_PATH/service1"
 
-api_put_service 201 "service2" 120 "$CR_PATH/service2"
+api_put_service 201 "service2" 120 "$CR_SERVICE_PATH/service2"
 
-api_get_services 200 "service2" "service2" 120 "$CR_PATH/service2"
+api_get_services 200 "service2" "service2" 120 "$CR_SERVICE_PATH/service2"
 
-api_put_service 200 "service1" 50 "$CR_PATH/service1"
-api_put_service 200 "service2" 180 "$CR_PATH/service2"
+api_put_service 200 "service1" 50 "$CR_SERVICE_PATH/service1"
+api_put_service 200 "service2" 180 "$CR_SERVICE_PATH/service2"
 
-api_get_services 200 "service1" "service1" 50 "$CR_PATH/service1"
-api_get_services 200 "service2" "service2" 180 "$CR_PATH/service2"
+api_get_services 200 "service1" "service1" 50 "$CR_SERVICE_PATH/service1"
+api_get_services 200 "service2" "service2" 180 "$CR_SERVICE_PATH/service2"
 
 api_get_service_ids 200 "service1" "service2"
 
 sleep_wait 30 "Waiting for keep alive timeout"
 
-api_get_services 200 "service1" "service1" 50 "$CR_PATH/service1"
-api_get_services 200 "service2" "service2" 180 "$CR_PATH/service2"
+api_get_services 200 "service1" "service1" 50 "$CR_SERVICE_PATH/service1"
+api_get_services 200 "service2" "service2" 180 "$CR_SERVICE_PATH/service2"
 
 sleep_wait 100 "Waiting for keep alive timeout"
 
 api_get_services 404 "service1"
-api_get_services 200 "service2" "service2" 180 "$CR_PATH/service2"
+api_get_services 200 "service2" "service2" 180 "$CR_SERVICE_PATH/service2"
 
 api_delete_services 204 "service2"
 
 api_get_services 404 "service1"
 api_get_services 404 "service2"
 
-api_put_service 201 "service3" 60 "$CR_PATH/service3"
+api_put_service 201 "service3" 60 "$CR_SERVICE_PATH/service3"
 
-api_get_services 200 "service3" "service3" 60 "$CR_PATH/service3"
+api_get_services 200 "service3" "service3" 60 "$CR_SERVICE_PATH/service3"
 
 sleep_wait 30 "Waiting for keep alive timeout"
 
-api_put_service 200 "service3" 60 "$CR_PATH/service3"
+api_put_service 200 "service3" 60 "$CR_SERVICE_PATH/service3"
 
 sleep_wait 100 "Waiting for keep alive timeout"
 
 api_get_services 404 "service3"
 
-api_put_service 201 "service4" 120 "$CR_PATH/service4"
+api_put_service 201 "service4" 120 "$CR_SERVICE_PATH/service4"
 
 sleep_wait 60 "Waiting for keep alive timeout"
 
-api_get_services 200 "service4" "service4" 120 "$CR_PATH/service4"
+api_get_services 200 "service4" "service4" 120 "$CR_SERVICE_PATH/service4"
 
 api_put_services_keepalive 200 "service4"
 
 sleep_wait 90 "Waiting for keep alive timeout"
 
-api_get_services 200 "service4" "service4" 120 "$CR_PATH/service4"
+api_get_services 200 "service4" "service4" 120 "$CR_SERVICE_PATH/service4"
 
 api_delete_services 204 "service4"
 
@@ -152,7 +169,7 @@ api_put_services_keepalive 404 "service3"
 api_put_services_keepalive 404 "service4"
 
 # Policy delete after timeout
-api_put_service 201 "service10" 600 "$CR_PATH/service10"
+api_put_service 201 "service10" 600 "$CR_SERVICE_PATH/service10"
 
 sim_put_policy_type 201 ricsim_g1_1 1 testdata/OSC/sim_1.json
 
@@ -160,7 +177,7 @@ if [ "$PMS_VERSION" == "V2" ]; then
 
     sim_put_policy_type 201 ricsim_g3_1 STD_QOS2_0.1.0 testdata/STD2/sim_qos2.json
 
-    api_equal json:rics 3 60
+    api_equal json:rics 3 300
 
     #api_equal json:policy_schemas 2 120
 
@@ -168,7 +185,7 @@ if [ "$PMS_VERSION" == "V2" ]; then
 
     api_equal json:policies 0
 else
-    api_equal json:rics 2 60
+    api_equal json:rics 2 300
 
     api_equal json:policy_schemas 2 120
 
@@ -178,7 +195,7 @@ else
 fi
 
 if [ "$PMS_VERSION" == "V2" ]; then
-    notificationurl=$CR_PATH"/test"
+    notificationurl=$CR_SERVICE_PATH"/test"
 else
     notificationurl=""
 fi
@@ -232,7 +249,7 @@ if [ "$PMS_VERSION" == "V2" ]; then
     sim_equal ricsim_g3_1 num_instances 1
 fi
 
-api_put_service 200 "service10" 10 "$CR_PATH/service10"
+api_put_service 200 "service10" 10 "$CR_SERVICE_PATH/service10"
 
 #Wait for service expiry
 api_equal json:policies 0 120
@@ -256,4 +273,4 @@ store_logs          END
 
 print_result
 
-auto_clean_containers
\ No newline at end of file
+auto_clean_environment
\ No newline at end of file
index 3ad18f3..fa30fef 100755 (executable)
 
 TC_ONELINE_DESCR="ECS full intefaces walkthrough"
 
-#App names to include in the test, space separated list
-INCLUDED_IMAGES="ECS PRODSTUB CR RICSIM CP"
+#App names to include in the test when running docker, space separated list
+DOCKER_INCLUDED_IMAGES="ECS PRODSTUB CR RICSIM CP"
 
-#SUPPORTED TEST ENV FILE
+#App names to include in the test when running kubernetes, space separated list
+KUBE_INCLUDED_IMAGES=" PRODSTUB CR ECS RICSIM CP "
+#Prestarted app (not started by script) to include in the test when running kubernetes, space separated list
+KUBE_PRESTARTED_IMAGES=" "
+
+#Supported test environment profiles
 SUPPORTED_PROFILES="ONAP-HONOLULU  ORAN-CHERRY ORAN-DAWN"
+#Supported run modes
+SUPPORTED_RUNMODES="DOCKER KUBE"
 
 . ../common/testcase_common.sh  $@
 . ../common/ecs_api_functions.sh
 . ../common/prodstub_api_functions.sh
 . ../common/cr_api_functions.sh
+. ../common/control_panel_api_functions.sh
+. ../common/controller_api_functions.sh
+. ../common/ricsimulator_api_functions.sh
 
 #### TEST BEGIN ####
 
 FLAT_A1_EI="1"
 
-clean_containers
+clean_environment
 
 use_ecs_rest_https
 
@@ -45,13 +55,17 @@ use_simulator_https
 
 use_cr_https
 
-start_ecs
+start_ecs $SIM_GROUP/$ECS_COMPOSE_DIR/application.yaml
+
+if [ $RUNMODE == "KUBE" ]; then
+    ecs_api_admin_reset
+fi
 
 start_prod_stub
 
 set_ecs_trace
 
-start_control_panel
+start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/application.properties
 
 if [ "$PMS_VERSION" == "V2" ]; then
     start_ric_simulators ricsim_g3 4  STD_2.0.0
@@ -59,19 +73,19 @@ fi
 
 start_cr
 
-CB_JOB="$PROD_STUB_HTTPX://$PROD_STUB_APP_NAME:$PROD_STUB_PORT/callbacks/job"
-CB_SV="$PROD_STUB_HTTPX://$PROD_STUB_APP_NAME:$PROD_STUB_PORT/callbacks/supervision"
+CB_JOB="$PROD_STUB_SERVICE_PATH$PROD_STUB_JOB_CALLBACK"
+CB_SV="$PROD_STUB_SERVICE_PATH$PROD_STUB_SUPERVISION_CALLBACK"
 TARGET1="$RIC_SIM_HTTPX://ricsim_g3_1:$RIC_SIM_PORT/datadelivery"
 TARGET2="$RIC_SIM_HTTPX://ricsim_g3_2:$RIC_SIM_PORT/datadelivery"
 TARGET3="$RIC_SIM_HTTPX://ricsim_g3_3:$RIC_SIM_PORT/datadelivery"
 TARGET8="$RIC_SIM_HTTPX://ricsim_g3_4:$RIC_SIM_PORT/datadelivery"
 TARGET10="$RIC_SIM_HTTPX://ricsim_g3_4:$RIC_SIM_PORT/datadelivery"
 
-STATUS1="$CR_HTTPX://$CR_APP_NAME:$CR_PORT/callbacks/job1-status"
-STATUS2="$CR_HTTPX://$CR_APP_NAME:$CR_PORT/callbacks/job2-status"
-STATUS3="$CR_HTTPX://$CR_APP_NAME:$CR_PORT/callbacks/job3-status"
-STATUS8="$CR_HTTPX://$CR_APP_NAME:$CR_PORT/callbacks/job8-status"
-STATUS10="$CR_HTTPX://$CR_APP_NAME:$CR_PORT/callbacks/job10-status"
+STATUS1="$CR_SERVICE_PATH/job1-status"
+STATUS2="$CR_SERVICE_PATH/job2-status"
+STATUS3="$CR_SERVICE_PATH/job3-status"
+STATUS8="$CR_SERVICE_PATH/job8-status"
+STATUS10="$CR_SERVICE_PATH/job10-status"
 
 ### Setup prodstub sim to accept calls for producers, types and jobs
 ## prod-a type1
@@ -771,4 +785,4 @@ store_logs END
 
 print_result
 
-auto_clean_containers
+auto_clean_environment
index ab1e8a6..905d4f8 100755 (executable)
 
 TC_ONELINE_DESCR="Sample tests of the SDNC A1 controller restconf API using http/https (no agent)"
 
-#App names to include in the test, space separated list
-INCLUDED_IMAGES="RICSIM SDNC"
-
-#SUPPORTED TEST ENV FILE
+#App names to include in the test when running docker, space separated list
+DOCKER_INCLUDED_IMAGES="RICSIM SDNC"
+#App names to include in the test when running kubernetes, space separated list
+KUBE_INCLUDED_IMAGES=" RICSIM SDNC "
+#Prestarted app (not started by script) to include in the test when running kubernetes, space separated list
+KUBE_PRESTARTED_IMAGES=" "
+
+#Supported test environment profiles
 SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU  ORAN-CHERRY ORAN-DAWN"
+#Supported run modes
+SUPPORTED_RUNMODES="DOCKER KUBE"
 
 . ../common/testcase_common.sh  $@
 . ../common/controller_api_functions.sh
@@ -32,11 +38,6 @@ SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU  ORAN-CHERRY ORAN-DAWN"
 
 #### TEST BEGIN ####
 
-FLAVOUR="ORAN"
-if [[ $SDNC_A1_CONTROLLER_IMAGE == *"onap"* ]]; then
-    FLAVOUR="ONAP"
-fi
-
 generate_uuid
 
 #Test agent and simulator protocol versions (others are http only)
@@ -54,7 +55,7 @@ for __nb_httpx in $NB_TESTED_PROTOCOLS ; do
 
 
         # Clean container and start all needed containers #
-        clean_containers
+        clean_environment
 
         start_ric_simulators ricsim_g1 1  OSC_2.1.0
         start_ric_simulators ricsim_g2 1  STD_1.1.3
@@ -141,4 +142,4 @@ done
 
 print_result
 
-auto_clean_containers
\ No newline at end of file
+auto_clean_environment
\ No newline at end of file
index f807967..ba8b9f2 100755 (executable)
 
 TC_ONELINE_DESCR="ECS Create 10000 jobs and restart, test job persisency"
 
-#App names to include in the test, space separated list
-INCLUDED_IMAGES="ECS PRODSTUB CR CP"
+#App names to include in the test when running docker, space separated list
+DOCKER_INCLUDED_IMAGES="ECS PRODSTUB CR CP"
 
-#SUPPORTED TEST ENV FILE
+#App names to include in the test when running kubernetes, space separated list
+KUBE_INCLUDED_IMAGES="ECS PRODSTUB CP CR"
+#Prestarted app (not started by script) to include in the test when running kubernetes, space separated list
+KUBE_PRESTARTED_IMAGES=""
+
+#Supported test environment profiles
 SUPPORTED_PROFILES="ONAP-HONOLULU  ORAN-CHERRY ORAN-DAWN"
+#Supported run modes
+SUPPORTED_RUNMODES="DOCKER KUBE"
 
 . ../common/testcase_common.sh  $@
 . ../common/ecs_api_functions.sh
 . ../common/prodstub_api_functions.sh
+. ../common/control_panel_api_functions.sh
+. ../common/controller_api_functions.sh
 
 #### TEST BEGIN ####
 
 FLAT_A1_EI="1"
 
-clean_containers
+clean_environment
 
 use_ecs_rest_http
 
 use_prod_stub_http
 
-start_ecs
+start_ecs $SIM_GROUP/$ECS_COMPOSE_DIR/application.yaml
 
 start_prod_stub
 
 set_ecs_trace
 
-start_control_panel
+start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/application.properties
 
 start_cr
 
-CB_JOB="http://$PROD_STUB_APP_NAME:$PROD_STUB_PORT/callbacks/job"
-CB_SV="http://$PROD_STUB_APP_NAME:$PROD_STUB_PORT/callbacks/supervision"
+CB_JOB="$PROD_STUB_SERVICE_PATH$PROD_STUB_JOB_CALLBACK"
+CB_SV="$PROD_STUB_SERVICE_PATH$PROD_STUB_SUPERVISION_CALLBACK"
 TARGET="http://localhost:80/target"  # Dummy target
 
 NUM_JOBS=10000
@@ -114,7 +123,7 @@ ecs_api_edp_get_producer_status 200 prod-d ENABLED
 for ((i=1; i<=$NUM_JOBS; i++))
 do
     if [ $(($i%5)) -eq 0 ]; then
-        ecs_api_a1_put_job 201 job$i type1 $TARGET ric1 $CR_PATH/job_status_ric1 testdata/ecs/job-template.json
+        ecs_api_a1_put_job 201 job$i type1 $TARGET ric1 $CR_SERVICE_PATH/job_status_ric1 testdata/ecs/job-template.json
         if [  -z "$FLAT_A1_EI" ]; then
             ecs_api_a1_get_job_status 200 type1 job$i ENABLED
         else
@@ -122,7 +131,7 @@ do
         fi
     fi
     if [ $(($i%5)) -eq 1 ]; then
-        ecs_api_a1_put_job 201 job$i type2 $TARGET ric1 $CR_PATH/job_status_ric1 testdata/ecs/job-template.json
+        ecs_api_a1_put_job 201 job$i type2 $TARGET ric1 $CR_SERVICE_PATH/job_status_ric1 testdata/ecs/job-template.json
         if [  -z "$FLAT_A1_EI" ]; then
             ecs_api_a1_get_job_status 200 type2 job$i ENABLED
         else
@@ -130,7 +139,7 @@ do
         fi
     fi
     if [ $(($i%5)) -eq 2 ]; then
-        ecs_api_a1_put_job 201 job$i type3 $TARGET ric1 $CR_PATH/job_status_ric1 testdata/ecs/job-template.json
+        ecs_api_a1_put_job 201 job$i type3 $TARGET ric1 $CR_SERVICE_PATH/job_status_ric1 testdata/ecs/job-template.json
         if [  -z "$FLAT_A1_EI" ]; then
             ecs_api_a1_get_job_status 200 type3 job$i ENABLED
         else
@@ -138,7 +147,7 @@ do
         fi
     fi
     if [ $(($i%5)) -eq 3 ]; then
-        ecs_api_a1_put_job 201 job$i type4 $TARGET ric1 $CR_PATH/job_status_ric1 testdata/ecs/job-template.json
+        ecs_api_a1_put_job 201 job$i type4 $TARGET ric1 $CR_SERVICE_PATH/job_status_ric1 testdata/ecs/job-template.json
         if [  -z "$FLAT_A1_EI" ]; then
             ecs_api_a1_get_job_status 200 type4 job$i ENABLED
         else
@@ -146,7 +155,7 @@ do
         fi
     fi
     if [ $(($i%5)) -eq 4 ]; then
-        ecs_api_a1_put_job 201 job$i type5 $TARGET ric1 $CR_PATH/job_status_ric1 testdata/ecs/job-template.json
+        ecs_api_a1_put_job 201 job$i type5 $TARGET ric1 $CR_SERVICE_PATH/job_status_ric1 testdata/ecs/job-template.json
         if [  -z "$FLAT_A1_EI" ]; then
             ecs_api_a1_get_job_status 200 type5 job$i ENABLED
         else
@@ -381,4 +390,4 @@ store_logs END
 
 print_result
 
-auto_clean_containers
+auto_clean_environment
index 713d330..723368e 100755 (executable)
 
 TC_ONELINE_DESCR="Resync 10000 policies using OSC and STD interface"
 
-#App names to include in the test, space separated list
-INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC"
+#App names to include in the test when running docker, space separated list
+DOCKER_INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC"
 
-#SUPPORTED TEST ENV FILE
+#App names to include in the test when running kubernetes, space separated list
+KUBE_INCLUDED_IMAGES="CP CR MR PA RICSIM SDNC"
+#Prestarted app (not started by script) to include in the test when running kubernetes, space separated list
+KUBE_PRESTARTED_IMAGES=""
+
+#Supported test environment profiles
 SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU  ORAN-CHERRY ORAN-DAWN"
+#Supported run modes
+SUPPORTED_RUNMODES="DOCKER KUBE"
 
 . ../common/testcase_common.sh  $@
 . ../common/agent_api_functions.sh
+. ../common/consul_cbs_functions.sh
+. ../common/control_panel_api_functions.sh
+. ../common/controller_api_functions.sh
+. ../common/cr_api_functions.sh
+. ../common/mr_api_functions.sh
 . ../common/ricsimulator_api_functions.sh
 
 #### TEST BEGIN ####
@@ -37,6 +49,7 @@ generate_uuid
 TESTED_VARIANTS="REST   DMAAP   REST+SDNC   DMAAP+SDNC DMAAP_BATCH DMAAP_BATCH+SDNC"
 #Test agent and simulator protocol versions (others are http only)
 TESTED_PROTOCOLS="HTTP HTTPS"
+
 for __httpx in $TESTED_PROTOCOLS ; do
     for interface in $TESTED_VARIANTS ; do
 
@@ -73,7 +86,7 @@ for __httpx in $TESTED_PROTOCOLS ; do
         fi
 
         # Clean container and start all needed containers #
-        clean_containers
+        clean_environment
 
         start_ric_simulators ricsim_g1 4 OSC_2.1.0
 
@@ -87,7 +100,15 @@ for __httpx in $TESTED_PROTOCOLS ; do
 
         start_cr
 
-        start_consul_cbs
+        if [ $RUNMODE == "DOCKER" ]; then
+            start_consul_cbs
+        fi
+
+        start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/application.properties
+
+        start_policy_agent NORPOXY $SIM_GROUP/$POLICY_AGENT_COMPOSE_DIR/application.yaml
+
+        set_agent_debug
 
         if [[ $interface = *"SDNC"* ]]; then
             start_sdnc
@@ -96,13 +117,11 @@ for __httpx in $TESTED_PROTOCOLS ; do
             prepare_consul_config      NOSDNC  ".consul_config.json"
         fi
 
-        consul_config_app                  ".consul_config.json"
-
-        start_control_panel
-
-        start_policy_agent
-
-        set_agent_debug
+        if [ $RUNMODE == "KUBE" ]; then
+            agent_load_config                       ".consul_config.json"
+        else
+            consul_config_app                      ".consul_config.json"
+        fi
 
         api_get_status 200
 
@@ -122,13 +141,13 @@ for __httpx in $TESTED_PROTOCOLS ; do
             api_equal json:policy_types 2 120  #Wait for the agent to refresh types from the simulator
         fi
 
-        api_put_service 201 "serv1" 3600 "$CR_PATH/1"
+        api_put_service 201 "serv1" 3600 "$CR_SERVICE_PATH/1"
 
         START_ID=2000
         NUM_POLICIES=10000  # Must be at least 100
 
         if [ "$PMS_VERSION" == "V2" ]; then
-            notificationurl=$CR_PATH"/test"
+            notificationurl=$CR_SERVICE_PATH"/test"
         else
             notificationurl=""
         fi
@@ -201,4 +220,4 @@ done
 
 print_result
 
-auto_clean_containers
\ No newline at end of file
+auto_clean_environment
\ No newline at end of file
index 674df8c..dd79b33 100755 (executable)
 
 TC_ONELINE_DESCR="Resync of RIC via changes in the consul config or pushed config"
 
-#App names to include in the test, space separated list
-INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM"
+#App names to include in the test when running docker, space separated list
+DOCKER_INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM"
 
-#SUPPORTED TEST ENV FILE
+#Supported test environment profiles
 SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU  ORAN-CHERRY ORAN-DAWN"
+#Supported run modes
+SUPPORTED_RUNMODES="DOCKER"
 
 . ../common/testcase_common.sh  $@
 . ../common/agent_api_functions.sh
 . ../common/ricsimulator_api_functions.sh
 . ../common/cr_api_functions.sh
+. ../common/mr_api_functions.sh
+. ../common/control_panel_api_functions.sh
+. ../common/controller_api_functions.sh
 
 #### TEST BEGIN ####
 
@@ -43,7 +48,7 @@ for consul_conf in $TESTED_VARIANTS ; do
     generate_uuid
 
     # Clean container and start all needed containers #
-    clean_containers
+    clean_environment
 
     start_policy_agent
 
@@ -51,7 +56,7 @@ for consul_conf in $TESTED_VARIANTS ; do
 
     # Create service to be able to receive events when rics becomes available
     # Must use rest towards the agent since dmaap is not configured yet
-    api_put_service 201 "ric-registration" 0 "$CR_PATH/ric-registration"
+    api_put_service 201 "ric-registration" 0 "$CR_SERVICE_PATH/ric-registration"
 
     # Start one RIC of each type
     start_ric_simulators ricsim_g1 1  OSC_2.1.0
@@ -80,13 +85,13 @@ for consul_conf in $TESTED_VARIANTS ; do
     fi
 
     if [ "$PMS_VERSION" == "V2" ]; then
-        api_equal json:rics 3 120
+        api_equal json:rics 3 300
 
         cr_equal received_callbacks 3 120
 
         cr_api_check_all_sync_events 200 ric-registration ricsim_g1_1 ricsim_g2_1 ricsim_g3_1
     else
-        api_equal json:rics 2 120
+        api_equal json:rics 2 300
     fi
 
     # Add an STD RIC and check
@@ -148,4 +153,4 @@ done
 
 print_result
 
-auto_clean_containers
+auto_clean_environment
index 4df0a15..d30b314 100755 (executable)
 
 TC_ONELINE_DESCR="Change supported policy types and reconfigure rics"
 
-#App names to include in the test, space separated list
-INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC"
+#App names to include in the test when running docker, space separated list
+DOCKER_INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC"
 
-#SUPPORTED TEST ENV FILE
+#App names to include in the test when running kubernetes, space separated list
+KUBE_INCLUDED_IMAGES="CP CR MR PA RICSIM SDNC"
+#Prestarted app (not started by script) to include in the test when running kubernetes, space separated list
+KUBE_PRESTARTED_IMAGES=""
+
+#Supported test environment profiles
 SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU  ORAN-CHERRY ORAN-DAWN"
+#Supported run modes
+SUPPORTED_RUNMODES="DOCKER KUBE"
 
 . ../common/testcase_common.sh  $@
 . ../common/agent_api_functions.sh
+. ../common/consul_cbs_functions.sh
 . ../common/ricsimulator_api_functions.sh
 . ../common/cr_api_functions.sh
+. ../common/mr_api_functions.sh
+. ../common/control_panel_api_functions.sh
+. ../common/controller_api_functions.sh
 
 #### TEST BEGIN ####
 
@@ -52,7 +63,7 @@ for interface in $TESTED_VARIANTS ; do
 
 
     # Clean container and start all needed containers #
-    clean_containers
+    clean_environment
 
     #Start simulators and prepare two configs
 
@@ -62,7 +73,9 @@ for interface in $TESTED_VARIANTS ; do
 
     start_mr
 
-    start_consul_cbs
+    if [ $RUNMODE == "DOCKER" ]; then
+        start_consul_cbs
+    fi
 
     # Create first config
     if [[ $interface = *"SDNC"* ]]; then
@@ -81,7 +94,7 @@ for interface in $TESTED_VARIANTS ; do
         prepare_consul_config      NOSDNC  ".consul_config_all.json"
     fi
 
-    start_policy_agent
+    start_policy_agent NORPOXY $SIM_GROUP/$POLICY_AGENT_COMPOSE_DIR/application.yaml
 
     set_agent_trace
 
@@ -89,10 +102,14 @@ for interface in $TESTED_VARIANTS ; do
 
     # Create service to be able to receive events when rics becomes available
     # Must use rest towards the agent since dmaap is not configured yet
-    api_put_service 201 "ric-registration" 0 "$CR_PATH/ric-registration"
+    api_put_service 201 "ric-registration" 0 "$CR_SERVICE_PATH/ric-registration"
 
     #Load first config
-    consul_config_app                  ".consul_config_initial.json"
+    if [ $RUNMODE == "KUBE" ]; then
+        agent_load_config                      ".consul_config_initial.json"
+    else
+        consul_config_app                      ".consul_config_initial.json"
+    fi
 
     for ((i=1; i<=${NUM_RICS}; i++))
     do
@@ -100,7 +117,7 @@ for interface in $TESTED_VARIANTS ; do
     done
 
     # All sims running but 2 are not configured in consul
-    api_equal json:rics 8 120
+    api_equal json:rics 8 300
 
     if [ "$PMS_VERSION" == "V2" ]; then
         cr_equal received_callbacks?id=ric-registration 8 120
@@ -187,7 +204,11 @@ for interface in $TESTED_VARIANTS ; do
     fi
 
     #Load config with all rics
-    consul_config_app                  ".consul_config_all.json"
+    if [ $RUNMODE == "KUBE" ]; then
+        agent_load_config                       ".consul_config_all.json"
+    else
+        consul_config_app                       ".consul_config_all.json"
+    fi
 
     api_equal json:rics 10 120
 
@@ -250,10 +271,10 @@ for interface in $TESTED_VARIANTS ; do
         api_equal json:policy_types 5
     fi
 
-    api_put_service 201 "serv1" 3600 "$CR_PATH/serv1"
+    api_put_service 201 "serv1" 3600 "$CR_SERVICE_PATH/serv1"
 
     if [ "$PMS_VERSION" == "V2" ]; then
-        notificationurl=$CR_PATH"/test"
+        notificationurl=$CR_SERVICE_PATH"/test"
     else
         notificationurl=""
     fi
@@ -261,7 +282,11 @@ for interface in $TESTED_VARIANTS ; do
     sleep_wait 120
 
     # Load config with reduced number of rics
-    consul_config_app                  ".consul_config_initial.json"
+    if [ $RUNMODE == "KUBE" ]; then
+        agent_load_config                      ".consul_config_initial.json"
+    else
+        consul_config_app                      ".consul_config_initial.json"
+    fi
 
     api_equal json:rics 8 120
 
@@ -312,7 +337,11 @@ for interface in $TESTED_VARIANTS ; do
     api_get_policy_types 404 ricsim_g1_9
 
     # Load config with all rics
-    consul_config_app                  ".consul_config_all.json"
+    if [ $RUNMODE == "KUBE" ]; then
+        agent_load_config                      ".consul_config_all.json"
+    else
+        consul_config_app                      ".consul_config_all.json"
+    fi
 
     api_equal json:rics 10 120
 
@@ -442,4 +471,4 @@ done
 
 print_result
 
-auto_clean_containers
\ No newline at end of file
+auto_clean_environment
\ No newline at end of file
index ceda58c..0be6be8 100755 (executable)
 
 TC_ONELINE_DESCR="Create 10000 policies in sequence using http/https and Agent REST/DMAAP with/without SDNC controller"
 
-#App names to include in the test, space separated list
-INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC"
+#App names to include in the test when running docker, space separated list
+DOCKER_INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC"
 
-#SUPPORTED TEST ENV FILE
+#App names to include in the test when running kubernetes, space separated list
+KUBE_INCLUDED_IMAGES="CP CR MR PA RICSIM SDNC"
+#Prestarted app (not started by script) to include in the test when running kubernetes, space separated list
+KUBE_PRESTARTED_IMAGES=""
+
+#Supported test environment profiles
 SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU  ORAN-CHERRY ORAN-DAWN"
+#Supported run modes
+SUPPORTED_RUNMODES="DOCKER KUBE"
 
 . ../common/testcase_common.sh  $@
 . ../common/agent_api_functions.sh
 . ../common/ricsimulator_api_functions.sh
 . ../common/cr_api_functions.sh
+. ../common/mr_api_functions.sh
+. ../common/control_panel_api_functions.sh
+. ../common/controller_api_functions.sh
 
 #### TEST BEGIN ####
 
@@ -69,7 +79,7 @@ for __httpx in $TESTED_PROTOCOLS ; do
         # Policy instance start id
         START_ID=1
 
-        clean_containers
+        clean_environment
 
         start_ric_simulators ricsim_g1 1 OSC_2.1.0
         start_ric_simulators ricsim_g2 1 STD_1.1.3
@@ -81,6 +91,14 @@ for __httpx in $TESTED_PROTOCOLS ; do
 
         start_cr
 
+        start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/application.properties
+
+        start_policy_agent NORPOXY $SIM_GROUP/$POLICY_AGENT_COMPOSE_DIR/application.yaml
+
+        set_agent_debug
+
+        mr_equal requests_submitted 0
+
         if [[ $interface == "SDNC" ]]; then
             start_sdnc
             prepare_consul_config      SDNC    ".consul_config.json"
@@ -88,17 +106,15 @@ for __httpx in $TESTED_PROTOCOLS ; do
             prepare_consul_config      NOSDNC  ".consul_config.json"
         fi
 
-        start_consul_cbs
-
-        consul_config_app                      ".consul_config.json"
-
-        start_control_panel
-
-        start_policy_agent
-
-        set_agent_debug
+        if [ $RUNMODE == "DOCKER" ]; then
+            start_consul_cbs
+        fi
 
-        mr_equal requests_submitted 0
+        if [ $RUNMODE == "KUBE" ]; then
+            agent_load_config                       ".consul_config.json"
+        else
+            consul_config_app                      ".consul_config.json"
+        fi
 
 
         api_get_status 200
@@ -114,15 +130,15 @@ for __httpx in $TESTED_PROTOCOLS ; do
         if [ "$PMS_VERSION" == "V2" ]; then
             sim_put_policy_type 201 ricsim_g3_1 STD_QOS2_0.1.0 testdata/STD2/sim_qos2.json
 
-            api_equal json:policy-types 3 120  #Wait for the agent to refresh types from the simulators
+            api_equal json:policy-types 3 300  #Wait for the agent to refresh types from the simulators
         else
-            api_equal json:policy_types 2 120  #Wait for the agent to refresh types from the simulators
+            api_equal json:policy_types 2 300  #Wait for the agent to refresh types from the simulators
         fi
 
-        api_put_service 201 "serv1" 3600 "$CR_PATH/1"
+        api_put_service 201 "serv1" 3600 "$CR_SERVICE_PATH/1"
 
         if [ "$PMS_VERSION" == "V2" ]; then
-            notificationurl=$CR_PATH"/test"
+            notificationurl=$CR_SERVICE_PATH"/test"
         else
             notificationurl=""
         fi
@@ -215,16 +231,16 @@ for __httpx in $TESTED_PROTOCOLS ; do
         fi
 
         if [ $interface == "SDNC" ]; then
-            sim_contains_str ricsim_g1_1 remote_hosts "a1-controller"
-            sim_contains_str ricsim_g2_1 remote_hosts "a1-controller"
+            sim_contains_str ricsim_g1_1 remote_hosts $SDNC_APP_NAME
+            sim_contains_str ricsim_g2_1 remote_hosts $SDNC_APP_NAME
             if [ "$PMS_VERSION" == "V2" ]; then
-                sim_contains_str ricsim_g3_1 remote_hosts "a1-controller"
+                sim_contains_str ricsim_g3_1 remote_hosts $SDNC_APP_NAME
             fi
         else
-            sim_contains_str ricsim_g1_1 remote_hosts "policy-agent"
-            sim_contains_str ricsim_g2_1 remote_hosts "policy-agent"
+            sim_contains_str ricsim_g1_1 remote_hosts $POLICY_AGENT_APP_NAME
+            sim_contains_str ricsim_g2_1 remote_hosts $POLICY_AGENT_APP_NAME
             if [ "$PMS_VERSION" == "V2" ]; then
-                sim_contains_str ricsim_g3_1 remote_hosts "policy-agent"
+                sim_contains_str ricsim_g3_1 remote_hosts $POLICY_AGENT_APP_NAME
             fi
         fi
 
@@ -241,4 +257,4 @@ done
 
 print_result
 
-auto_clean_containers
\ No newline at end of file
+auto_clean_environment
\ No newline at end of file
index c5d284a..a92106e 100755 (executable)
 
 TC_ONELINE_DESCR="Repeatedly create and delete policies in each RICs for 24h (or configured number of days). Via agent REST/DMAAP/DMAAP_BATCH and SDNC using http or https"
 
-#App names to include in the test, space separated list
-INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC"
+#App names to include in the test when running docker, space separated list
+DOCKER_INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC"
 
-#SUPPORTED TEST ENV FILE
+#App names to include in the test when running kubernetes, space separated list
+KUBE_INCLUDED_IMAGES="CP CR MR PA RICSIM SDNC"
+#Prestarted app (not started by script) to include in the test when running kubernetes, space separated list
+KUBE_PRESTARTED_IMAGES=""
+
+#Supported test environment profiles
 SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU  ORAN-CHERRY ORAN-DAWN"
+#Supported run modes
+SUPPORTED_RUNMODES="DOCKER KUBE"
 
 . ../common/testcase_common.sh  $@
 . ../common/agent_api_functions.sh
 . ../common/ricsimulator_api_functions.sh
 . ../common/cr_api_functions.sh
+. ../common/mr_api_functions.sh
+. ../common/control_panel_api_functions.sh
+. ../common/controller_api_functions.sh
 
 #### TEST BEGIN ####
 
@@ -48,7 +58,7 @@ NUM_INSTANCES=5
 
 DAYS=3
 
-clean_containers
+clean_environment
 
 # use HTTP or HTTPS for all apis
 HTTPX=HTTPS
@@ -77,16 +87,23 @@ start_mr
 
 start_cr
 
-start_consul_cbs
+start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/application.properties
 
-prepare_consul_config      SDNC  ".consul_config.json"
-consul_config_app                  ".consul_config.json"
+start_policy_agent NORPOXY $SIM_GROUP/$POLICY_AGENT_COMPOSE_DIR/application.yaml
 
-start_sdnc
+if [ $RUNMODE == "DOCKER" ]; then
+   start_consul_cbs
+fi
 
-start_control_panel
+prepare_consul_config      SDNC  ".consul_config.json"
 
-start_policy_agent
+if [ $RUNMODE == "KUBE" ]; then
+   agent_load_config                       ".consul_config.json"
+else
+   consul_config_app                      ".consul_config.json"
+fi
+
+start_sdnc
 
 
 api_get_status 200
@@ -147,9 +164,9 @@ fi
 
 echo "Wait for the agent to refresh types from the simulator"
 if [ "$PMS_VERSION" == "V2" ]; then
-   api_equal json:policy-types 3 120
+   api_equal json:policy-types 3 300
 else
-   api_equal json:policy_types 2 120
+   api_equal json:policy_types 2 300
 fi
 
 echo "Check the number of types in the agent for each ric is 1"
@@ -164,7 +181,7 @@ do
 done
 
 echo "Register a service"
-api_put_service 201 "serv1" 0 "$CR_PATH/1"
+api_put_service 201 "serv1" 0 "$CR_SERVICE_PATH/1"
 
 TEST_DURATION=$((24*3600*$DAYS))
 TEST_START=$SECONDS
@@ -174,7 +191,7 @@ AGENT_INTERFACES="REST REST_PARALLEL DMAAP DMAAP-BATCH"
 MR_MESSAGES=0
 
 if [ "$PMS_VERSION" == "V2" ]; then
-      notificationurl=$CR_PATH"/test"
+      notificationurl=$CR_SERVICE_PATH"/test"
 else
       notificationurl=""
 fi
@@ -380,11 +397,11 @@ while [ $(($SECONDS-$TEST_START)) -lt $TEST_DURATION ]; do
 
       for ((i=1; i<=$NUM_RICS; i++))
       do
-         sim_contains_str ricsim_g1_$i remote_hosts "a1-controller"
-         sim_contains_str ricsim_g2_$i remote_hosts "a1-controller"
+         sim_contains_str ricsim_g1_$i remote_hosts $SDNC_APP_NAME
+         sim_contains_str ricsim_g2_$i remote_hosts $SDNC_APP_NAME
 
          if [ "$PMS_VERSION" == "V2" ]; then
-            sim_contains_str ricsim_g3_$i remote_hosts "a1-controller"
+            sim_contains_str ricsim_g3_$i remote_hosts $SDNC_APP_NAME
          fi
       done
 
@@ -401,4 +418,4 @@ store_logs          END
 
 print_result
 
-auto_clean_containers
\ No newline at end of file
+auto_clean_environment
\ No newline at end of file
index 324044e..82e50f1 100755 (executable)
 
 TC_ONELINE_DESCR="Create/delete policies in parallel over a number of rics using a number of child process"
 
-#App names to include in the test, space separated list
-INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC"
+#App names to include in the test when running docker, space separated list
+DOCKER_INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC"
 
-#SUPPORTED TEST ENV FILE
+#App names to include in the test when running kubernetes, space separated list
+KUBE_INCLUDED_IMAGES="CP CR MR PA RICSIM SDNC"
+#Prestarted app (not started by script) to include in the test when running kubernetes, space separated list
+KUBE_PRESTARTED_IMAGES=""
+
+#Supported test environment profiles
 SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU  ORAN-CHERRY ORAN-DAWN"
+#Supported run modes
+SUPPORTED_RUNMODES="DOCKER KUBE"
 
 . ../common/testcase_common.sh  $@
 . ../common/agent_api_functions.sh
 . ../common/ricsimulator_api_functions.sh
+. ../common/mr_api_functions.sh
+. ../common/control_panel_api_functions.sh
+. ../common/controller_api_functions.sh
 
 #### TEST BEGIN ####
 
@@ -46,7 +56,7 @@ NUM_POLICIES_PER_RIC=500
 generate_uuid
 
 if [ "$PMS_VERSION" == "V2" ]; then
-    notificationurl=$CR_PATH"/test"
+    notificationurl=$CR_SERVICE_PATH"/test"
 else
     notificationurl=""
 fi
@@ -79,11 +89,19 @@ for __httpx in $TESTED_PROTOCOLS ; do
         fi
 
         # Clean container and start all needed containers #
-        clean_containers
+        clean_environment
 
         start_ric_simulators ricsim_g1 $NUM_RICS OSC_2.1.0
 
-        start_consul_cbs
+        start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/application.properties
+
+        start_policy_agent NORPOXY $SIM_GROUP/$POLICY_AGENT_COMPOSE_DIR/application.yaml
+
+        set_agent_debug
+
+        if [ $RUNMODE == "DOCKER" ]; then
+            start_consul_cbs
+        fi
 
         if [[ $interface = *"SDNC"* ]]; then
             start_sdnc
@@ -92,18 +110,16 @@ for __httpx in $TESTED_PROTOCOLS ; do
             prepare_consul_config      NOSDNC  ".consul_config.json"
         fi
 
-        consul_config_app                  ".consul_config.json"
+        if [ $RUNMODE == "KUBE" ]; then
+            agent_load_config                       ".consul_config.json"
+        else
+            consul_config_app                      ".consul_config.json"
+        fi
 
         start_mr # Not used, but removes error messages from the agent log
 
         start_cr
 
-        start_control_panel
-
-        start_policy_agent
-
-        set_agent_debug
-
         api_get_status 200
 
         for ((i=1; i<=$NUM_RICS; i++))
@@ -118,12 +134,12 @@ for __httpx in $TESTED_PROTOCOLS ; do
         done
 
         if [ "$PMS_VERSION" == "V2" ]; then
-            api_equal json:policy-types 1 120  #Wait for the agent to refresh types from the simulator
+            api_equal json:policy-types 1 300  #Wait for the agent to refresh types from the simulator
         else
-            api_equal json:policy_types 1 120  #Wait for the agent to refresh types from the simulator
+            api_equal json:policy_types 1 300  #Wait for the agent to refresh types from the simulator
         fi
 
-        api_put_service 201 "serv1" 600 "$CR_PATH/1"
+        api_put_service 201 "serv1" 600 "$CR_SERVICE_PATH/1"
 
         echo "Check the number of types in the agent for each ric is 1"
         for ((i=1; i<=$NUM_RICS; i++))
@@ -167,9 +183,9 @@ for __httpx in $TESTED_PROTOCOLS ; do
         for ((i=1; i<=$NUM_RICS; i++))
         do
             if [ $interface == "REST+SDNC" ]; then
-                sim_contains_str ricsim_g1_$i remote_hosts "a1-controller"
+                sim_contains_str ricsim_g1_$i remote_hosts $SDNC_APP_NAME
             else
-                sim_contains_str ricsim_g1_$i remote_hosts "policy-agent"
+                sim_contains_str ricsim_g1_$i remote_hosts $POLICY_AGENT_APP_NAME
             fi
         done
 
@@ -189,4 +205,4 @@ done
 
 print_result
 
-auto_clean_containers
\ No newline at end of file
+auto_clean_environment
\ No newline at end of file
index 8a937ff..b3e4d29 100755 (executable)
 
 TC_ONELINE_DESCR="Preparation for test of the Control Panel and the Health Check app - populating a number of ric simulators with types and instances"
 
-#App names to include in the test, space separated list
-INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM"
+#App names to include in the test when running docker, space separated list
+DOCKER_INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM"
 
-#SUPPORTED TEST ENV FILE
+#App names to include in the test when running kubernetes, space separated list
+KUBE_INCLUDED_IMAGES="CP CR MR PA RICSIM"
+#Prestarted app (not started by script) to include in the test when running kubernetes, space separated list
+KUBE_PRESTARTED_IMAGES=""
+
+#Supported test environment profiles
 SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU  ORAN-CHERRY ORAN-DAWN"
+#Supported run modes
+SUPPORTED_RUNMODES="DOCKER KUBE"
 
 . ../common/testcase_common.sh $@
 . ../common/agent_api_functions.sh
 . ../common/ricsimulator_api_functions.sh
+. ../common/mr_api_functions.sh
+. ../common/control_panel_api_functions.sh
+. ../common/controller_api_functions.sh
 
 #### TEST BEGIN ####
 
-clean_containers
+clean_environment
 
 OSC_NUM_RICS=6
 STD_NUM_RICS=5
@@ -46,16 +56,23 @@ fi
 
 start_mr #Just to prevent errors in the agent log...
 
-start_control_panel
+start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/application.properties
 
-start_consul_cbs
+start_policy_agent NORPOXY $SIM_GROUP/$POLICY_AGENT_COMPOSE_DIR/application.yaml
 
-prepare_consul_config      NOSDNC  ".consul_config.json"
-consul_config_app                  ".consul_config.json"
+use_agent_rest_http
 
-start_policy_agent
+if [ $RUNMODE == "DOCKER" ]; then
+    start_consul_cbs
+fi
 
-use_agent_rest_http
+prepare_consul_config      NOSDNC  ".consul_config.json"
+
+if [ $RUNMODE == "KUBE" ]; then
+    agent_load_config                       ".consul_config.json"
+else
+    consul_config_app                      ".consul_config.json"
+fi
 
 api_get_status 200
 
@@ -91,7 +108,7 @@ done
 
 #Check the number of schemas and the individual schemas in OSC
 if [ "$PMS_VERSION" == "V2" ]; then
-    api_equal json:policy-types 4 120
+    api_equal json:policy-types 4 300
 
     for ((i=1; i<=$OSC_NUM_RICS; i++))
     do
@@ -106,7 +123,7 @@ if [ "$PMS_VERSION" == "V2" ]; then
         api_get_policy_type 200 20008 testdata/OSC/tsa-agent-modified.json
     done
 else
-    api_equal json:policy_types 4 120
+    api_equal json:policy_types 4 300
 
     for ((i=1; i<=$OSC_NUM_RICS; i++))
     do
@@ -150,10 +167,10 @@ fi
 # Create policies
 use_agent_rest_http
 
-api_put_service 201 "Emergency-response-app" 0 "$CR_PATH/1"
+api_put_service 201 "Emergency-response-app" 0 "$CR_SERVICE_PATH/1"
 
 if [ "$PMS_VERSION" == "V2" ]; then
-    notificationurl=$CR_PATH"/test"
+    notificationurl=$CR_SERVICE_PATH"/test"
 else
     notificationurl=""
 fi
diff --git a/test/auto-test/FTC_HELM-RECEPIE.sh b/test/auto-test/FTC_HELM-RECEPIE.sh
new file mode 100755 (executable)
index 0000000..a9f5e5e
--- /dev/null
@@ -0,0 +1,302 @@
+#!/usr/bin/env bash
+
+#  ============LICENSE_START===============================================
+#  Copyright (C) 2020 Nordix Foundation. All rights reserved.
+#  ========================================================================
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+#  ============LICENSE_END=================================================
+#
+
+TC_ONELINE_DESCR="Sanity test of Non-RT RIC Helm recepie - all components"
+
+#App names to include in the test when running docker, space separated list
+DOCKER_INCLUDED_IMAGES="" # Not used -  KUBE only test script
+
+#App names to include in the test when running kubernetes, space separated list
+KUBE_INCLUDED_IMAGES=" MR CR  PRODSTUB"
+#Prestarted app (not started by script) to include in the test when running kubernetes, space separated list
+KUBE_PRESTARTED_IMAGES=" PA RICSIM CP ECS RC SDNC"
+
+#Supported test environment profiles
+SUPPORTED_PROFILES="ORAN-CHERRY ORAN-DAWN"
+#Supported run modes
+SUPPORTED_RUNMODES="KUBE"
+
+. ../common/testcase_common.sh $@
+. ../common/agent_api_functions.sh
+. ../common/ricsimulator_api_functions.sh
+. ../common/ecs_api_functions.sh
+. ../common/prodstub_api_functions.sh
+. ../common/cr_api_functions.sh
+. ../common/rapp_catalogue_api_functions.sh
+. ../common/mr_api_functions.sh
+. ../common/control_panel_api_functions.sh
+. ../common/controller_api_functions.sh
+
+#### TEST BEGIN ####
+
+use_mr_http       #MR only supports http?
+use_cr_https
+use_agent_rest_https
+use_sdnc_https
+use_simulator_https
+use_ecs_rest_https
+use_prod_stub_https
+use_rapp_catalogue_http
+
+echo -e "$RED CHECK WHY RC HTTPS DOES NOT WORK $ERED"
+
+use_control_panel_https
+
+if [ "$PMS_VERSION" == "V1" ]; then
+   echo "PMS VERSION 2 (V2) is required"
+   exit 1
+fi
+
+clean_environment
+
+STD_NUM_RICS=2
+OSC_NUM_RICS=2
+
+start_ric_simulators a1-sim-osc $STD_NUM_RICS OSC_2.1.0
+echo " RIC MAPPING a1-sim-osc-0 : ric1"
+echo " RIC MAPPING a1-sim-osc-1 : ric2"
+
+start_ric_simulators a1-sim-std $STD_NUM_RICS STD_1.1.3
+echo " RIC MAPPING a1-sim-std-0 : ric3"
+echo " RIC MAPPING a1-sim-std-1 : ric4"
+
+start_ric_simulators a1-sim-std2 $STD_NUM_RICS STD_2.0.0
+echo " RIC MAPPING a1-sim-std2-0 : ric5"
+echo " RIC MAPPING a1-sim-std2-1 : ric6"
+
+start_mr
+
+start_control_panel
+
+start_sdnc
+
+start_policy_agent
+
+start_cr
+
+start_prod_stub
+
+start_ecs
+
+set_ecs_trace
+
+start_rapp_catalogue
+
+set_agent_trace
+
+#### Test RAPP Catalogue ####
+
+rapp_cat_api_get_services 200 EMPTY
+
+rapp_cat_api_put_service 201 "Emergency-response-app" v1 "Emergency-response-app" "Emergency-response-app"
+
+rapp_cat_api_get_services 200 "Emergency-response-app" v1 "Emergency-response-app" "Emergency-response-app"
+
+#Check the number of services
+rc_equal json:services 1
+
+api_get_status 200
+
+#### Test Policy Management Service ####
+
+# Print the A1 version for STD 1.1.X
+for ((i=0; i<$STD_NUM_RICS; i++))
+do
+    sim_print "a1-sim-std-"$i interface
+done
+
+# Print the A1 version for STD 2.0.X
+for ((i=0; i<$STD_NUM_RICS; i++))
+do
+   sim_print "a1-sim-std2-"$i interface
+done
+
+# Print the A1 version for OSC 2.1.X
+for ((i=0; i<$OSC_NUM_RICS; i++))
+do
+    sim_print "a1-sim-osc-"$i interface
+done
+
+
+# Load the polictypes in STD 2
+for ((i=0; i<$STD_NUM_RICS; i++))
+do
+   sim_put_policy_type 201 "a1-sim-std2-"$i STD_QOS_0_2_0 testdata/STD2/sim_qos.json
+   sim_put_policy_type 201 "a1-sim-std2-"$i STD_QOS2_0.1.0 testdata/STD2/sim_qos2.json
+done
+
+# Load the polictypes in OSC
+for ((i=0; i<$OSC_NUM_RICS; i++))
+do
+    sim_put_policy_type 201 "a1-sim-osc-"$i 1 testdata/OSC/sim_1.json
+    sim_put_policy_type 201 "a1-sim-osc-"$i 2 testdata/OSC/sim_2.json
+done
+
+# Check that all rics are synced in
+api_equal json:rics 6 300
+
+#Check the number of schemas and the individual schemas
+api_equal json:policy-types 5 300
+
+for ((i=0; i<$STD_NUM_RICS; i++))
+do
+    ricid=$((3+$i))
+    api_equal json:policy-types?ric_id=ric$ricid 1 120
+done
+
+for ((i=0; i<$STD_NUM_RICS; i++))
+do
+   ricid=$((5+$i))
+   api_equal json:policy-types?ric_id=ric$ricid 2 120
+done
+
+for ((i=0; i<$OSC_NUM_RICS; i++))
+do
+    ricid=$((1+$i))
+    api_equal json:policy-types?ric_id=ric$ricid 2 120
+done
+
+#Check the schemas in STD 2
+for ((i=0; i<$OSC_NUM_RICS; i++))
+do
+   ricid=$((5+$i))
+   api_get_policy_type 200 STD_QOS_0_2_0 testdata/STD2/qos-agent-modified.json
+   api_get_policy_type 200 STD_QOS2_0.1.0 testdata/STD2/qos2-agent-modified.json
+done
+
+# Check the schemas in OSC
+for ((i=0; i<$OSC_NUM_RICS; i++))
+do
+    api_get_policy_type 200 1 testdata/OSC/1-agent-modified.json
+    api_get_policy_type 200 2 testdata/OSC/2-agent-modified.json
+done
+
+api_put_service 201 "Emergency-response-app" 0 "$CR_SERVICE_PATH/ER-app"
+
+# Create policies in STD
+for ((i=0; i<$STD_NUM_RICS; i++))
+do
+    ricid=$((3+$i))
+    generate_uuid
+    api_put_policy 201 "Emergency-response-app" ric$ricid NOTYPE $((1100+$i)) NOTRANSIENT $CR_SERVICE_PATH/"std2" testdata/STD/pi1_template.json 1
+    generate_uuid
+    api_put_policy 201 "Emergency-response-app" ric$ricid NOTYPE $((1200+$i)) NOTRANSIENT $CR_SERVICE_PATH/"std2" testdata/STD/pi1_template.json 1
+done
+
+#Create policies in STD 2
+for ((i=0; i<$STD_NUM_RICS; i++))
+do
+   ricid=$((5+$i))
+   generate_uuid
+   api_put_policy 201 "Emergency-response-app" ric$ricid STD_QOS_0_2_0 $((2100+$i)) NOTRANSIENT $CR_SERVICE_PATH/"std2" testdata/STD2/pi_qos_template.json 1
+   generate_uuid
+   api_put_policy 201 "Emergency-response-app" ric$ricid STD_QOS2_0.1.0 $((2200+$i)) NOTRANSIENT $CR_SERVICE_PATH/"std2" testdata/STD2/pi_qos2_template.json 1
+done
+
+# Create policies in OSC
+for ((i=0; i<$OSC_NUM_RICS; i++))
+do
+    ricid=$((1+$i))
+    generate_uuid
+    api_put_policy 201 "Emergency-response-app" ric$ricid 1 $((3100+$i)) NOTRANSIENT $CR_SERVICE_PATH/"osc" testdata/OSC/pi1_template.json 1
+    generate_uuid
+    api_put_policy 201 "Emergency-response-app" ric$ricid 2 $((3200+$i)) NOTRANSIENT $CR_SERVICE_PATH/"osc" testdata/OSC/pi2_template.json 1
+done
+
+
+# Check the number of policies in STD and STD2
+for ((i=0; i<$STD_NUM_RICS; i++))
+do
+    sim_equal "a1-sim-std-"$i num_instances 2
+    sim_equal "a1-sim-std2-"$i num_instances 2
+done
+
+# Check the number of policies in OSC
+for ((i=0; i<$STD_NUM_RICS; i++))
+do
+    sim_equal "a1-sim-osc-"$i num_instances 2
+done
+
+echo "ADD EVENT/STATUS CHECK"
+echo "ADD MR CHECK"
+
+FLAT_A1_EI="1"
+
+ecs_api_admin_reset
+
+CB_JOB="$PROD_STUB_SERVICE_PATH$PROD_STUB_JOB_CALLBACK"
+CB_SV="$PROD_STUB_SERVICE_PATH$PROD_STUB_SUPERVISION_CALLBACK"
+TARGET1="$RIC_SIM_HTTPX://a1-sim-std2-0.a1-sim:$RIC_SIM_PORT/datadelivery"
+TARGET2="$RIC_SIM_HTTPX://a1-sim-std2-1.a1-sim:$RIC_SIM_PORT/datadelivery"
+
+STATUS1="$CR_SERVICE_PATH/job1-status"
+STATUS2="$CR_SERVICE_PATH/job2-status"
+
+prodstub_arm_producer 200 prod-a
+prodstub_arm_type 200 prod-a type1
+prodstub_arm_job_create 200 prod-a job1
+prodstub_arm_job_create 200 prod-a job2
+
+
+### ecs status
+ecs_api_service_status 200
+
+## Setup prod-a
+ecs_api_edp_put_producer 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
+
+ecs_api_edp_get_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
+
+ecs_api_edp_get_producer_status 200 prod-a ENABLED
+
+
+## Create a job for prod-a
+## job1 - prod-a
+if [  -z "$FLAT_A1_EI" ]; then
+    ecs_api_a1_put_job 201 type1 job1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
+else
+    ecs_api_a1_put_job 201 job1 type1 $TARGET1 ricsim_g3_1 $STATUS1 testdata/ecs/job-template.json
+fi
+
+# Check the job data in the producer
+prodstub_check_jobdata 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
+
+
+## Create a second job for prod-a
+## job2 - prod-a
+if [  -z "$FLAT_A1_EI" ]; then
+    ecs_api_a1_put_job 201 type1 job2 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json
+else
+    ecs_api_a1_put_job 201 job2 type1 $TARGET2 ricsim_g3_2 $STATUS2 testdata/ecs/job-template.json
+fi
+
+# Check the job data in the producer
+prodstub_check_jobdata 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json
+
+
+echo "ADD EVENT/STATUS CHECK"
+
+check_policy_agent_logs
+check_ecs_logs
+check_sdnc_logs
+
+#### TEST COMPLETE ####
+
+store_logs          END
+
+print_result
index fe85372..0b70495 100755 (executable)
 
 TC_ONELINE_DESCR="Preparation demo setup  - populating a number of ric simulators with types and instances"
 
-#App names to include in the test, space separated list
-INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC"
+#App names to include in the test when running docker, space separated list
+DOCKER_INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC"
 
-#SUPPORTED TEST ENV FILE
+#App names to include in the test when running kubernetes, space separated list
+KUBE_INCLUDED_IMAGES="CP CR MR PA RICSIM SDNC"
+#Prestarted app (not started by script) to include in the test when running kubernetes, space separated list
+KUBE_PRESTARTED_IMAGES=""
+
+#Supported test environment profiles
 SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU  ORAN-CHERRY ORAN-DAWN"
+#Supported run modes
+SUPPORTED_RUNMODES="DOCKER KUBE"
 
 . ../common/testcase_common.sh $@
 . ../common/agent_api_functions.sh
 . ../common/ricsimulator_api_functions.sh
+. ../common/mr_api_functions.sh
+. ../common/control_panel_api_functions.sh
+. ../common/controller_api_functions.sh
+. ../common/cr_api_functions.sh
+. ../common/consul_cbs_functions.sh
 
 #### TEST BEGIN ####
 
@@ -40,12 +52,12 @@ use_sdnc_https
 use_simulator_https
 
 if [ "$PMS_VERSION" == "V2" ]; then
-    notificationurl=$CR_PATH"/test"
+    notificationurl=$CR_SERVICE_PATH"/test"
 else
     notificationurl=""
 fi
 
-clean_containers
+clean_environment
 
 OSC_NUM_RICS=6
 STD_NUM_RICS=5
@@ -60,18 +72,25 @@ fi
 
 start_mr #Just to prevent errors in the agent log...
 
-start_control_panel
+start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/application.properties
 
 start_sdnc
 
-start_consul_cbs
+start_policy_agent NORPOXY $SIM_GROUP/$POLICY_AGENT_COMPOSE_DIR/application.yaml
 
-prepare_consul_config      SDNC  ".consul_config.json"
-consul_config_app                  ".consul_config.json"
+set_agent_trace
 
-start_policy_agent
+if [ $RUNMODE == "DOCKER" ]; then
+    start_consul_cbs
+fi
 
-set_agent_trace
+prepare_consul_config      SDNC  ".consul_config.json"
+
+if [ $RUNMODE == "KUBE" ]; then
+    agent_load_config                       ".consul_config.json"
+else
+    consul_config_app                      ".consul_config.json"
+fi
 
 api_get_status 200
 
@@ -108,7 +127,7 @@ done
 #Check the number of schemas and the individual schemas in OSC
 if [ "$PMS_VERSION" == "V2" ]; then
 
-    api_equal json:policy-types 3 120
+    api_equal json:policy-types 3 300
 
     for ((i=1; i<=$OSC_NUM_RICS; i++))
     do
@@ -122,7 +141,7 @@ if [ "$PMS_VERSION" == "V2" ]; then
         api_get_policy_type 200 20008 demo-testdata/OSC/tsa-agent-modified.json
     done
 else
-    api_equal json:policy_types 3 120
+    api_equal json:policy_types 3 300
 
     for ((i=1; i<=$OSC_NUM_RICS; i++))
     do
@@ -176,7 +195,7 @@ fi
 # Create policies
 use_agent_rest_http
 
-api_put_service 201 "Emergency-response-app" 0 "$CR_PATH/1"
+api_put_service 201 "Emergency-response-app" 0 "$CR_SERVICE_PATH/1"
 
 # Create policies in OSC
 for ((i=1; i<=$OSC_NUM_RICS; i++))
index 3f9f8fd..fd5871c 100755 (executable)
 
 TC_ONELINE_DESCR="Preparation demo setup  - policy management and enrichment information"
 
-#App names to include in the test, space separated list
-INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC ECS PRODSTUB RC"
+#App names to include in the test when running docker, space separated list
+DOCKER_INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC ECS PRODSTUB RC HTTPPROXY"
 
-#SUPPORTED TEST ENV FILE
+#App names to include in the test when running kubernetes, space separated list
+KUBE_INCLUDED_IMAGES=" MR CR PA RC PRODSTUB RICSIM CP ECS SDNC HTTPPROXY"
+#Prestarted app (not started by script) to include in the test when running kubernetes, space separated list
+KUBE_PRESTARTED_IMAGES=""
+
+#Supported test environment profiles
 SUPPORTED_PROFILES="ONAP-HONOLULU  ORAN-CHERRY ORAN-DAWN"
+#Supported run modes
+SUPPORTED_RUNMODES="DOCKER KUBE"
 
 . ../common/testcase_common.sh $@
 . ../common/agent_api_functions.sh
@@ -32,6 +39,11 @@ SUPPORTED_PROFILES="ONAP-HONOLULU  ORAN-CHERRY ORAN-DAWN"
 . ../common/prodstub_api_functions.sh
 . ../common/cr_api_functions.sh
 . ../common/rapp_catalogue_api_functions.sh
+. ../common/mr_api_functions.sh
+. ../common/control_panel_api_functions.sh
+. ../common/controller_api_functions.sh
+. ../common/consul_cbs_functions.sh
+. ../common/http_proxy_api_functions.sh
 
 #### TEST BEGIN ####
 
@@ -47,13 +59,13 @@ use_prod_stub_https
 use_rapp_catalogue_http # https not yet supported
 
 if [ "$PMS_VERSION" == "V2" ]; then
-    notificationurl=$CR_PATH"/test"
+    notificationurl=$CR_SERVICE_PATH"/test"
 else
    echo "PMS VERSION 2 (V2) is required"
    exit 1
 fi
 
-clean_containers
+clean_environment
 
 STD_NUM_RICS=2
 
@@ -61,22 +73,29 @@ start_ric_simulators $RIC_SIM_PREFIX"_g3" $STD_NUM_RICS STD_2.0.0
 
 start_mr #Just to prevent errors in the agent log...
 
-start_control_panel
+start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/application.properties
 
 start_sdnc
 
-start_consul_cbs
+start_policy_agent PROXY $SIM_GROUP/$POLICY_AGENT_COMPOSE_DIR/application.yaml
+
+if [ $RUNMODE == "DOCKER" ]; then
+    start_consul_cbs
+fi
 
 prepare_consul_config      SDNC  ".consul_config.json"
-consul_config_app                  ".consul_config.json"
 
-start_policy_agent
+if [ $RUNMODE == "KUBE" ]; then
+    agent_load_config                       ".consul_config.json"
+else
+    consul_config_app                      ".consul_config.json"
+fi
 
 start_cr
 
 start_prod_stub
 
-start_ecs
+start_ecs $SIM_GROUP/$ECS_COMPOSE_DIR/application.yaml
 
 start_rapp_catalogue
 
@@ -84,7 +103,6 @@ set_agent_trace
 
 set_ecs_trace
 
-
 rapp_cat_api_get_services 200 EMPTY
 
 rapp_cat_api_put_service 201 "Emergency-response-app" v1 "Emergency-response-app" "Emergency-response-app"
@@ -121,9 +139,9 @@ do
 done
 
 #Check the number of types
-api_equal json:policy-types 2 120
+api_equal json:policy-types 2 300
 
-api_put_service 201 "Emergency-response-app" 0 "$CR_PATH/1"
+api_put_service 201 "Emergency-response-app" 0 "$CR_SERVICE_PATH/1"
 
 # Create policies in STD
 for ((i=1; i<=$STD_NUM_RICS; i++))
@@ -141,29 +159,36 @@ do
     sim_equal $RIC_SIM_PREFIX"_g3_"$i num_instances 2
 done
 
-
+# Print calling hosts STD 2.X
+for ((i=1; i<=$STD_NUM_RICS; i++))
+do
+    sim_print $RIC_SIM_PREFIX"_g3_"$i remote_hosts
+done
 
 FLAT_A1_EI="1"
 
-CB_JOB="$PROD_STUB_HTTPX://$PROD_STUB_APP_NAME:$PROD_STUB_PORT/callbacks/job"
-CB_SV="$PROD_STUB_HTTPX://$PROD_STUB_APP_NAME:$PROD_STUB_PORT/callbacks/supervision"
-TARGET1="$RIC_SIM_HTTPX://ricsim_g3_1:$RIC_SIM_PORT/datadelivery"
-TARGET2="$RIC_SIM_HTTPX://ricsim_g3_2:$RIC_SIM_PORT/datadelivery"
+CB_JOB="$PROD_STUB_SERVICE_PATH$PROD_STUB_JOB_CALLBACK"
+CB_SV="$PROD_STUB_SERVICE_PATH$PROD_STUB_SUPERVISION_CALLBACK"
+RIC_G1_1=$RIC_SIM_PREFIX"_g3_1"
+RIC_G1_2=$RIC_SIM_PREFIX"_g3_2"
+if [ $RUNMODE == "KUBE" ]; then
+    RIC_G1_1=$(get_kube_sim_host $RIC_G1_1)
+    RIC_G1_2=$(get_kube_sim_host $RIC_G1_2)
+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_HTTPX://$CR_APP_NAME:$CR_PORT/callbacks/job1-status"
-STATUS2="$CR_HTTPX://$CR_APP_NAME:$CR_PORT/callbacks/job2-status"
+STATUS1="$CR_SERVICE_PATH/callbacks/job1-status"
+STATUS2="$CR_SERVICE_PATH/callbacks/job2-status"
 
 prodstub_arm_producer 200 prod-a
 prodstub_arm_type 200 prod-a type1
 prodstub_arm_job_create 200 prod-a job1
 prodstub_arm_job_create 200 prod-a job2
 
-
 ### ecs status
 ecs_api_service_status 200
 
-
-
 ## Setup prod-a
 ecs_api_edp_put_producer 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
 
@@ -195,9 +220,6 @@ fi
 # Check the job data in the producer
 prodstub_check_jobdata 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json
 
-
-
-
 check_policy_agent_logs
 check_ecs_logs
 check_sdnc_logs
diff --git a/test/common/.gitignore b/test/common/.gitignore
new file mode 100644 (file)
index 0000000..bc68808
--- /dev/null
@@ -0,0 +1 @@
+NO-CHECKIN
index fbd9fc4..98a8b56 100644 (file)
 #  ============LICENSE_END=================================================
 #
 
-# This is a script that contains specific test functions for Policy Agent API
+# This is a script that contains management and test functions for Policy Agent
 
-### API functiond towards the Policy Agent
 
-. ../common/api_curl.sh
+## Access to Policy agent
+# Host name may be changed if app started by kube
+# Direct access from script
+PA_HTTPX="http"
+PA_HOST_NAME=$LOCALHOST_NAME
+PA_PATH=$PA_HTTPX"://"$PA_HOST_NAME":"$POLICY_AGENT_EXTERNAL_PORT
+
+# PA_ADAPTER used for switch between REST and DMAAP
+PA_ADAPTER_TYPE="REST"
+PA_ADAPTER=$PA_PATH
+
+# Make curl retries towards the agent for http response codes set in this env var, space separated list of codes
+AGENT_RETRY_CODES=""
+
+###########################
+### Policy Agents functions
+###########################
+
+# All calls to the agent will be directed to the agent REST interface from now on
+# args: -
+# (Function for test scripts)
+use_agent_rest_http() {
+       echo -e $BOLD"Agent protocol setting"$EBOLD
+       echo -e " Using $BOLD http $EBOLD and $BOLD REST $EBOLD towards the agent"
+       PA_HTTPX="http"
+       PA_PATH=$PA_HTTPX"://"$PA_HOST_NAME":"$POLICY_AGENT_EXTERNAL_PORT
+
+       PA_ADAPTER_TYPE="REST"
+       PA_ADAPTER=$PA_PATH
+       echo ""
+}
+
+# All calls to the agent will be directed to the agent REST interface from now on
+# args: -
+# (Function for test scripts)
+use_agent_rest_https() {
+       echo -e $BOLD"Agent protocol setting"$EBOLD
+       echo -e " Using $BOLD https $EBOLD and $BOLD REST $EBOLD towards the agent"
+       PA_HTTPX="https"
+       PA_PATH=$PA_HTTPX"://"$PA_HOST_NAME":"$POLICY_AGENT_EXTERNAL_SECURE_PORT
+
+       PA_ADAPTER_TYPE="REST"
+       PA_ADAPTER=$PA_PATH
+       echo ""
+}
+
+# All calls to the agent will be directed to the agent dmaap interface over http from now on
+# args: -
+# (Function for test scripts)
+use_agent_dmaap_http() {
+       echo -e $BOLD"Agent dmaap protocol setting"$EBOLD
+       echo -e " Using $BOLD http $EBOLD and $BOLD DMAAP $EBOLD towards the agent"
+       PA_ADAPTER_TYPE="MR-HTTP"
+       echo ""
+}
+
+# All calls to the agent will be directed to the agent dmaap interface over https from now on
+# args: -
+# (Function for test scripts)
+use_agent_dmaap_https() {
+       echo -e $BOLD"Agent dmaap protocol setting"$EBOLD
+       echo -e " Using $BOLD https $EBOLD and $BOLD DMAAP $EBOLD towards the agent"
+       echo -e $YELLOW" Setting http instead of https - MR only uses http"$EYELLOW
+       PA_ADAPTER_TYPE="MR-HTTPS"
+       echo ""
+}
+
+# Start the policy agent
+# args: (kube only) PROXY|NOPROXY <config-file> [ <data-file>]
+# (Function for test scripts)
+start_policy_agent() {
+       echo -e $BOLD"Starting $POLICY_AGENT_DISPLAY_NAME"$EBOLD
+
+       if [ $RUNMODE == "KUBE" ]; then
+
+               # Check if app shall be fully managed by the test script
+               __check_included_image "PA"
+               retcode_i=$?
+
+               # Check if app shall only be used by the testscipt
+               __check_prestarted_image "PA"
+               retcode_p=$?
+
+               if [ $retcode_i -ne 0 ] && [ $retcode_p -ne 0 ]; then
+                       echo -e $RED"The $POLICY_AGENT_APP_NAME app is not included as managed nor prestarted in this test script"$ERED
+                       echo -e $RED"The $POLICY_AGENT_APP_NAME will not be started"$ERED
+                       exit
+               fi
+               if [ $retcode_i -eq 0 ] && [ $retcode_p -eq 0 ]; then
+                       echo -e $RED"The $POLICY_AGENT_APP_NAME app is included both as managed and prestarted in this test script"$ERED
+                       echo -e $RED"The $POLICY_AGENT_APP_NAME will not be started"$ERED
+                       exit
+               fi
+
+               if [ $retcode_p -eq 0 ]; then
+                       echo -e " Using existing $POLICY_AGENT_APP_NAME deployment and service"
+                       echo " Setting $POLICY_AGENT_APP_NAME replicas=1"
+                       __kube_scale deployment $POLICY_AGENT_APP_NAME $KUBE_NONRTRIC_NAMESPACE 1
+               fi
+
+               if [ $retcode_i -eq 0 ]; then
+
+                       echo -e " Creating $POLICY_AGENT_APP_NAME app and expose service"
+
+                       #Check if nonrtric namespace exists, if not create it
+                       __kube_create_namespace $KUBE_NONRTRIC_NAMESPACE
+
+                       #Export all vars needed for service and deployment
+                       export POLICY_AGENT_APP_NAME
+                       export KUBE_NONRTRIC_NAMESPACE
+                       export POLICY_AGENT_IMAGE
+                       export POLICY_AGENT_INTERNAL_PORT
+                       export POLICY_AGENT_INTERNAL_SECURE_PORT
+                       export POLICY_AGENT_EXTERNAL_PORT
+                       export POLICY_AGENT_EXTERNAL_SECURE_PORT
+                       export POLICY_AGENT_CONFIG_MOUNT_PATH
+                       export POLICY_AGENT_DATA_MOUNT_PATH
+                       export POLICY_AGENT_CONFIG_CONFIGMAP_NAME=$POLICY_AGENT_APP_NAME"-config"
+                       export POLICY_AGENT_DATA_CONFIGMAP_NAME=$POLICY_AGENT_APP_NAME"-data"
+                       export POLICY_AGENT_PKG_NAME
+                       if [ $1 == "PROXY" ]; then
+                               AGENT_HTTP_PROXY_CONFIG_PORT=$HTTP_PROXY_CONFIG_PORT  #Set if proxy is started
+                               AGENT_HTTP_PROXY_CONFIG_HOST_NAME=$HTTP_PROXY_CONFIG_HOST_NAME #Set if proxy is started
+                       else
+                               AGENT_HTTP_PROXY_CONFIG_PORT=0
+                               AGENT_HTTP_PROXY_CONFIG_HOST_NAME=""
+                       fi
+                       export AGENT_HTTP_PROXY_CONFIG_PORT
+                       export AGENT_HTTP_PROXY_CONFIG_HOST_NAME
+
+
+                       # Create config map for config
+                       configfile=$PWD/tmp/$POLICY_AGENT_CONFIG_FILE
+                       cp $2 $configfile
+                       output_yaml=$PWD/tmp/pa_cfc.yaml
+                       __kube_create_configmap $POLICY_AGENT_CONFIG_CONFIGMAP_NAME $KUBE_NONRTRIC_NAMESPACE autotest PA $configfile $output_yaml
+
+                       # Create config map for data
+                       data_json=$PWD/tmp/$POLICY_AGENT_DATA_FILE
+                       if [ $# -lt 3 ]; then
+                               #create empty dummy file
+                               echo "{}" > $data_json
+                       else
+                               cp $3 $data_json
+                       fi
+                       output_yaml=$PWD/tmp/pa_cfd.yaml
+                       __kube_create_configmap $POLICY_AGENT_DATA_CONFIGMAP_NAME $KUBE_NONRTRIC_NAMESPACE autotest PA $data_json $output_yaml
+
+                       # Create service
+                       input_yaml=$SIM_GROUP"/"$POLICY_AGENT_COMPOSE_DIR"/"svc.yaml
+                       output_yaml=$PWD/tmp/pa_svc.yaml
+                       __kube_create_instance service $POLICY_AGENT_APP_NAME $input_yaml $output_yaml
+
+                       # Create app
+                       input_yaml=$SIM_GROUP"/"$POLICY_AGENT_COMPOSE_DIR"/"app.yaml
+                       output_yaml=$PWD/tmp/pa_app.yaml
+                       __kube_create_instance app $POLICY_AGENT_APP_NAME $input_yaml $output_yaml
+
+               fi
+
+               echo " Retrieving host and ports for service..."
+               PA_HOST_NAME=$(__kube_get_service_host $POLICY_AGENT_APP_NAME $KUBE_NONRTRIC_NAMESPACE)
+               POLICY_AGENT_EXTERNAL_PORT=$(__kube_get_service_port $POLICY_AGENT_APP_NAME $KUBE_NONRTRIC_NAMESPACE "http")
+               POLICY_AGENT_EXTERNAL_SECURE_PORT=$(__kube_get_service_port $POLICY_AGENT_APP_NAME $KUBE_NONRTRIC_NAMESPACE "https")
+
+               echo " Host IP, http port, https port: $PA_HOST_NAME $POLICY_AGENT_EXTERNAL_PORT $POLICY_AGENT_EXTERNAL_SECURE_PORT"
+
+               if [ $PA_HTTPX == "http" ]; then
+                       PA_PATH=$PA_HTTPX"://"$PA_HOST_NAME":"$POLICY_AGENT_EXTERNAL_PORT
+               else
+                       PA_PATH=$PA_HTTPX"://"$PA_HOST_NAME":"$POLICY_AGENT_EXTERNAL_SECURE_PORT
+               fi
+               __check_service_start $POLICY_AGENT_APP_NAME $PA_PATH$POLICY_AGENT_ALIVE_URL
+
+               if [ $PA_ADAPTER_TYPE == "REST" ]; then
+                       PA_ADAPTER=$PA_PATH
+               fi
+       else
+               __check_included_image 'PA'
+               if [ $? -eq 1 ]; then
+                       echo -e $RED"The Policy Agent app is not included in this test script"$ERED
+                       echo -e $RED"The Policy Agent will not be started"$ERED
+                       exit
+               fi
+
+               #Export all vars needed for docker-compose
+               export POLICY_AGENT_APP_NAME
+               export POLICY_AGENT_APP_NAME_ALIAS
+               export POLICY_AGENT_INTERNAL_PORT
+               export POLICY_AGENT_EXTERNAL_PORT
+               export POLICY_AGENT_INTERNAL_SECURE_PORT
+               export POLICY_AGENT_EXTERNAL_SECURE_PORT
+               export CONSUL_HOST
+               export CONSUL_INTERNAL_PORT
+               export CONFIG_BINDING_SERVICE
+               export POLICY_AGENT_CONFIG_KEY
+               export DOCKER_SIM_NWNAME
+               export POLICY_AGENT_HOST_MNT_DIR
+               export POLICY_AGENT_CONFIG_MOUNT_PATH
+               export POLICY_AGENT_CONFIG_FILE
+               export POLICY_AGENT_PKG_NAME
+
+               if [ $1 == "PROXY" ]; then
+                       AGENT_HTTP_PROXY_CONFIG_PORT=$HTTP_PROXY_CONFIG_PORT  #Set if proxy is started
+                       AGENT_HTTP_PROXY_CONFIG_HOST_NAME=$HTTP_PROXY_CONFIG_HOST_NAME #Set if proxy is started
+               else
+                       AGENT_HTTP_PROXY_CONFIG_PORT=0
+                       AGENT_HTTP_PROXY_CONFIG_HOST_NAME=""
+               fi
+               export AGENT_HTTP_PROXY_CONFIG_PORT
+               export AGENT_HTTP_PROXY_CONFIG_HOST_NAME
+
+               dest_file=$SIM_GROUP/$POLICY_AGENT_COMPOSE_DIR/$POLICY_AGENT_HOST_MNT_DIR/application.yaml
+
+               envsubst < $2 > $dest_file
+
+               __start_container $POLICY_AGENT_COMPOSE_DIR NODOCKERARGS 1 $POLICY_AGENT_APP_NAME
+
+               __check_service_start $POLICY_AGENT_APP_NAME $PA_PATH$POLICY_AGENT_ALIVE_URL
+       fi
+       echo ""
+       return 0
+}
+
+agent_load_config() {
+       echo -e $BOLD"Agent - load config from "$EBOLD$1
+       data_json=$PWD/tmp/$POLICY_AGENT_DATA_FILE
+       cp $1 $data_json
+       output_yaml=$PWD/tmp/pa_cfd.yaml
+       __kube_create_configmap $POLICY_AGENT_APP_NAME"-data" $KUBE_NONRTRIC_NAMESPACE autotest PA $data_json $output_yaml
+}
+
+
+# Turn on debug level tracing in the agent
+# args: -
+# (Function for test scripts)
+set_agent_debug() {
+       echo -e $BOLD"Setting agent debug logging"$EBOLD
+       curlString="$PA_PATH$POLICY_AGENT_ACTUATOR -X POST  -H Content-Type:application/json -d {\"configuredLevel\":\"debug\"}"
+       result=$(__do_curl "$curlString")
+       if [ $? -ne 0 ]; then
+               __print_err "could not set debug mode" $@
+               ((RES_CONF_FAIL++))
+               return 1
+       fi
+       echo ""
+       return 0
+}
+
+# Turn on trace level tracing in the agent
+# args: -
+# (Function for test scripts)
+set_agent_trace() {
+       echo -e $BOLD"Setting agent trace logging"$EBOLD
+       curlString="$PA_PATH$POLICY_AGENT_ACTUATOR -X POST  -H Content-Type:application/json -d {\"configuredLevel\":\"trace\"}"
+       result=$(__do_curl "$curlString")
+       if [ $? -ne 0 ]; then
+               __print_err "could not set trace mode" $@
+               ((RES_CONF_FAIL++))
+               return 1
+       fi
+       echo ""
+       return 0
+}
+
+# Perform curl retries when making direct call to the agent for the specified http response codes
+# Speace separated list of http response codes
+# args: [<response-code>]*
+use_agent_retries() {
+       echo -e $BOLD"Do curl retries to the agent REST inteface for these response codes:$@"$EBOLD
+       AGENT_RETRY_CODES=$@
+       echo ""
+       return
+}
 
 #########################################################
 #### Test case functions A1 Policy management service
@@ -36,9 +308,9 @@ api_equal() {
        if [ $# -eq 2 ] || [ $# -eq 3 ]; then
                if [[ $1 == "json:"* ]]; then
                        if [ "$PMS_VERSION" == "V2" ]; then
-                               __var_test "Policy Agent" $LOCALHOST$POLICY_AGENT_EXTERNAL_PORT"/v2/" $1 "=" $2 $3
+                               __var_test "Policy Agent" $PA_PATH"/v2/" $1 "=" $2 $3
                        else
-                               __var_test "Policy Agent" $LOCALHOST$POLICY_AGENT_EXTERNAL_PORT"/" $1 "=" $2 $3
+                               __var_test "Policy Agent" $PA_PATH"/" $1 "=" $2 $3
                        fi
                        return 0
                fi
@@ -546,7 +818,8 @@ api_put_policy_parallel() {
        count=$1; shift;
        pids=$1; shift;
 
-       if [ $ADAPTER != $RESTBASE ] && [ $ADAPTER != $RESTBASE_SECURE ]; then
+       #if [ $PA_ADAPTER != $RESTBASE ] && [ $PA_ADAPTER != $RESTBASE_SECURE ]; then
+       if [ $__ADAPTER_TYPE != "REST" ]; then
                echo " Info - api_put_policy_parallel uses only the agent REST interface - create over dmaap in parallel is not supported"
                echo " Info - will execute over agent REST"
        fi
@@ -570,7 +843,7 @@ api_put_policy_parallel() {
                fi
        fi
 
-       urlbase=${ADAPTER}${query}
+       urlbase=${PA_ADAPTER}${query}
 
        for ((i=1; i<=$pids; i++))
        do
@@ -746,7 +1019,8 @@ api_delete_policy_parallel() {
        count=$1; shift;
        pids=$1; shift;
 
-       if [ $ADAPTER != $RESTBASE ] && [ $ADAPTER != $RESTBASE_SECURE ]; then
+       #if [ $PA_ADAPTER != $RESTBASE ] && [ $PA_ADAPTER != $RESTBASE_SECURE ]; then
+       if [ $__ADAPTER_TYPE != "REST" ]; then
                echo " Info - api_delete_policy_parallel uses only the agent REST interface - create over dmaap in parallel is not supported"
                echo " Info - will execute over agent REST"
        fi
@@ -757,7 +1031,7 @@ api_delete_policy_parallel() {
                query="/policy"
        fi
 
-       urlbase=${ADAPTER}${query}
+       urlbase=${PA_ADAPTER}${query}
 
        for ((i=1; i<=$pids; i++))
        do
index c7e5c90..1ea47dd 100644 (file)
 
 # Generic function to query the agent/ECS via the REST or DMAAP interface.
 # Used by all other agent/ECS api test functions
-# If operation prefix is '_BATCH' the the send and get response is split in two sequences,
+# If operation sufffix is '_BATCH' the the send and get response is split in two sequences,
 # one for sending the requests and one for receiving the response
 # but only when using the DMAAP interface
-# REST or DMAAP is controlled of the base url of $ADAPTER
-# arg: (PA|ECS|CR|RC GET|PUT|POST|DELETE|GET_BATCH|PUT_BATCH|POST_BATCH|DELETE_BATCH <url> [<file>]) | (PA|ECS RESPONSE <correlation-id>)
+# REST or DMAAP is controlled of the base url of $XX_ADAPTER
+# arg: (PA|ECS|CR|RC GET|PUT|POST|DELETE|GET_BATCH|PUT_BATCH|POST_BATCH|DELETE_BATCH <url>|<correlation-id> [<file>]) | (PA|ECS RESPONSE <correlation-id>)
 # (Not for test scripts)
 __do_curl_to_api() {
        TIMESTAMP=$(date "+%Y-%m-%d %H:%M:%S")
     echo " (${BASH_LINENO[0]}) - ${TIMESTAMP}: ${FUNCNAME[0]}" $@ >> $HTTPLOG
        paramError=0
-
+       input_url=$3
     if [ $# -gt 0 ]; then
         if [ $1 == "PA" ]; then
-            __ADAPTER=$ADAPTER
-            __RESTBASE=$RESTBASE
-            __RESTBASE_SECURE=$RESTBASE_SECURE
+                       __ADAPTER=$PA_ADAPTER
+                       __ADAPTER_TYPE=$PA_ADAPTER_TYPE
             __RETRY_CODES=$AGENT_RETRY_CODES
+                       if [ $PMS_VERSION != "V1" ]; then
+                               input_url=$PMS_API_PREFIX$3
+                       fi
         elif [ $1 == "ECS" ]; then
-            __ADAPTER=$ECS_ADAPTER
-            __RESTBASE=$ECS_RESTBASE
-            __RESTBASE_SECURE=$ECS_RESTBASE_SECURE
+                       __ADAPTER=$ECS_ADAPTER
+                       __ADAPTER_TYPE=$ECS_ADAPTER_TYPE
             __RETRY_CODES=$ECS_RETRY_CODES
                elif [ $1 == "CR" ]; then
-                   __ADAPTER=$CR_ADAPTER
-            __RESTBASE=$CR_RESTBASE
-            __RESTBASE_SECURE=$CR_RESTBASE_SECURE
+                       __ADAPTER=$CR_ADAPTER
+                       __ADAPTER_TYPE=$CR_ADAPTER_TYPE
             __RETRY_CODES=""
                elif [ $1 == "RC" ]; then
-                   __ADAPTER=$RC_ADAPTER
-            __RESTBASE=$RC_RESTBASE
-            __RESTBASE_SECURE=$RC_RESTBASE_SECURE
+                       __ADAPTER=$RC_ADAPTER
+                       __ADAPTER_TYPE=$RC_ADAPTER_TYPE
             __RETRY_CODES=""
         else
             paramError=1
         fi
+               if [ $__ADAPTER_TYPE == "MR-HTTP" ]; then
+                       __ADAPTER=$MR_ADAPTER_HTTP
+               fi
+               if [ $__ADAPTER_TYPE == "MR-HTTPS" ]; then
+                       __ADAPTER=$MR_ADAPTER_HTTPS
+               fi
     fi
     if [ $# -lt 3 ] || [ $# -gt 4 ]; then
                paramError=1
@@ -98,7 +103,8 @@ __do_curl_to_api() {
                        if [ $# -ne 3 ]; then
                                paramError=1
                        fi
-                       if [ $__ADAPTER == $__RESTBASE ] || [ $__ADAPTER == $__RESTBASE_SECURE ]; then
+                       #if [ $__ADAPTER == $__RESTBASE ] || [ $__ADAPTER == $__RESTBASE_SECURE ]; then
+                       if [ $__ADAPTER_TYPE == "REST" ]; then
                                paramError=1
                        fi
                else
@@ -115,8 +121,9 @@ __do_curl_to_api() {
         return 1
     fi
 
-    if [ $__ADAPTER == $__RESTBASE ] || [ $__ADAPTER == $__RESTBASE_SECURE ]; then
-        url=" "${__ADAPTER}${3}
+    #if [ $__ADAPTER == $__RESTBASE ] || [ $__ADAPTER == $__RESTBASE_SECURE ]; then
+       if [ $__ADAPTER_TYPE == "REST" ]; then
+        url=" "${__ADAPTER}${input_url}
         oper=" -X "$oper
         curlString="curl -k "${oper}${timeout}${httpcode}${accept}${content}${url}${file}
         echo " CMD: "$curlString >> $HTTPLOG
@@ -156,7 +163,7 @@ __do_curl_to_api() {
         return 0
     else
                if [ $oper != "RESPONSE" ]; then
-                       requestUrl=$3
+                       requestUrl=$input_url
                        if [ $2 == "PUT" ] && [ $# -eq 4 ]; then
                                payload="$(cat $4 | tr -d '\n' | tr -d ' ' )"
                                echo "payload: "$payload >> $HTTPLOG
@@ -165,7 +172,7 @@ __do_curl_to_api() {
                                echo " FILE: $(cat $4)" >> $HTTPLOG
                        fi
                        #urlencode the request url since it will be carried by send-request url
-                       requestUrl=$(python3 -c "from __future__ import print_function; import urllib.parse, sys; print(urllib.parse.quote(sys.argv[1]))"  "$3")
+                       requestUrl=$(python3 -c "from __future__ import print_function; import urllib.parse, sys; print(urllib.parse.quote(sys.argv[1]))"  "$input_url")
                        url=" "${__ADAPTER}"/send-request?url="${requestUrl}"&operation="${oper}
                        curlString="curl -k -X POST${timeout}${httpcode}${content}${url}${file}"
                        echo " CMD: "$curlString >> $HTTPLOG
diff --git a/test/common/clean_kube.sh b/test/common/clean_kube.sh
new file mode 100755 (executable)
index 0000000..ea17eee
--- /dev/null
@@ -0,0 +1,91 @@
+#!/bin/bash
+
+#  ============LICENSE_START===============================================
+#  Copyright (C) 2021 Nordix Foundation. All rights reserved.
+#  ========================================================================
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+#  ============LICENSE_END=================================================
+
+# Script to clean all resources from kubernetes having the label 'autotest', i.e started by autotest
+
+BOLD="\033[1m"
+EBOLD="\033[0m"
+RED="\033[31m\033[1m"
+ERED="\033[0m"
+GREEN="\033[32m\033[1m"
+EGREEN="\033[0m"
+YELLOW="\033[33m\033[1m"
+EYELLOW="\033[0m"
+SAMELINE="\033[0K\r"
+
+__kube_delete_all_resources() {
+       echo "Deleting all from namespace: "$1
+       namespace=$1
+       resources="deployments replicaset statefulset services pods configmaps pvc"
+       deleted_resourcetypes=""
+       for restype in $resources; do
+               result=$(kubectl get $restype -n $namespace -o jsonpath='{.items[?(@.metadata.labels.autotest)].metadata.name}')
+               if [ $? -eq 0 ] && [ ! -z "$result" ]; then
+                       deleted_resourcetypes=$deleted_resourcetypes" "$restype
+                       for resid in $result; do
+                               if [ $restype == "replicaset" ] || [ $restype == "statefulset" ]; then
+                                       kubectl scale  $restype $resid -n $namespace --replicas=0 1> /dev/null 2> /dev/null
+                                       T_START=$SECONDS
+                                       count=1
+                                       while [ $count -ne 0 ]; do
+                                               count=$(kubectl get $restype $resid  -n $namespace -o jsonpath='{.status.replicas}' 2> /dev/null)
+                                               echo -ne "  Scaling $restype $resid from namespace $namespace with label autotest to 0,count=$count....$(($SECONDS-$T_START)) seconds"$SAMELINE
+                                               if [ $? -eq 0 ] && [ ! -z "$count" ]; then
+                                                       sleep 0.5
+                                               else
+                                                       count=0
+                                               fi
+                                       done
+                                       echo -e "  Scaled $restype $resid from namespace $namespace with label $labelname=$labelid to 0,count=$count....$(($SECONDS-$T_START)) seconds$GREEN OK $EGREEN"
+                               fi
+                               echo -ne "  Deleting $restype $resid from namespace $namespace with label autotest "$SAMELINE
+                               kubectl delete $restype $resid -n $namespace 1> /dev/null 2> /dev/null
+                               if [ $? -eq 0 ]; then
+                                       echo -e "  Deleted $restype $resid from namespace $namespace with label autotest $GREEN OK $EGREEN"
+                               else
+                                       echo -e "  Deleted $restype $resid from namespace $namespace with label autotest $GREEN Does not exist - OK $EGREEN"
+                               fi
+                               #fi
+                       done
+               fi
+       done
+       if [ ! -z "$deleted_resourcetypes" ]; then
+               for restype in $deleted_resources; do
+                       echo -ne "  Waiting for $restype in namespace $namespace with label autotest to be deleted..."$SAMELINE
+                       T_START=$SECONDS
+                       result="dummy"
+                       while [ ! -z "$result" ]; do
+                               sleep 0.5
+                               result=$(kubectl get $restype -n $namespace -o jsonpath='{.items[?(@.metadata.labels.autotest)].metadata.name}')
+                               echo -ne "  Waiting for $restype in namespace $namespace with label autotest to be deleted...$(($SECONDS-$T_START)) seconds "$SAMELINE
+                               if [ -z "$result" ]; then
+                                       echo -e " Waiting for $restype in namespace $namespace with label autotest to be deleted...$(($SECONDS-$T_START)) seconds $GREEN OK $EGREEN"
+                               elif [ $(($SECONDS-$T_START)) -gt 300 ]; then
+                                       echo -e " Waiting for $restype in namespace $namespace with label autotest to be deleted...$(($SECONDS-$T_START)) seconds $RED Failed $ERED"
+                                       result=""
+                               fi
+                       done
+               done
+       fi
+}
+echo "Will remove all kube resources marked with label 'autotest'"
+__kube_delete_all_resources nonrtric
+__kube_delete_all_resources nonrtric-ft
+__kube_delete_all_resources onap
+
+echo "Done"
\ No newline at end of file
diff --git a/test/common/consul_cbs_functions.sh b/test/common/consul_cbs_functions.sh
new file mode 100644 (file)
index 0000000..a3c08fa
--- /dev/null
@@ -0,0 +1,219 @@
+#!/bin/bash
+
+#  ============LICENSE_START===============================================
+#  Copyright (C) 2020 Nordix Foundation. All rights reserved.
+#  ========================================================================
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+#  ============LICENSE_END=================================================
+#
+
+# This is a script that contains container/service management functions and test functions for Consul/CBS
+
+CONSUL_PATH="http://$LOCALHOST:$CONSUL_EXTERNAL_PORT"
+
+####################
+### Consul functions
+####################
+
+# Function to load config from a file into consul for the Policy Agent
+# arg: <json-config-file>
+# (Function for test scripts)
+consul_config_app() {
+
+       echo -e $BOLD"Configuring Consul"$EBOLD
+
+       if [ $# -ne 1 ]; then
+               ((RES_CONF_FAIL++))
+       __print_err "need one arg,  <json-config-file>" $@
+               exit 1
+       fi
+
+       echo " Loading config for "$POLICY_AGENT_APP_NAME" from "$1
+
+       curlString="$LOCALHOST_HTTP:${CONSUL_EXTERNAL_PORT}/v1/kv/${POLICY_AGENT_CONFIG_KEY}?dc=dc1 -X PUT -H Accept:application/json -H Content-Type:application/json -H X-Requested-With:XMLHttpRequest --data-binary @"$1
+       result=$(__do_curl "$curlString")
+       if [ $? -ne 0 ]; then
+               echo -e $RED" FAIL - json config could not be loaded to consul" $ERED
+               ((RES_CONF_FAIL++))
+               return 1
+       fi
+       body="$(__do_curl $LOCALHOST_HTTP:$CBS_EXTERNAL_PORT/service_component_all/$POLICY_AGENT_CONFIG_KEY)"
+       echo $body > "./tmp/.output"$1
+
+       if [ $? -ne 0 ]; then
+               echo -e $RED" FAIL - json config could not be loaded from consul/cbs, contents cannot be checked." $ERED
+               ((RES_CONF_FAIL++))
+               return 1
+       else
+               targetJson=$(< $1)
+               targetJson="{\"config\":"$targetJson"}"
+               echo "TARGET JSON: $targetJson" >> $HTTPLOG
+               res=$(python3 ../common/compare_json.py "$targetJson" "$body")
+               if [ $res -ne 0 ]; then
+                       echo -e $RED" FAIL - policy json config read from consul/cbs is not equal to the intended json config...." $ERED
+                       ((RES_CONF_FAIL++))
+                       return 1
+               else
+                       echo -e $GREEN" Config loaded ok to consul"$EGREEN
+               fi
+       fi
+
+       echo ""
+
+}
+
+# Function to perpare the consul configuration according to the current simulator configuration
+# args: SDNC|NOSDNC <output-file>
+# (Function for test scripts)
+prepare_consul_config() {
+       echo -e $BOLD"Prepare Consul config"$EBOLD
+
+       echo " Writing consul config for "$POLICY_AGENT_APP_NAME" to file: "$2
+
+       if [ $# != 2 ];  then
+               ((RES_CONF_FAIL++))
+       __print_err "need two args,  SDNC|NOSDNC <output-file>" $@
+               exit 1
+       fi
+
+       if [ $1 == "SDNC" ]; then
+               echo -e " Config$BOLD including SDNC$EBOLD configuration"
+       elif [ $1 == "NOSDNC" ];  then
+               echo -e " Config$BOLD excluding SDNC$EBOLD configuration"
+       else
+               ((RES_CONF_FAIL++))
+       __print_err "need two args,  SDNC|NOSDNC <output-file>" $@
+               exit 1
+       fi
+
+       config_json="\n            {"
+       if [ $1 == "SDNC" ]; then
+               config_json=$config_json"\n   \"controller\": ["
+               config_json=$config_json"\n                     {"
+               config_json=$config_json"\n                       \"name\": \"$SDNC_APP_NAME\","
+               config_json=$config_json"\n                       \"baseUrl\": \"$SDNC_SERVICE_PATH\","
+               config_json=$config_json"\n                       \"userName\": \"$SDNC_USER\","
+               config_json=$config_json"\n                       \"password\": \"$SDNC_PWD\""
+               config_json=$config_json"\n                     }"
+               config_json=$config_json"\n   ],"
+       fi
+
+       config_json=$config_json"\n   \"streams_publishes\": {"
+       config_json=$config_json"\n                            \"dmaap_publisher\": {"
+       config_json=$config_json"\n                              \"type\": \"message-router\","
+       config_json=$config_json"\n                              \"dmaap_info\": {"
+       config_json=$config_json"\n                                \"topic_url\": \"$MR_SERVICE_PATH$MR_WRITE_URL\""
+       config_json=$config_json"\n                              }"
+       config_json=$config_json"\n                            }"
+       config_json=$config_json"\n   },"
+       config_json=$config_json"\n   \"streams_subscribes\": {"
+       config_json=$config_json"\n                             \"dmaap_subscriber\": {"
+       config_json=$config_json"\n                               \"type\": \"message-router\","
+       config_json=$config_json"\n                               \"dmaap_info\": {"
+       config_json=$config_json"\n                                   \"topic_url\": \"$MR_SERVICE_PATH$MR_READ_URL\""
+       config_json=$config_json"\n                                 }"
+       config_json=$config_json"\n                               }"
+       config_json=$config_json"\n   },"
+
+       config_json=$config_json"\n   \"ric\": ["
+
+       if [ $RUNMODE == "KUBE" ]; then
+               result=$(kubectl get pods -n $KUBE_NONRTRIC_NAMESPACE -o jsonpath='{.items[?(@.metadata.labels.autotest=="RICSIM")].metadata.name}')
+               rics=""
+               ric_cntr=0
+               if [ $? -eq 0 ] && [ ! -z "$result" ]; then
+                       for im in $result; do
+                               if [[ $im != *"-0" ]]; then
+                                       ric_subdomain=$(kubectl get pod $im -n $KUBE_NONRTRIC_NAMESPACE -o jsonpath='{.spec.subdomain}')
+                                       rics=$rics" "$im"."$ric_subdomain".nonrtric"
+                                       let ric_cntr=ric_cntr+1
+                               fi
+                       done
+               fi
+               if [ $ric_cntr -eq 0 ]; then
+                       echo $YELLOW"Warning: No rics found for the configuration"$EYELLOW
+               fi
+       else
+               rics=$(docker ps | grep $RIC_SIM_PREFIX | awk '{print $NF}')
+
+               if [ $? -ne 0 ] || [ -z "$rics" ]; then
+                       echo -e $RED" FAIL - the names of the running RIC Simulator cannot be retrieved." $ERED
+                       ((RES_CONF_FAIL++))
+                       return 1
+               fi
+       fi
+       cntr=0
+       for ric in $rics; do
+               if [ $cntr -gt 0 ]; then
+                       config_json=$config_json"\n          ,"
+               fi
+               config_json=$config_json"\n          {"
+               if [ $RUNMODE == "KUBE" ]; then
+                       ric_id=${ric%.*.*} #extract pod id from full hosthame
+                       ric_id=$(echo "$ric_id" | tr '-' '_')
+               else
+                       ric_id=$ric
+               fi
+               config_json=$config_json"\n            \"name\": \"$ric_id\","
+               config_json=$config_json"\n            \"baseUrl\": \"$RIC_SIM_HTTPX://$ric:$RIC_SIM_PORT\","
+               if [ $1 == "SDNC" ]; then
+                       config_json=$config_json"\n            \"controller\": \"$SDNC_APP_NAME\","
+               fi
+               config_json=$config_json"\n            \"managedElementIds\": ["
+               config_json=$config_json"\n              \"me1_$ric_id\","
+               config_json=$config_json"\n              \"me2_$ric_id\""
+               config_json=$config_json"\n            ]"
+               config_json=$config_json"\n          }"
+               let cntr=cntr+1
+       done
+
+       config_json=$config_json"\n           ]"
+       config_json=$config_json"\n}"
+
+       if [ $RUNMODE == "KUBE" ]; then
+               config_json="{\"config\":"$config_json"}"
+       fi
+
+       printf "$config_json">$2
+
+       echo ""
+}
+
+# Start Consul and CBS
+# args: -
+# (Function for test scripts)
+start_consul_cbs() {
+
+       echo -e $BOLD"Starting $CONSUL_DISPLAY_NAME and $CBS_DISPLAY_NAME"$EBOLD
+       __check_included_image 'CONSUL'
+       if [ $? -eq 1 ]; then
+               echo -e $RED"The Consul image has not been checked for this test run due to arg to the test script"$ERED
+               echo -e $RED"Consul will not be started"$ERED
+               exit
+       fi
+       export CONSUL_APP_NAME
+       export CONSUL_INTERNAL_PORT
+       export CONSUL_EXTERNAL_PORT
+       export CBS_APP_NAME
+       export CBS_INTERNAL_PORT
+       export CBS_EXTERNAL_PORT
+       export CONSUL_HOST
+
+       __start_container $CONSUL_CBS_COMPOSE_DIR NODOCKERARGS 2 $CONSUL_APP_NAME $CBS_APP_NAME
+
+       __check_service_start $CONSUL_APP_NAME "http://"$LOCALHOST_NAME":"$CONSUL_EXTERNAL_PORT$CONSUL_ALIVE_URL
+       __check_service_start $CBS_APP_NAME "http://"$LOCALHOST_NAME":"$CBS_EXTERNAL_PORT$CBS_ALIVE_URL
+
+       echo ""
+}
+
diff --git a/test/common/control_panel_api_functions.sh b/test/common/control_panel_api_functions.sh
new file mode 100644 (file)
index 0000000..9f179a1
--- /dev/null
@@ -0,0 +1,172 @@
+#!/bin/bash
+
+#  ============LICENSE_START===============================================
+#  Copyright (C) 2020 Nordix Foundation. All rights reserved.
+#  ========================================================================
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+#  ============LICENSE_END=================================================
+#
+
+# This is a script that contains container/service management function
+# and test functions for Control Panel
+
+## Access to control panel
+# Host name may be changed if app started by kube
+# Direct access from script
+CP_HTTPX="http"
+CP_HOST_NAME=$LOCALHOST_NAME
+CP_PATH=$CP_HTTPX"://"$CP_HOST_NAME":"$CONTROL_PANEL_EXTERNAL_PORT
+
+###########################
+### Control Panel functions
+###########################
+
+# Set http as the protocol to use for all communication to the Control Panel
+# args: -
+# (Function for test scripts)
+use_control_panel_http() {
+       echo -e $BOLD"Control Panel, CP, protocol setting"$EBOLD
+       echo -e " Using $BOLD http $EBOLD towards CP"
+       CP_HTTPX="http"
+       CP_PATH=$CP_HTTPX"://"$CP_HOST_NAME":"$CONTROL_PANEL_EXTERNAL_PORT
+       echo ""
+}
+
+# Set https as the protocol to use for all communication to the Control Panel
+# args: -
+# (Function for test scripts)
+use_control_panel_https() {
+       echo -e $BOLD"Control Panel, CP, protocol setting"$EBOLD
+       echo -e " Using $BOLD https $EBOLD towards CP"
+       CP_HTTPX="https"
+       CP_PATH=$CP_HTTPX"://"$CP_HOST_NAME":"$CONTROL_PANEL_EXTERNAL_SECURE_PORT
+       echo ""
+}
+
+# Start the Control Panel container
+# args: -
+# (Function for test scripts)
+start_control_panel() {
+
+       echo -e $BOLD"Starting $CONTROL_PANEL_DISPLAY_NAME"$EBOLD
+
+       if [ $RUNMODE == "KUBE" ]; then
+
+               # Check if app shall be fully managed by the test script
+               __check_included_image "CP"
+               retcode_i=$?
+
+               # Check if app shall only be used by the testscipt
+               __check_prestarted_image "CP"
+               retcode_p=$?
+
+               if [ $retcode_i -ne 0 ] && [ $retcode_p -ne 0 ]; then
+                       echo -e $RED"The $CONTROL_PANEL_APP_NAME app is not included as managed nor prestarted in this test script"$ERED
+                       echo -e $RED"The $CONTROL_PANEL_APP_NAME will not be started"$ERED
+                       exit
+               fi
+               if [ $retcode_i -eq 0 ] && [ $retcode_p -eq 0 ]; then
+                       echo -e $RED"The $CONTROL_PANEL_APP_NAME app is included both as managed and prestarted in this test script"$ERED
+                       echo -e $RED"The $CONTROL_PANEL_APP_NAME will not be started"$ERED
+                       exit
+               fi
+
+               # Check if app shall be used - not managed - by the test script
+               __check_prestarted_image "CP"
+               if [ $? -eq 0 ]; then
+                       echo -e " Using existing $CONTROL_PANEL_APP_NAME deployment and service"
+                       echo " Setting CP replicas=1"
+                       __kube_scale deployment $CONTROL_PANEL_APP_NAME $KUBE_NONRTRIC_NAMESPACE 1
+               fi
+
+               if [ $retcode_i -eq 0 ]; then
+
+                       echo -e " Creating $CP_APP_NAME app and expose service"
+
+                       #Export all vars needed for service and deployment
+                       export CONTROL_PANEL_APP_NAME
+                       export KUBE_NONRTRIC_NAMESPACE
+                       export CONTROL_PANEL_IMAGE
+                       export CONTROL_PANEL_INTERNAL_PORT
+                       export CONTROL_PANEL_INTERNAL_SECURE_PORT
+                       export CONTROL_PANEL_EXTERNAL_PORT
+                       export CONTROL_PANEL_EXTERNAL_SECURE_PORT
+                       export CONTROL_PANEL_CONFIG_MOUNT_PATH
+                       export CONTROL_PANEL_CONFIG_FILE
+                       export CP_CONFIG_CONFIGMAP_NAME=$CONTROL_PANEL_APP_NAME"-config"
+
+                       export POLICY_AGENT_EXTERNAL_SECURE_PORT
+                       export ECS_EXTERNAL_SECURE_PORT
+                       export POLICY_AGENT_DOMAIN_NAME=$POLICY_AGENT_APP_NAME.$KUBE_NONRTRIC_NAMESPACE
+                       export ECS_DOMAIN_NAME=$ECS_APP_NAME.$KUBE_NONRTRIC_NAMESPACE
+
+                       #Check if nonrtric namespace exists, if not create it
+                       __kube_create_namespace $KUBE_NONRTRIC_NAMESPACE
+
+                       # Create config map for config
+                       datafile=$PWD/tmp/$CONTROL_PANEL_CONFIG_FILE
+                       #Add config to properties file
+                       envsubst < $1 > $datafile
+                       output_yaml=$PWD/tmp/cp_cfc.yaml
+                       __kube_create_configmap $CP_CONFIG_CONFIGMAP_NAME $KUBE_NONRTRIC_NAMESPACE autotest CP $datafile $output_yaml
+
+                       # Create service
+                       input_yaml=$SIM_GROUP"/"$CONTROL_PANEL_COMPOSE_DIR"/"svc.yaml
+                       output_yaml=$PWD/tmp/cp_svc.yaml
+                       __kube_create_instance service $CONTROL_PANEL_APP_NAME $input_yaml $output_yaml
+
+                       # Create app
+                       input_yaml=$SIM_GROUP"/"$CONTROL_PANEL_COMPOSE_DIR"/"app.yaml
+                       output_yaml=$PWD/tmp/cp_app.yaml
+                       __kube_create_instance app $CONTROL_PANEL_APP_NAME $input_yaml $output_yaml
+
+               fi
+
+               echo " Retrieving host and ports for service..."
+               CP_HOST_NAME=$(__kube_get_service_host $CONTROL_PANEL_APP_NAME $KUBE_NONRTRIC_NAMESPACE)
+
+               CONTROL_PANEL_EXTERNAL_PORT=$(__kube_get_service_port $CONTROL_PANEL_APP_NAME $KUBE_NONRTRIC_NAMESPACE "http")
+               CONTROL_PANEL_EXTERNAL_SECURE_PORT=$(__kube_get_service_port $CONTROL_PANEL_APP_NAME $KUBE_NONRTRIC_NAMESPACE "https")
+
+               echo " Host IP, http port, https port: $CP_HOST_NAME $CONTROL_PANEL_EXTERNAL_PORT $CONTROL_PANEL_EXTERNAL_SECURE_PORT"
+               if [ $CP_HTTPX == "http" ]; then
+                       CP_PATH=$CP_HTTPX"://"$CP_HOST_NAME":"$CONTROL_PANEL_EXTERNAL_PORT
+               else
+                       CP_PATH=$CP_HTTPX"://"$CP_HOST_NAME":"$CONTROL_PANEL_EXTERNAL_SECURE_PORT
+               fi
+
+               __check_service_start $CONTROL_PANEL_APP_NAME $CP_PATH$CONTROL_PANEL_ALIVE_URL
+       else
+               # Check if docker app shall be fully managed by the test script
+               __check_included_image 'CP'
+               if [ $? -eq 1 ]; then
+                       echo -e $RED"The Control Panel app is not included in this test script"$ERED
+                       echo -e $RED"The Control Panel will not be started"$ERED
+                       exit
+               fi
+
+               # Export needed vars for docker compose
+        export CONTROL_PANEL_APP_NAME
+        export CONTROL_PANEL_INTERNAL_PORT
+        export CONTROL_PANEL_EXTERNAL_PORT
+        export CONTROL_PANEL_INTERNAL_SECURE_PORT
+        export CONTROL_PANEL_EXTERNAL_SECURE_PORT
+        export DOCKER_SIM_NWNAME
+
+               __start_container $CONTROL_PANEL_COMPOSE_DIR NODOCKERARGS 1 $CONTROL_PANEL_APP_NAME
+
+               __check_service_start $CONTROL_PANEL_APP_NAME $CP_PATH$CONTROL_PANEL_ALIVE_URL
+       fi
+       echo ""
+}
+
index 4d568d7..9e60175 100644 (file)
 #  ============LICENSE_END=================================================
 #
 
-# This is a script that contains specific test functions for A1 Controller API
+# This is a script that contains container/service management functions and test functions for A1 Controller API
+
+SDNC_HTTPX="http"
+SDNC_HOST_NAME=$LOCALHOST_NAME
+SDNC_PATH=$SDNC_HTTPX"://"$SDNC_HOST_NAME":"$SDNC_EXTERNAL_PORT
+SDNC_API_PATH=$SDNC_HTTPX"://"$SDNC_USER":"$SDNC_PWD"@"$SDNC_HOST_NAME":"$SDNC_EXTERNAL_PORT$SDNC_API_URL
+#Docker/Kube internal path
+if [ $RUNMODE == "KUBE" ]; then
+       SDNC_SERVICE_PATH=$SDNC_HTTPX"://"$SDNC_APP_NAME":"$SDNC_EXTERNAL_PORT
+    #presume correct
+       SDNC_SERVICE_PATH=$SDNC_HTTPX"://"$SDNC_APP_NAME"."$KUBE_NONRTRIC_NAMESPACE":"$SDNC_EXTERNAL_PORT
+       #test
+       #SDNC_SERVICE_PATH=$SDNC_HTTPX"://"$SDNC_APP_NAME"."$KUBE_NONRTRIC_NAMESPACE":"$SDNC_EXTERNAL_PORT
+else
+       SDNC_SERVICE_PATH=$SDNC_HTTPX"://"$SDNC_APP_NAME":"$SDNC_INTERNAL_PORT
+fi
+
+use_sdnc_http() {
+       echo -e $BOLD"SDNC NB protocol setting"$EBOLD
+       echo -e " Using $BOLD http $EBOLD towards SDNC"
+       SDNC_HTTPX="http"
+       SDNC_PATH=$SDNC_HTTPX"://"$SDNC_HOST_NAME":"$SDNC_EXTERNAL_PORT
+       SDNC_API_PATH=$SDNC_HTTPX"://"$SDNC_USER":"$SDNC_PWD"@"$SDNC_HOST_NAME":"$SDNC_EXTERNAL_PORT$SDNC_API_URL
+       if [ $RUNMODE == "KUBE" ]; then
+               #presume correct
+               SDNC_SERVICE_PATH=$SDNC_HTTPX"://"$SDNC_APP_NAME"."$KUBE_NONRTRIC_NAMESPACE":"$SDNC_EXTERNAL_PORT
+               #test
+               #SDNC_SERVICE_PATH=$SDNC_HTTPX"://"$SDNC_APP_NAME":"$SDNC_EXTERNAL_PORT
+       else
+               SDNC_SERVICE_PATH=$SDNC_HTTPX"://"$SDNC_APP_NAME":"$SDNC_INTERNAL_PORT
+       fi
+       echo ""
+}
+
+use_sdnc_https() {
+       echo -e $BOLD"SDNC NB protocol setting"$EBOLD
+       echo -e " Using $BOLD https $EBOLD towards SDNC"
+       SDNC_HTTPX="https"
+       SDNC_PATH=$SDNC_HTTPX"://"$SDNC_HOST_NAME":"$SDNC_EXTERNAL_SECURE_PORT
+       SDNC_API_PATH=$SDNC_HTTPX"://"$SDNC_USER":"$SDNC_PWD"@"$SDNC_HOST_NAME":"$SDNC_EXTERNAL_SECURE_PORT$SDNC_API_URL
+       if [ $RUNMODE == "KUBE" ]; then
+               #presume correct
+               SDNC_SERVICE_PATH=$SDNC_HTTPX"://"$SDNC_APP_NAME"."$KUBE_NONRTRIC_NAMESPACE":"$SDNC_EXTERNAL_SECURE_PORT
+               #test
+               #SDNC_SERVICE_PATH=$SDNC_HTTPX"://"$SDNC_APP_NAME":"$SDNC_EXTERNAL_SECURE_PORT
+       else
+               SDNC_SERVICE_PATH=$SDNC_HTTPX"://"$SDNC_APP_NAME":"$SDNC_INTERNAL_SECURE_PORT
+       fi
+       echo ""
+}
+
+##################
+### SDNC functions
+##################
+
+# Start the SDNC A1 Controller
+# args: -
+# (Function for test scripts)
+start_sdnc() {
+
+       echo -e $BOLD"Starting $SDNC_DISPLAY_NAME"$EBOLD
+
+       if [ $RUNMODE == "KUBE" ]; then
+
+               # Check if app shall be fully managed by the test script
+               __check_included_image "SDNC"
+               retcode_i=$?
+
+               # Check if app shall only be used by the testscipt
+               __check_prestarted_image "SDNC"
+               retcode_p=$?
+
+               if [ $retcode_i -ne 0 ] && [ $retcode_p -ne 0 ]; then
+                       echo -e $RED"The $SDNC_APP_NAME app is not included as managed nor prestarted in this test script"$ERED
+                       echo -e $RED"The $SDNC_APP_NAME will not be started"$ERED
+                       exit
+               fi
+               if [ $retcode_i -eq 0 ] && [ $retcode_p -eq 0 ]; then
+                       echo -e $RED"The $SDNC_APP_NAME app is included both as managed and prestarted in this test script"$ERED
+                       echo -e $RED"The $SDNC_APP_NAME will not be started"$ERED
+                       exit
+               fi
+
+
+               if [ $retcode_p -eq 0 ]; then
+                       echo -e " Using existing $SDNC_APP_NAME deployment and service"
+                       echo " Setting SDNC replicas=1"
+                       __kube_scale deployment $SDNC_APP_NAME $KUBE_NONRTRIC_NAMESPACE 1
+               fi
+
+                               # Check if app shall be fully managed by the test script
+               if [ $retcode_i -eq 0 ]; then
+
+                       echo -e " Creating $SDNC_APP_NAME app and expose service"
+
+                       #Check if nonrtric namespace exists, if not create it
+                       __kube_create_namespace $KUBE_NONRTRIC_NAMESPACE
+
+                       export KUBE_NONRTRIC_NAMESPACE
+                       export SDNC_APP_NAME
+                       export SDNC_A1_CONTROLLER_IMAGE
+                       export SDNC_INTERNAL_PORT
+                       export SDNC_EXTERNAL_PORT
+                       export SDNC_INTERNAL_SECURE_PORT
+                       export SDNC_EXTERNAL_SECURE_PORT
+                       export SDNC_A1_TRUSTSTORE_PASSWORD
+                       export SDNC_DB_APP_NAME
+                       export SDNC_DB_IMAGE
+
+                       # Create service
+                       input_yaml=$SIM_GROUP"/"$SDNC_COMPOSE_DIR"/"svc.yaml
+                       output_yaml=$PWD/tmp/sdnc_svc.yaml
+                       __kube_create_instance service $SDNC_APP_NAME $input_yaml $output_yaml
+
+                       # Create app
+                       input_yaml=$SIM_GROUP"/"$SDNC_COMPOSE_DIR"/"app.yaml
+                       output_yaml=$PWD/tmp/sdnc_app.yaml
+                       __kube_create_instance app $SDNC_APP_NAME $input_yaml $output_yaml
+
+               fi
+
+        echo " Retrieving host and ports for service..."
+               SDNC_HOST_NAME=$(__kube_get_service_host $SDNC_APP_NAME $KUBE_NONRTRIC_NAMESPACE)
+               SDNC_EXTERNAL_PORT=$(__kube_get_service_port $SDNC_APP_NAME $KUBE_NONRTRIC_NAMESPACE "http")
+               SDNC_EXTERNAL_SECURE_PORT=$(__kube_get_service_port $SDNC_APP_NAME $KUBE_NONRTRIC_NAMESPACE "https")
+
+               echo " Host IP, http port, https port: $SDNC_HOST_NAME $SDNC_EXTERNAL_PORT $SDNC_EXTERNAL_SECURE_PORT"
+
+        if [ $SDNC_HTTPX == "http" ]; then
+                       SDNC_PATH=$SDNC_HTTPX"://"$SDNC_HOST_NAME":"$SDNC_EXTERNAL_PORT
+                       SDNC_API_PATH=$SDNC_HTTPX"://"$SDNC_USER":"$SDNC_PWD"@"$SDNC_HOST_NAME":"$SDNC_EXTERNAL_PORT$SDNC_API_URL
+            #presume correct
+                       SDNC_SERVICE_PATH=$SDNC_HTTPX"://"$SDNC_APP_NAME"."$KUBE_NONRTRIC_NAMESPACE":"$SDNC_EXTERNAL_PORT
+                       #test
+                       #SDNC_SERVICE_PATH=$SDNC_HTTPX"://"$SDNC_APP_NAME":"$SDNC_EXTERNAL_PORT
+               else
+                       SDNC_PATH=$SDNC_HTTPX"://"$SDNC_HOST_NAME":"$SDNC_EXTERNAL_SECURE_PORT
+                       SDNC_API_PATH=$SDNC_HTTPX"://"$SDNC_USER":"$SDNC_PWD"@"$SDNC_HOST_NAME":"$SDNC_EXTERNAL_SECURE_PORT$SDNC_API_URL
+            #presume correct
+                       SDNC_SERVICE_PATH=$SDNC_HTTPX"://"$SDNC_APP_NAME"."$KUBE_NONRTRIC_NAMESPACE":"$SDNC_EXTERNAL_SECURE_PORT
+                       #test
+                       #SDNC_SERVICE_PATH=$SDNC_HTTPX"://"$SDNC_APP_NAME":"$SDNC_EXTERNAL_SECURE_PORT
+               fi
+
+               __check_service_start $SDNC_APP_NAME $SDNC_PATH$SDNC_ALIVE_URL
+       else
+
+               __check_included_image 'SDNC'
+               if [ $? -eq 1 ]; then
+                       echo -e $RED"The SDNC A1 Controller app is not included in this test script"$ERED
+                       echo -e $RED"The Policy Agent will not be started"$ERED
+                       exit
+               fi
+
+               export SDNC_DB_APP_NAME
+        export SDNC_APP_NAME
+        export SDNC_INTERNAL_PORT
+        export SDNC_EXTERNAL_PORT
+        export SDNC_INTERNAL_SECURE_PORT
+        export SDNC_EXTERNAL_SECURE_PORT
+        export SDNC_A1_TRUSTSTORE_PASSWORD
+        export DOCKER_SIM_NWNAME
+
+               __start_container $SDNC_COMPOSE_DIR NODOCKERARGS 1 $SDNC_APP_NAME
+
+               __check_service_start $SDNC_APP_NAME $SDNC_PATH$SDNC_ALIVE_URL
+       fi
+    echo ""
+    return 0
+}
+
+
 
 # Generic function to query the RICs via the A1-controller API.
 # args: <operation> <url> [<body>]
@@ -44,7 +215,7 @@ __do_curl_to_controller() {
        payload="./tmp/.sdnc.payload.json"
     echo "$json" > $payload
     echo "  FILE ($payload) : $json"  >> $HTTPLOG
-    curlString="curl -skw %{http_code} -X POST $SDNC_HTTPX://$SDNC_USER:$SDNC_PWD@localhost:$SDNC_LOCAL_PORT$SDNC_API_URL$1 -H accept:application/json -H Content-Type:application/json --data-binary @$payload"
+    curlString="curl -skw %{http_code} -X POST $SDNC_API_PATH$1 -H accept:application/json -H Content-Type:application/json --data-binary @$payload"
     echo "  CMD: "$curlString >> $HTTPLOG
     res=$($curlString)
     retcode=$?
@@ -77,12 +248,16 @@ __do_curl_to_controller() {
 controller_api_get_A1_policy_ids() {
        __log_test_start $@
 
+       ric_id=$3
+       if [ $RUNMODE == "KUBE" ]; then
+               ric_id=$(get_kube_sim_host $3)
+       fi
     paramError=1
     if [ $# -gt 3 ] && [ $2 == "OSC" ]; then
-        url="$RIC_SIM_HTTPX://$3:$RIC_SIM_PORT/a1-p/policytypes/$4/policies"
+        url="$RIC_SIM_HTTPX://$ric_id:$RIC_SIM_PORT/a1-p/policytypes/$4/policies"
                paramError=0
     elif [ $# -gt 2 ] && [ $2 == "STD" ]; then
-        url="$RIC_SIM_HTTPX://$3:$RIC_SIM_PORT/A1-P/v1/policies"
+        url="$RIC_SIM_HTTPX://$ric_id:$RIC_SIM_PORT/A1-P/v1/policies"
         paramError=0
        fi
 
@@ -139,9 +314,13 @@ controller_api_get_A1_policy_ids() {
 controller_api_get_A1_policy_type() {
        __log_test_start $@
 
+       ric_id=$3
+       if [ $RUNMODE == "KUBE" ]; then
+               ric_id=$(get_kube_sim_host $3)
+       fi
     paramError=1
     if [ $# -gt 3 ] && [ $2 == "OSC" ]; then
-        url="$RIC_SIM_HTTPX://$3:$RIC_SIM_PORT/a1-p/policytypes/$4"
+        url="$RIC_SIM_HTTPX://$ric_id:$RIC_SIM_PORT/a1-p/policytypes/$4"
                paramError=0
        fi
 
@@ -189,12 +368,16 @@ controller_api_get_A1_policy_type() {
 controller_api_delete_A1_policy() {
        __log_test_start $@
 
+       ric_id=$3
+       if [ $RUNMODE == "KUBE" ]; then
+               ric_id=$(get_kube_sim_host $3)
+       fi
     paramError=1
     if [ $# -eq 5 ] && [ $2 == "OSC" ]; then
-        url="$RIC_SIM_HTTPX://$3:$RIC_SIM_PORT/a1-p/policytypes/$4/policies/$UUID$5"
+        url="$RIC_SIM_HTTPX://$ric_id:$RIC_SIM_PORT/a1-p/policytypes/$4/policies/$UUID$5"
                paramError=0
     elif [ $# -eq 4 ] && [ $2 == "STD" ]; then
-        url="$RIC_SIM_HTTPX://$3:$RIC_SIM_PORT/A1-P/v1/policies/$UUID$4"
+        url="$RIC_SIM_HTTPX://$ric_id:$RIC_SIM_PORT/A1-P/v1/policies/$UUID$4"
         paramError=0
        fi
 
@@ -227,14 +410,18 @@ controller_api_delete_A1_policy() {
 controller_api_put_A1_policy() {
        __log_test_start $@
 
+       ric_id=$3
+       if [ $RUNMODE == "KUBE" ]; then
+               ric_id=$(get_kube_sim_host $3)
+       fi
     paramError=1
     if [ $# -eq 6 ] && [ $2 == "OSC" ]; then
-        url="$RIC_SIM_HTTPX://$3:$RIC_SIM_PORT/a1-p/policytypes/$4/policies/$UUID$5"
+        url="$RIC_SIM_HTTPX://$ric_id:$RIC_SIM_PORT/a1-p/policytypes/$4/policies/$UUID$5"
         body=$(sed 's/XXX/'${5}'/g' $6)
 
                paramError=0
     elif [ $# -eq 5 ] && [ $2 == "STD" ]; then
-        url="$RIC_SIM_HTTPX://$3:$RIC_SIM_PORT/A1-P/v1/policies/$UUID$4"
+        url="$RIC_SIM_HTTPX://$ric_id:$RIC_SIM_PORT/A1-P/v1/policies/$UUID$4"
         body=$(sed 's/XXX/'${4}'/g' $5)
         paramError=0
        fi
@@ -269,10 +456,14 @@ controller_api_put_A1_policy() {
 controller_api_get_A1_policy_status() {
        __log_test_start $@
 
+       ric_id=$3
+       if [ $RUNMODE == "KUBE" ]; then
+               ric_id=$(get_kube_sim_host $3)
+       fi
     targetJson=""
     paramError=1
     if [ $# -ge 5 ] && [ $2 == "OSC" ]; then
-        url="$RIC_SIM_HTTPX://$3:$RIC_SIM_PORT/a1-p/policytypes/$4/policies/$UUID$5/status"
+        url="$RIC_SIM_HTTPX://$ric_id:$RIC_SIM_PORT/a1-p/policytypes/$4/policies/$UUID$5/status"
         if [ $# -gt 5 ]; then
             targetJson="{\"instance_status\":\"$6\""
             targetJson=$targetJson",\"has_been_deleted\":\"$7\""
@@ -280,7 +471,7 @@ controller_api_get_A1_policy_status() {
         fi
                paramError=0
     elif [ $# -ge 4 ] && [ $2 == "STD" ]; then
-        url="$RIC_SIM_HTTPX://$3:$RIC_SIM_PORT/A1-P/v1/policies/$UUID$4/status"
+        url="$RIC_SIM_HTTPX://$ric_id:$RIC_SIM_PORT/A1-P/v1/policies/$UUID$4/status"
         if [ $# -gt 4 ]; then
             targetJson="{\"enforceStatus\":\"$5\""
             if [ $# -eq 6 ]; then
index e2b9491..bf490fc 100644 (file)
 #  ============LICENSE_END=================================================
 #
 
-. ../common/api_curl.sh
-
-### Admin API functions for the Callback Reciver
-
-
-# Excute a curl cmd towards a Callback Reciver admin interface and check the response code.
-# args: <expected-response-code> <curl-cmd-string>
-__execute_curl_to_cr() {
-       echo ${FUNCNAME[1]} "line: "${BASH_LINENO[1]} >> $HTTPLOG
-       echo " CMD: $2" >> $HTTPLOG
-       res="$($2)"
-       echo " RESP: $res" >> $HTTPLOG
-       retcode=$?
-    if [ $retcode -ne 0 ]; then
-               ((RES_CONF_FAIL++))
-               echo " RETCODE: "$retcode
-        echo -e $RED" FAIL - fatal error when executing curl."$ERED
-        return 1
-    fi
-    status=${res:${#res}-3}
-    if [ $status -eq $1 ]; then
-        echo -e $GREEN" OK"$EGREEN
-        return 0
-    fi
-    echo -e $RED" FAIL - expected http response: "$1" but got http response: "$status $ERED
-       ((RES_CONF_FAIL++))
-    return 1
+# This is a script that contains container/service managemnt functions test functions for the Callback Reciver
+
+## Access to Callback Receiver
+# Host name may be changed if app started by kube
+# Direct access from script
+CR_HTTPX="http"
+CR_HOST_NAME=$LOCALHOST_NAME
+CR_PATH=$CR_HTTPX"://"$CR_HOST_NAME":"$CR_EXTERNAL_PORT
+#Docker/Kube internal path
+if [ $RUNMODE == "KUBE" ]; then
+       CR_SERVICE_PATH=$CR_HTTPX"://"$CR_APP_NAME"."$KUBE_SIM_NAMESPACE":"$CR_EXTERNAL_PORT$CR_APP_CALLBACK
+else
+       CR_SERVICE_PATH=$CR_HTTPX"://"$CR_APP_NAME":"$CR_INTERNAL_PORT$CR_APP_CALLBACK
+fi
+# CR_ADAPTER used for switching between REST and DMAAP (only REST supported currently)
+CR_ADAPTER_TYPE="REST"
+CR_ADAPTER=$CR_PATH
+
+################
+### CR functions
+################
+
+# Set http as the protocol to use for all communication to the Callback Receiver
+# args: -
+# (Function for test scripts)
+use_cr_http() {
+       echo -e $BOLD"CR protocol setting"$EBOLD
+       echo -e " Using $BOLD http $EBOLD towards CR"
+
+       CR_HTTPX="http"
+       CR_PATH=$CR_HTTPX"://"$CR_HOST_NAME":"$CR_EXTERNAL_PORT
+
+       #Docker/Kube internal path
+       if [ $RUNMODE == "KUBE" ]; then
+               CR_SERVICE_PATH=$CR_HTTPX"://"$CR_APP_NAME"."$KUBE_SIM_NAMESPACE":"$CR_EXTERNAL_PORT$CR_APP_CALLBACK
+       else
+               CR_SERVICE_PATH=$CR_HTTPX"://"$CR_APP_NAME":"$CR_INTERNAL_PORT$CR_APP_CALLBACK
+       fi
+       CR_ADAPTER_TYPE="REST"
+       CR_ADAPTER=$CR_PATH
+       echo ""
+}
+
+# Set https as the protocol to use for all communication to the Callback Receiver
+# args: -
+# (Function for test scripts)
+use_cr_https() {
+       echo -e $BOLD"CR protocol setting"$EBOLD
+       echo -e " Using $BOLD https $EBOLD towards CR"
+
+       CR_HTTPX="https"
+       CR_PATH=$CR_HTTPX"://"$CR_HOST_NAME":"$CR_EXTERNAL_SECURE_PORT
+
+       if [ $RUNMODE == "KUBE" ]; then
+               CR_SERVICE_PATH=$CR_HTTPX"://"$CR_APP_NAME"."$KUBE_SIM_NAMESPACE":"$CR_EXTERNAL_SECURE_PORT$CR_APP_CALLBACK
+       else
+               CR_SERVICE_PATH=$CR_HTTPX"://"$CR_APP_NAME":"$CR_INTERNAL_SECURE_PORT$CR_APP_CALLBACK
+       fi
+
+       CR_ADAPTER_TYPE="REST"
+       CR_ADAPTER=$CR_PATH
+       echo ""
+}
+
+# Start the Callback reciver in the simulator group
+# args: -
+# (Function for test scripts)
+start_cr() {
+
+       echo -e $BOLD"Starting $CR_DISPLAY_NAME"$EBOLD
+
+       if [ $RUNMODE == "KUBE" ]; then
+
+               # Check if app shall be fully managed by the test script
+               __check_included_image "CR"
+               retcode_i=$?
+
+               # Check if app shall only be used by the testscipt
+               __check_prestarted_image "CR"
+               retcode_p=$?
+
+               if [ $retcode_i -ne 0 ] && [ $retcode_p -ne 0 ]; then
+                       echo -e $RED"The $CR_APP_NAME app is not included as managed nor prestarted in this test script"$ERED
+                       echo -e $RED"The $CR_APP_NAME will not be started"$ERED
+                       exit
+               fi
+               if [ $retcode_i -eq 0 ] && [ $retcode_p -eq 0 ]; then
+                       echo -e $RED"The $CR_APP_NAME app is included both as managed and prestarted in this test script"$ERED
+                       echo -e $RED"The $CR_APP_NAME will not be started"$ERED
+                       exit
+               fi
+
+               # Check if app shall be used - not managed - by the test script
+               if [ $retcode_p -eq 0 ]; then
+                       echo -e " Using existing $CR_APP_NAME deployment and service"
+                       echo " Setting CR replicas=1"
+                       __kube_scale deployment $CR_APP_NAME $KUBE_SIM_NAMESPACE 1
+               fi
+
+               if [ $retcode_i -eq 0 ]; then
+                       echo -e " Creating $CR_APP_NAME deployment and service"
+                       export CR_APP_NAME
+                       export KUBE_SIM_NAMESPACE
+                       export CR_IMAGE
+                       export CR_INTERNAL_PORT
+                       export CR_INTERNAL_SECURE_PORT
+                       export CR_EXTERNAL_PORT
+                       export CR_EXTERNAL_SECURE_PORT
+
+                       __kube_create_namespace $KUBE_SIM_NAMESPACE
+
+                       # Create service
+                       input_yaml=$SIM_GROUP"/"$CR_COMPOSE_DIR"/"svc.yaml
+                       output_yaml=$PWD/tmp/cr_svc.yaml
+                       __kube_create_instance service $CR_APP_NAME $input_yaml $output_yaml
+
+                       # Create app
+                       input_yaml=$SIM_GROUP"/"$CR_COMPOSE_DIR"/"app.yaml
+                       output_yaml=$PWD/tmp/cr_app.yaml
+                       __kube_create_instance app $CR_APP_NAME $input_yaml $output_yaml
+
+               fi
+
+               echo " Retrieving host and ports for service..."
+               CR_HOST_NAME=$(__kube_get_service_host $CR_APP_NAME $KUBE_SIM_NAMESPACE)
+
+               CR_EXTERNAL_PORT=$(__kube_get_service_port $CR_APP_NAME $KUBE_SIM_NAMESPACE "http")
+               CR_EXTERNAL_SECURE_PORT=$(__kube_get_service_port $CR_APP_NAME $KUBE_SIM_NAMESPACE "https")
+
+               echo " Host IP, http port, https port: $CR_HOST_NAME $CR_EXTERNAL_PORT $CR_EXTERNAL_SECURE_PORT"
+               if [ $CR_HTTPX == "http" ]; then
+                       CR_PATH=$CR_HTTPX"://"$CR_HOST_NAME":"$CR_EXTERNAL_PORT
+                       CR_SERVICE_PATH=$CR_HTTPX"://"$CR_APP_NAME"."$KUBE_SIM_NAMESPACE":"$CR_EXTERNAL_PORT$CR_APP_CALLBACK
+               else
+                       CR_PATH=$CR_HTTPX"://"$CR_HOST_NAME":"$CR_EXTERNAL_SECURE_PORT
+                       CR_SERVICE_PATH=$CR_HTTPX"://"$CR_APP_NAME"."$KUBE_SIM_NAMESPACE":"$CR_EXTERNAL_SECURE_PORT$CR_APP_CALLBACK
+               fi
+               if [ $CR_ADAPTER_TYPE == "REST" ]; then
+                       CR_ADAPTER=$CR_PATH
+               fi
+
+               __check_service_start $CR_APP_NAME $CR_PATH$CR_ALIVE_URL
+
+               echo -ne " Service $CR_APP_NAME - reset  "$SAMELINE
+               result=$(__do_curl $CR_APP_NAME $CR_PATH/reset)
+               if [ $? -ne 0 ]; then
+                       echo -e " Service $CR_APP_NAME - reset  $RED Failed $ERED - will continue"
+               else
+                       echo -e " Service $CR_APP_NAME - reset  $GREEN OK $EGREEN"
+               fi
+       else
+               # Check if docker app shall be fully managed by the test script
+               __check_included_image 'CR'
+               if [ $? -eq 1 ]; then
+                       echo -e $RED"The Callback Receiver app is not included in this test script"$ERED
+                       echo -e $RED"The Callback Receiver will not be started"$ERED
+                       exit
+               fi
+
+               export CR_APP_NAME
+               export CR_INTERNAL_PORT
+               export CR_EXTERNAL_PORT
+               export CR_INTERNAL_SECURE_PORT
+               export CR_EXTERNAL_SECURE_PORT
+               export DOCKER_SIM_NWNAME
+
+               __start_container $CR_COMPOSE_DIR NODOCKERARGS 1 $CR_APP_NAME
+
+        __check_service_start $CR_APP_NAME $CR_PATH$CR_ALIVE_URL
+       fi
+       echo ""
 }
 
+
 # Tests if a variable value in the CR is equal to a target value and and optional timeout.
 # Arg: <variable-name> <target-value> - This test set pass or fail depending on if the variable is
 # equal to the target or not.
@@ -55,7 +200,7 @@ __execute_curl_to_cr() {
 # (Function for test scripts)
 cr_equal() {
        if [ $# -eq 2 ] || [ $# -eq 3 ]; then
-               __var_test "CR" "$LOCALHOST$CR_EXTERNAL_PORT/counter/" $1 "=" $2 $3
+               __var_test "CR" "$CR_PATH/counter/" $1 "=" $2 $3
        else
                __print_err "Wrong args to cr_equal, needs two or three args: <sim-param> <target-value> [ timeout ]" $@
        fi
index 6c43173..986f396 100644 (file)
 #  ============LICENSE_END=================================================
 #
 
-# This is a script that contains specific test functions for ECS NB/SB API
+# This is a script that contains container/service management functions and test functions for ECS
+
+## Access to ECS
+# Host name may be changed if app started by kube
+# Direct access
+ECS_HTTPX="http"
+ECS_HOST_NAME=$LOCALHOST_NAME
+ECS_PATH=$ECS_HTTPX"://"$ECS_HOST_NAME":"$ECS_EXTERNAL_PORT
+
+# ECS_ADAPTER used for switch between REST and DMAAP (only REST supported currently)
+ECS_ADAPTER_TYPE="REST"
+ECS_ADAPTER=$ECS_PATH
+
+# Make curl retries towards ECS for http response codes set in this env var, space separated list of codes
+ECS_RETRY_CODES=""
+
+###########################
+### ECS functions
+###########################
+
+# All calls to ECS will be directed to the ECS REST interface from now on
+# args: -
+# (Function for test scripts)
+use_ecs_rest_http() {
+       echo -e $BOLD"ECS protocol setting"$EBOLD
+       echo -e " Using $BOLD http $EBOLD and $BOLD REST $EBOLD towards ECS"
+       ECS_HTTPX="http"
+       ECS_PATH=$ECS_HTTPX"://"$ECS_HOST_NAME":"$ECS_EXTERNAL_PORT
+
+       ECS_ADAPTER_TYPE="REST"
+       ECS_ADAPTER=$ECS_PATH
+       echo ""
+}
+
+# All calls to ECS will be directed to the ECS REST interface from now on
+# args: -
+# (Function for test scripts)
+use_ecs_rest_https() {
+       echo -e $BOLD"ECS protocol setting"$EBOLD
+       echo -e " Using $BOLD https $EBOLD and $BOLD REST $EBOLD towards ECS"
+       ECS_HTTPX="https"
+       ECS_PATH=$ECS_HTTPX"://"$ECS_HOST_NAME":"$ECS_EXTERNAL_SECURE_PORT
+
+       ECS_ADAPTER_TYPE="REST"
+       ECS_ADAPTER=$ECS_PATH
+       echo ""
+}
+
+# All calls to ECS will be directed to the ECS dmaap interface over http from now on
+# args: -
+# (Function for test scripts)
+use_ecs_dmaap_http() {
+       echo -e $BOLD"ECS dmaap protocol setting"$EBOLD
+       echo -e $RED" - NOT SUPPORTED - "$ERED
+       echo -e " Using $BOLD http $EBOLD and $BOLD DMAAP $EBOLD towards ECS"
+       ECS_ADAPTER_TYPE="MR-HTTP"
+       echo ""
+}
+
+# All calls to ECS will be directed to the ECS dmaap interface over https from now on
+# args: -
+# (Function for test scripts)
+use_ecs_dmaap_https() {
+       echo -e $BOLD"RICSIM protocol setting"$EBOLD
+       echo -e $RED" - NOT SUPPORTED - "$ERED
+       echo -e " Using $BOLD https $EBOLD and $BOLD REST $EBOLD towards ECS"
+       ECS_ADAPTER_TYPE="MR-HTTPS"
+       echo ""
+}
+
+# Start the ECS
+# args: -
+# (Function for test scripts)
+start_ecs() {
+
+       echo -e $BOLD"Starting $ECS_DISPLAY_NAME"$EBOLD
+
+       if [ $RUNMODE == "KUBE" ]; then
+
+               # Check if app shall be fully managed by the test script
+               __check_included_image "ECS"
+               retcode_i=$?
+
+               # Check if app shall only be used by the testscipt
+               __check_prestarted_image "ECS"
+               retcode_p=$?
+
+               if [ $retcode_i -ne 0 ] && [ $retcode_p -ne 0 ]; then
+                       echo -e $RED"The $ECS_APP_NAME app is not included as managed nor prestarted in this test script"$ERED
+                       echo -e $RED"The $ECS_APP_NAME will not be started"$ERED
+                       exit
+               fi
+               if [ $retcode_i -eq 0 ] && [ $retcode_p -eq 0 ]; then
+                       echo -e $RED"The $ECS_APP_NAME app is included both as managed and prestarted in this test script"$ERED
+                       echo -e $RED"The $ECS_APP_NAME will not be started"$ERED
+                       exit
+               fi
+
+
+               if [ $retcode_p -eq 0 ]; then
+                       echo -e " Using existing $ECS_APP_NAME deployment and service"
+                       echo " Setting ECS replicas=1"
+                       __kube_scale deployment $ECS_APP_NAME $KUBE_NONRTRIC_NAMESPACE 1
+               fi
+
+               # Check if app shall be fully managed by the test script
+               if [ $retcode_i -eq 0 ]; then
+                       echo -e " Creating $ECS_APP_NAME app and expose service"
+
+                       #Check if nonrtric namespace exists, if not create it
+                       __kube_create_namespace $KUBE_NONRTRIC_NAMESPACE
+
+                       export ECS_APP_NAME
+                       export KUBE_NONRTRIC_NAMESPACE
+                       export ECS_IMAGE
+                       export ECS_INTERNAL_PORT
+                       export ECS_INTERNAL_SECURE_PORT
+                       export ECS_EXTERNAL_PORT
+                       export ECS_EXTERNAL_SECURE_PORT
+                       export ECS_CONFIG_MOUNT_PATH
+                       export ECS_CONFIG_CONFIGMAP_NAME=$ECS_APP_NAME"-config"
+                       export ECS_DATA_CONFIGMAP_NAME=$ECS_APP_NAME"-data"
+                       export ECS_CONTAINER_MNT_DIR
+
+                       # Create config map for config
+                       datafile=$PWD/tmp/$ECS_CONFIG_FILE
+                       cp $1 $datafile
+                       output_yaml=$PWD/tmp/ecs_cfc.yaml
+                       __kube_create_configmap $ECS_CONFIG_CONFIGMAP_NAME $KUBE_NONRTRIC_NAMESPACE autotest ECS $datafile $output_yaml
+
+                       # Create pvc
+                       input_yaml=$SIM_GROUP"/"$ECS_COMPOSE_DIR"/"pvc.yaml
+                       output_yaml=$PWD/tmp/ecs_pvc.yaml
+                       __kube_create_instance pvc $ECS_APP_NAME $input_yaml $output_yaml
+
+                       # Create service
+                       input_yaml=$SIM_GROUP"/"$ECS_COMPOSE_DIR"/"svc.yaml
+                       output_yaml=$PWD/tmp/ecs_svc.yaml
+                       __kube_create_instance service $ECS_APP_NAME $input_yaml $output_yaml
+
+                       # Create app
+                       input_yaml=$SIM_GROUP"/"$ECS_COMPOSE_DIR"/"app.yaml
+                       output_yaml=$PWD/tmp/ecs_app.yaml
+                       __kube_create_instance app $ECS_APP_NAME $input_yaml $output_yaml
+               fi
+
+               echo " Retrieving host and ports for service..."
+               ECS_HOST_NAME=$(__kube_get_service_host $ECS_APP_NAME $KUBE_NONRTRIC_NAMESPACE)
+               ECS_EXTERNAL_PORT=$(__kube_get_service_port $ECS_APP_NAME $KUBE_NONRTRIC_NAMESPACE "http")
+               ECS_EXTERNAL_SECURE_PORT=$(__kube_get_service_port $ECS_APP_NAME $KUBE_NONRTRIC_NAMESPACE "https")
+
+               echo " Host IP, http port, https port: $ECS_HOST_NAME $ECS_EXTERNAL_PORT $ECS_EXTERNAL_SECURE_PORT"
+
+               if [ $ECS_HTTPX == "http" ]; then
+                       ECS_PATH=$ECS_HTTPX"://"$ECS_HOST_NAME":"$ECS_EXTERNAL_PORT
+               else
+                       ECS_PATH=$ECS_HTTPX"://"$ECS_HOST_NAME":"$ECS_EXTERNAL_SECURE_PORT
+               fi
+
+               __check_service_start $ECS_APP_NAME $ECS_PATH$ECS_ALIVE_URL
+
+               if [ $ECS_ADAPTER_TYPE == "REST" ]; then
+                       ECS_ADAPTER=$ECS_PATH
+               fi
+       else
+               __check_included_image 'ECS'
+               if [ $? -eq 1 ]; then
+                       echo -e $RED"The ECS app is not included in this test script"$ERED
+                       echo -e $RED"ECS will not be started"$ERED
+                       exit 1
+               fi
+
+               curdir=$PWD
+               cd $SIM_GROUP
+               cd ecs
+               cd $ECS_HOST_MNT_DIR
+               cd ..
+               if [ -d db ]; then
+                       if [ "$(ls -A $DIR)" ]; then
+                               echo -e $BOLD" Cleaning files in mounted dir: $PWD/db"$EBOLD
+                               rm -rf db/*  &> /dev/null
+                               if [ $? -ne 0 ]; then
+                                       echo -e $RED" Cannot remove database files in: $PWD"$ERED
+                                       exit 1
+                               fi
+                       fi
+               else
+                       echo " No files in mounted dir or dir does not exists"
+               fi
+               cd $curdir
+
+               export ECS_APP_NAME
+               export ECS_APP_NAME_ALIAS
+               export ECS_HOST_MNT_DIR
+               export ECS_CONTAINER_MNT_DIR
+               export ECS_INTERNAL_PORT
+               export ECS_EXTERNAL_PORT
+               export ECS_INTERNAL_SECURE_PORT
+               export ECS_EXTERNAL_SECURE_PORT
+               export DOCKER_SIM_NWNAME
+
+               __start_container $ECS_COMPOSE_DIR NODOCKERARGS 1 $ECS_APP_NAME
+
+               __check_service_start $ECS_APP_NAME $ECS_PATH$ECS_ALIVE_URL
+       fi
+       echo ""
+       return 0
+}
+
+# Restart ECS
+# args: -
+# (Function for test scripts)
+restart_ecs() {
+       echo -e $BOLD"Re-starting ECS"$EBOLD
+       docker restart $ECS_APP_NAME &> ./tmp/.dockererr
+       if [ $? -ne 0 ]; then
+               __print_err "Could not restart $ECS_APP_NAME" $@
+               cat ./tmp/.dockererr
+               ((RES_CONF_FAIL++))
+               return 1
+       fi
+
+       __check_service_start $ECS_APP_NAME $ECS_PATH$ECS_ALIVE_URL
+       echo ""
+       return 0
+}
+
+# Turn on debug level tracing in ECS
+# args: -
+# (Function for test scripts)
+set_ecs_debug() {
+       echo -e $BOLD"Setting ecs debug logging"$EBOLD
+       curlString="$ECS_PATH$ECS_ACTUATOR -X POST  -H Content-Type:application/json -d {\"configuredLevel\":\"debug\"}"
+       result=$(__do_curl "$curlString")
+       if [ $? -ne 0 ]; then
+               __print_err "Could not set debug mode" $@
+               ((RES_CONF_FAIL++))
+               return 1
+       fi
+       echo ""
+       return 0
+}
+
+# Turn on trace level tracing in ECS
+# args: -
+# (Function for test scripts)
+set_ecs_trace() {
+       echo -e $BOLD"Setting ecs trace logging"$EBOLD
+       curlString="$ECS_PATH/actuator/loggers/org.oransc.enrichment -X POST  -H Content-Type:application/json -d {\"configuredLevel\":\"trace\"}"
+       result=$(__do_curl "$curlString")
+       if [ $? -ne 0 ]; then
+               __print_err "Could not set trace mode" $@
+               ((RES_CONF_FAIL++))
+               return 1
+       fi
+       echo ""
+       return 0
+}
+
+# Perform curl retries when making direct call to ECS for the specified http response codes
+# Speace separated list of http response codes
+# args: [<response-code>]*
+use_agent_retries() {
+       echo -e $BOLD"Do curl retries to the ECS REST inteface for these response codes:$@"$EBOLD
+       ECS_AGENT_RETRY_CODES=$@
+       echo ""
+       return 0
+}
 
-. ../common/api_curl.sh
 
 # Tests if a variable value in the ECS is equal to a target value and and optional timeout.
 # Arg: <variable-name> <target-value> - This test set pass or fail depending on if the variable is
 # (Function for test scripts)
 ecs_equal() {
        if [ $# -eq 2 ] || [ $# -eq 3 ]; then
-               __var_test ECS "$LOCALHOST$ECS_EXTERNAL_PORT/" $1 "=" $2 $3
+               __var_test ECS "$ECS_PATH/" $1 "=" $2 $3
        else
                __print_err "Wrong args to ecs_equal, needs two or three args: <sim-param> <target-value> [ timeout ]" $@
        fi
@@ -891,6 +1157,58 @@ ecs_api_service_status() {
                __log_test_fail_status_code $1 $status
                return 1
        fi
+       __log_test_pass
+       return 0
+}
+
+
+##########################################
+####          Reset jobs              ####
+##########################################
+# Function prefix: ecs_api_admin
+
+# Admin to remove all jobs
+# args:
+# (Function for test scripts)
+
+ecs_api_admin_reset() {
+       __log_test_start $@
+
+       if [  -z "$FLAT_A1_EI" ]; then
+               query="/A1-EI/v1/eitypes/$2/eijobs"
+       else
+               query="/A1-EI/v1/eijobs"
+       fi
+    res="$(__do_curl_to_api ECS GET $query)"
+    status=${res:${#res}-3}
+
+       if [ $status -ne 200 ]; then
+               __log_test_fail_status_code $1 $status
+               return 1
+       fi
+
+       #Remove brackets and response code
+       body=${res:1:${#res}-4}
+       list=$(echo ${body//,/ })
+       list=$(echo ${list//[/})
+       list=$(echo ${list//]/})
+       list=$(echo ${list//\"/})
+       list=$list" "
+       for job in $list; do
+               if [  -z "$FLAT_A1_EI" ]; then
+                       echo "Not supported for non-flat EI api"
+               else
+                       query="/A1-EI/v1/eijobs/$job"
+                       res="$(__do_curl_to_api ECS DELETE $query)"
+                       status=${res:${#res}-3}
+                       if [ $status -ne 204 ]; then
+                               __log_test_fail_status_code $1 $status
+                               return 1
+                       fi
+                       echo " Deleted job: "$job
+               fi
+       done
+
        __log_test_pass
        return 0
 }
\ No newline at end of file
diff --git a/test/common/http_proxy_api_functions.sh b/test/common/http_proxy_api_functions.sh
new file mode 100644 (file)
index 0000000..68df929
--- /dev/null
@@ -0,0 +1,129 @@
+#!/bin/bash
+
+#  ============LICENSE_START===============================================
+#  Copyright (C) 2020 Nordix Foundation. All rights reserved.
+#  ========================================================================
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+#  ============LICENSE_END=================================================
+#
+
+# This is a script that contains container/service managemnt functions for Http Proxy
+
+## Access to Http Proxy Receiver
+# Host name may be changed if app started by kube
+# Direct access from script
+HTTP_PROXY_HTTPX="http"
+HTTP_PROXY_HOST_NAME=$LOCALHOST_NAME
+HTTP_PROXY_PATH=$HTTP_PROXY_HTTPX"://"$HTTP_PROXY_HOST_NAME":"$HTTP_PROXY_WEB_EXTERNAL_PORT
+
+#########################
+### Http Proxy functions
+#########################
+
+# Start the Http Proxy in the simulator group
+# args: -
+# (Function for test scripts)
+start_http_proxy() {
+
+       echo -e $BOLD"Starting $HTTP_PROXY_DISPLAY_NAME"$EBOLD
+
+       if [ $RUNMODE == "KUBE" ]; then
+
+               # Check if app shall be fully managed by the test script
+               __check_included_image "HTTPPROXY"
+               retcode_i=$?
+
+               # Check if app shall only be used by the testscipt
+               __check_prestarted_image "HTTPPROXY"
+               retcode_p=$?
+
+               if [ $retcode_i -ne 0 ] && [ $retcode_p -ne 0 ]; then
+                       echo -e $RED"The $HTTP_PROXY_APP_NAME app is not included as managed nor prestarted in this test script"$ERED
+                       echo -e $RED"The $HTTP_PROXY_APP_NAME will not be started"$ERED
+                       exit
+               fi
+               if [ $retcode_i -eq 0 ] && [ $retcode_p -eq 0 ]; then
+                       echo -e $RED"The $HTTP_PROXY_APP_NAME app is included both as managed and prestarted in this test script"$ERED
+                       echo -e $RED"The $HTTP_PROXY_APP_NAME will not be started"$ERED
+                       exit
+               fi
+
+               # Check if app shall be used - not managed - by the test script
+               if [ $retcode_p -eq 0 ]; then
+                       echo -e " Using existing $HTTP_PROXY_APP_NAME deployment and service"
+                       echo " Setting HTTPPROXY replicas=1"
+                       __kube_scale deployment $HTTP_PROXY_APP_NAME $KUBE_SIM_NAMESPACE 1
+               fi
+
+               if [ $retcode_i -eq 0 ]; then
+                       echo -e " Creating $HTTP_PROXY_APP_NAME deployment and service"
+                       export HTTP_PROXY_APP_NAME
+                       export HTTP_PROXY_WEB_EXTERNAL_PORT
+                       export HTTP_PROXY_WEB_INTERNAL_PORT
+                       export HTTP_PROXY_EXTERNAL_PORT
+                       export HTTP_PROXY_INTERNAL_PORT
+                       export KUBE_SIM_NAMESPACE
+                       export HTTP_PROXY_IMAGE
+
+                       __kube_create_namespace $KUBE_SIM_NAMESPACE
+
+                       # Create service
+                       input_yaml=$SIM_GROUP"/"$HTTP_PROXY_COMPOSE_DIR"/"svc.yaml
+                       output_yaml=$PWD/tmp/proxy_svc.yaml
+                       __kube_create_instance service $HTTP_PROXY_APP_NAME $input_yaml $output_yaml
+
+                       # Create app
+                       input_yaml=$SIM_GROUP"/"$HTTP_PROXY_COMPOSE_DIR"/"app.yaml
+                       output_yaml=$PWD/tmp/proxy_app.yaml
+                       __kube_create_instance app $HTTP_PROXY_APP_NAME $input_yaml $output_yaml
+
+               fi
+
+               echo " Retrieving host and ports for service..."
+               HTTP_PROXY_HOST_NAME=$(__kube_get_service_host $HTTP_PROXY_APP_NAME $KUBE_SIM_NAMESPACE)
+               HTTP_PROXY_WEB_EXTERNAL_PORT=$(__kube_get_service_port $HTTP_PROXY_APP_NAME $KUBE_SIM_NAMESPACE "web")
+               HTTP_PROXY_EXTERNAL_PORT=$(__kube_get_service_port $HTTP_PROXY_APP_NAME $KUBE_SIM_NAMESPACE "http")
+
+               HTTP_PROXY_PATH=$HTTP_PROXY_HTTPX"://"$HTTP_PROXY_HOST_NAME":"$HTTP_PROXY_WEB_EXTERNAL_PORT
+               HTTP_PROXY_CONFIG_PORT=$HTTP_PROXY_EXTERNAL_PORT
+               HTTP_PROXY_CONFIG_HOST_NAME=$HTTP_PROXY_APP_NAME"."$KUBE_SIM_NAMESPACE
+
+               echo " Host IP, http port: $HTTP_PROXY_HOST_NAME $HTTP_PROXY_WEB_EXTERNAL_PORT"
+
+               __check_service_start $HTTP_PROXY_APP_NAME $HTTP_PROXY_PATH$HTTP_PROXY_ALIVE_URL
+
+       else
+               # Check if docker app shall be fully managed by the test script
+               __check_included_image 'HTTPPROXY'
+               if [ $? -eq 1 ]; then
+                       echo -e $RED"The Http Proxy app is not included in this test script"$ERED
+                       echo -e $RED"The Http Proxy will not be started"$ERED
+                       exit
+               fi
+
+               export HTTP_PROXY_APP_NAME
+               export HTTP_PROXY_WEB_EXTERNAL_PORT
+               export HTTP_PROXY_WEB_INTERNAL_PORT
+               export DOCKER_SIM_NWNAME
+
+               __start_container $HTTP_PROXY_COMPOSE_DIR NODOCKERARGS 1 $HTTP_PROXY_APP_NAME
+
+        __check_service_start $HTTP_PROXY_APP_NAME $HTTP_PROXY_PATH$HTTP_PROXY_ALIVE_URL
+
+               HTTP_PROXY_CONFIG_PORT=$HTTP_PROXY_INTERNAL_PORT
+               HTTP_PROXY_CONFIG_HOST_NAME=$HTTP_PROXY_APP_NAME
+
+       fi
+       echo ""
+}
+
diff --git a/test/common/mr_api_functions.sh b/test/common/mr_api_functions.sh
new file mode 100644 (file)
index 0000000..54809b7
--- /dev/null
@@ -0,0 +1,511 @@
+#!/bin/bash
+
+#  ============LICENSE_START===============================================
+#  Copyright (C) 2020 Nordix Foundation. All rights reserved.
+#  ========================================================================
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+#  ============LICENSE_END=================================================
+#
+
+# This is a script that contains container/service management function
+# and test functions for Message Router - mr stub
+
+## Access to Message Router
+# Host name may be changed if app started by kube
+# Direct access from script
+MR_HTTPX="http"
+MR_STUB_HOST_NAME=$LOCALHOST_NAME
+MR_DMAAP_HOST_NAME=$LOCALHOST_NAME
+MR_STUB_PATH=$MR_HTTPX"://"$MR_STUB_HOST_NAME":"$MR_STUB_LOCALHOST_PORT
+MR_DMAAP_PATH=$MR_HTTPX"://"$MR_DMAAP_HOST_NAME":"$MR_DMAAP_LOCALHOST_PORT
+#Docker/Kube internal path
+if [ $RUNMODE == "KUBE" ]; then
+       MR_SERVICE_PATH=$MR_HTTPX"://"$MR_STUB_APP_NAME"."$KUBE_ONAP_NAMESPACE":"$MR_EXTERNAL_PORT
+       __check_included_image "DMAAPMR"
+       if [ $? -eq 0 ]; then
+               MR_SERVICE_PATH=$MR_HTTPX"://"$MR_DMAAP_APP_NAME"."$KUBE_ONAP_NAMESPACE":"$MR_EXTERNAL_PORT
+       fi
+       __check_prestarted_image "DMAAPMR"
+       if [ $? -eq 0 ]; then
+               MR_SERVICE_PATH=$MR_HTTPX"://"$MR_DMAAP_APP_NAME"."$KUBE_ONAP_NAMESPACE":"$MR_EXTERNAL_PORT
+       fi
+else
+       MR_SERVICE_PATH=$MR_HTTPX"://"$MR_STUB_APP_NAME":"$MR_INTERNAL_PORT
+       __check_included_image "DMAAPMR"
+       if [ $? -eq 0 ]; then
+               MR_SERVICE_PATH=$MR_HTTPX"://"$MR_DMAAP_APP_NAME":"$MR_INTERNAL_PORT
+       fi
+fi
+MR_ADAPTER_HTTP="http://"$MR_STUB_HOST_NAME":"$MR_STUB_LOCALHOST_PORT
+MR_ADAPTER_HTTPS="https://"$MR_STUB_HOST_NAME":"$MR_STUB_LOCALHOST_SECURE_PORT
+
+
+#####################
+### MR stub functions
+#####################
+
+use_mr_http() {
+       echo -e $BOLD"MR protocol setting"$EBOLD
+       echo -e " Using $BOLD http $EBOLD towards MR"
+       MR_HTTPX="http"
+       MR_STUB_PATH=$MR_HTTPX"://"$MR_STUB_HOST_NAME":"$MR_STUB_LOCALHOST_PORT
+       MR_DMAAP_PATH=$MR_HTTPX"://"$MR_DMAAP_HOST_NAME":"$MR_DMAAP_LOCALHOST_PORT
+       #Docker/Kube internal path
+       if [ $RUNMODE == "KUBE" ]; then
+               MR_SERVICE_PATH=$MR_HTTPX"://"$MR_STUB_APP_NAME"."$KUBE_ONAP_NAMESPACE":"$MR_EXTERNAL_PORT
+               __check_included_image "DMAAPMR"
+               if [ $? -eq 0 ]; then
+                       MR_SERVICE_PATH=$MR_HTTPX"://"$MR_DMAAP_APP_NAME"."$KUBE_ONAP_NAMESPACE":"$MR_EXTERNAL_PORT
+               fi
+               __check_prestarted_image "DMAAPMR"
+               if [ $? -eq 0 ]; then
+                       MR_SERVICE_PATH=$MR_HTTPX"://"$MR_DMAAP_APP_NAME"."$KUBE_ONAP_NAMESPACE":"$MR_EXTERNAL_PORT
+               fi
+       else
+               MR_SERVICE_PATH=$MR_HTTPX"://"$MR_STUB_APP_NAME":"$MR_INTERNAL_PORT
+               __check_included_image "DMAAPMR"
+               if [ $? -eq 0 ]; then
+                       MR_SERVICE_PATH=$MR_HTTPX"://"$MR_DMAAP_APP_NAME":"$MR_INTERNAL_PORT
+               fi
+       fi
+       echo ""
+}
+
+use_mr_https() {
+       echo -e $BOLD"MR protocol setting"$EBOLD
+       echo -e " Using $BOLD https $EBOLD towards MR"
+       MR_HTTPX="https"
+       MR_STUB_PATH=$MR_HTTPX"://"$MR_STUB_HOST_NAME":"$MR_STUB_LOCALHOST_SECURE_PORT
+       MR_DMAAP_PATH=$MR_HTTPX"://"$MR_DMAAP_HOST_NAME":"$MR_DMAAP_LOCALHOST_SECURE_PORT
+       #Docker/Kube internal path
+       if [ $RUNMODE == "KUBE" ]; then
+               MR_SERVICE_PATH=$MR_HTTPX"://"$MR_STUB_APP_NAME"."$KUBE_ONAP_NAMESPACE":"$MR_EXTERNAL_SECURE_PORT
+               __check_included_image "DMAAPMR"
+               if [ $? -eq 0 ]; then
+                       MR_SERVICE_PATH=$MR_HTTPX"://"$MR_DMAAP_APP_NAME"."$KUBE_ONAP_NAMESPACE":"$MR_EXTERNAL_SECURE_PORT
+               fi
+               __check_prestarted_image "DMAAPMR"
+               if [ $? -eq 0 ]; then
+                       MR_SERVICE_PATH=$MR_HTTPX"://"$MR_DMAAP_APP_NAME"."$KUBE_ONAP_NAMESPACE":"$MR_EXTERNAL_SECURE_PORT
+               fi
+       else
+               MR_SERVICE_PATH=$MR_HTTPX"://"$MR_STUB_APP_NAME":"$MR_INTERNAL_SECURE_PORT
+               __check_included_image "DMAAPMR"
+               if [ $? -eq 0 ]; then
+                       MR_SERVICE_PATH=$MR_HTTPX"://"$MR_DMAAP_APP_NAME":"$MR_INTERNAL_SECURE_PORT
+               fi
+       fi
+       echo ""
+}
+
+# Create a dmaap mr topic
+# args: <topic name> <topic-description>
+__create_topic() {
+       echo -ne " Creating read topic: $1"$SAMELINE
+
+       json_topic="{\"topicName\":\"$1\",\"partitionCount\":\"2\", \"replicationCount\":\"3\", \"transactionEnabled\":\"false\",\"topicDescription\":\"$2\"}"
+       echo $json_topic > ./tmp/$1.json
+
+       curlString="$MR_DMAAP_PATH/topics/create -X POST  -H Content-Type:application/json -d@./tmp/$1.json"
+       topic_retries=5
+       while [ $topic_retries -gt 0 ]; do
+               let topic_retries=topic_retries-1
+               result=$(__do_curl "$curlString")
+               if [ $? -eq 0 ]; then
+                       topic_retries=0
+                       echo -e " Creating read topic: $1 $GREEN OK $EGREEN"
+               fi
+               if [ $? -ne 0 ]; then
+                       if [ $topic_retries -eq 0 ]; then
+                               echo -e " Creating read topic: $1 $RED Failed $ERED"
+                               ((RES_CONF_FAIL++))
+                               return 1
+                       else
+                               sleep 1
+                       fi
+               fi
+       done
+       return 0
+}
+
+# Do a pipeclean of a topic - to overcome dmaap mr bug...
+# args: <topic> <post-url> <read-url>
+__dmaap_pipeclean() {
+       pipeclean_retries=50
+       echo -ne " Doing dmaap-mr pipe cleaning on topic: $1"$SAMELINE
+       while [ $pipeclean_retries -gt 0 ]; do
+               echo "{\"pipeclean-$1\":$pipeclean_retries}" > ./tmp/pipeclean.json
+               let pipeclean_retries=pipeclean_retries-1
+               curlString="$MR_DMAAP_PATH$2 -X POST  -H Content-Type:application/json -d@./tmp/pipeclean.json"
+               result=$(__do_curl "$curlString")
+               if [ $? -ne 0 ]; then
+                       sleep 1
+               else
+                       curlString="$MR_DMAAP_PATH$3"
+                       result=$(__do_curl "$curlString")
+                       if [ $? -eq 0 ]; then
+                               if [ $result != "[]" ]; then
+                                       echo -e " Doing dmaap-mr pipe cleaning on topic: $1 $GREEN OK $EGREEN"
+                                       return 0
+
+                               else
+                                       sleep 1
+                               fi
+                       fi
+               fi
+       done
+       echo -e "Doing dmaap-mr pipe cleaning on topic: $1 $RED Failed $ERED"
+       return 1
+}
+
+# Start the Message Router stub interface in the simulator group
+# args: -
+# (Function for test scripts)
+start_mr() {
+
+       echo -e $BOLD"Starting $MR_DMAAP_DISPLAY_NAME and/or $MR_STUB_DISPLAY_NAME"$EBOLD
+
+       if [ $RUNMODE == "KUBE" ]; then
+
+        # Table of possible combinations of included mr and included/prestarted dmaap-mr
+               # mr can never be prestarted
+               # mr can be used stand alone
+               # if dmaapmr is included/prestarted, then mr is needed as well as frontend
+
+        # Inverted logic - 0 mean true, 1 means false
+               # mr prestarted      0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
+               # mr included        0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1
+               # dmaap prestarted   0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1
+               # dmaap included     0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
+               # ==================================================
+               # OK                 1 1 1 1 1 0 1 1 1 0 1 1 1 0 1 1
+
+               __check_prestarted_image 'MR'
+               retcode_prestarted_mr=$?
+               __check_included_image 'MR'
+               retcode_included_mr=$?
+
+               __check_prestarted_image 'DMAAPMR'
+               retcode_prestarted_dmaapmr=$?
+               __check_included_image 'DMAAPMR'
+               retcode_included_dmaapmr=$?
+
+               paramerror=1
+
+               if [ $retcode_prestarted_mr -ne 0 ] && [ $retcode_included_mr -eq 0 ]; then
+                       if [ $retcode_prestarted_dmaapmr -ne 0 ] && [ $retcode_included_dmaapmr -eq 0 ]; then
+                               paramerror=0
+                       fi
+               fi
+
+               if [ $retcode_prestarted_mr -ne 0 ] && [ $retcode_included_mr -eq 0 ]; then
+                       if [ $retcode_prestarted_dmaapmr -eq 0 ] && [ $retcode_included_dmaapmr -ne 0 ]; then
+                               paramerror=0
+                       fi
+               fi
+
+               if [ $retcode_prestarted_mr -ne 0 ] && [ $retcode_included_mr -eq 0 ]; then
+                       if [ $retcode_prestarted_dmaapmr -ne 0 ] && [ $retcode_included_dmaapmr -ne 0 ]; then
+                               paramerror=0
+                       fi
+               fi
+
+               if [ $paramerror -ne 0 ]; then
+                               echo -e $RED"The Message Router apps 'MR' and/or 'DMAAPMR' are not included in this test script"$ERED
+                               echo -e $RED"The Message Router will not be started"$ERED
+                               echo -e $RED"Both MR and DAAMPMR  - or - only MR - need to be included and/or prestarted"
+                               exit
+               fi
+
+               if [ $retcode_prestarted_dmaapmr -eq 0 ]; then
+                       echo -e " Using existing $MR_DMAAP_APP_NAME deployment and service"
+                       __kube_scale deployment $MR_DMAAP_APP_NAME $KUBE_ONAP_NAMESPACE 1
+               fi
+
+               if [ $retcode_included_dmaapmr -eq 0 ]; then
+                       #export MR_DMAAP_APP_NAME
+                       export MR_DMAAP_KUBE_APP_NAME=message-router
+                       MR_DMAAP_APP_NAME=$MR_DMAAP_KUBE_APP_NAME
+                       export KUBE_ONAP_NAMESPACE
+                       export MR_EXTERNAL_PORT
+                       export MR_INTERNAL_PORT
+                       export MR_EXTERNAL_SECURE_PORT
+                       export MR_INTERNAL_SECURE_PORT
+                       export ONAP_DMAAPMR_IMAGE
+
+                       export MR_KAFKA_BWDS_NAME=akfak-bwds
+                       export KUBE_ONAP_NAMESPACE
+
+                       export MR_ZOOKEEPER_APP_NAME
+                       export ONAP_ZOOKEEPER_IMAGE
+
+                       #Check if onap namespace exists, if not create it
+                       __kube_create_namespace $KUBE_ONAP_NAMESPACE
+
+                       # TODO - Fix domain name substitution in the prop file
+                       # Create config maps - dmaapmr app
+                       configfile=$PWD/tmp/MsgRtrApi.properties
+                       cp $SIM_GROUP"/"$MR_DMAAP_COMPOSE_DIR"/"mnt/mr/KUBE-MsgRtrApi.properties $configfile
+                       output_yaml=$PWD/tmp/dmaapmr_msgrtrapi_cfc.yaml
+                       __kube_create_configmap dmaapmr-msgrtrapi.properties $KUBE_ONAP_NAMESPACE autotest DMAAPMR $configfile $output_yaml
+
+                       configfile=$PWD/tmp/logback.xml
+                       cp $SIM_GROUP"/"$MR_DMAAP_COMPOSE_DIR"/"mnt/mr/logback.xml $configfile
+                       output_yaml=$PWD/tmp/dmaapmr_logback_cfc.yaml
+                       __kube_create_configmap dmaapmr-logback.xml $KUBE_ONAP_NAMESPACE autotest DMAAPMR $configfile $output_yaml
+
+                       configfile=$PWD/tmp/cadi.properties
+                       cp $SIM_GROUP"/"$MR_DMAAP_COMPOSE_DIR"/"mnt/mr/cadi.properties $configfile
+                       output_yaml=$PWD/tmp/dmaapmr_cadi_cfc.yaml
+                       __kube_create_configmap dmaapmr-cadi.properties $KUBE_ONAP_NAMESPACE autotest DMAAPMR $configfile $output_yaml
+
+                       # Create config maps - kafka app
+                       configfile=$PWD/tmp/zk_client_jaas.conf
+                       cp $SIM_GROUP"/"$MR_DMAAP_COMPOSE_DIR"/"mnt/kafka/zk_client_jaas.conf $configfile
+                       output_yaml=$PWD/tmp/dmaapmr_zk_client_cfc.yaml
+                       __kube_create_configmap dmaapmr-zk-client-jaas.conf $KUBE_ONAP_NAMESPACE autotest DMAAPMR $configfile $output_yaml
+
+                       # Create config maps - zookeeper app
+                       configfile=$PWD/tmp/zk_server_jaas.conf
+                       cp $SIM_GROUP"/"$MR_DMAAP_COMPOSE_DIR"/"mnt/zk/zk_server_jaas.conf $configfile
+                       output_yaml=$PWD/tmp/dmaapmr_zk_server_cfc.yaml
+                       __kube_create_configmap dmaapmr-zk-server-jaas.conf $KUBE_ONAP_NAMESPACE autotest DMAAPMR $configfile $output_yaml
+
+                       # Create service
+                       input_yaml=$SIM_GROUP"/"$MR_DMAAP_COMPOSE_DIR"/"svc.yaml
+                       output_yaml=$PWD/tmp/dmaapmr_svc.yaml
+                       __kube_create_instance service $MR_DMAAP_APP_NAME $input_yaml $output_yaml
+
+                       # Create app
+                       input_yaml=$SIM_GROUP"/"$MR_DMAAP_COMPOSE_DIR"/"app.yaml
+                       output_yaml=$PWD/tmp/dmaapmr_app.yaml
+                       __kube_create_instance app $MR_DMAAP_APP_NAME $input_yaml $output_yaml
+
+
+                       echo " Retrieving host and ports for service..."
+                       MR_DMAAP_HOST_NAME=$(__kube_get_service_host $MR_DMAAP_APP_NAME $KUBE_ONAP_NAMESPACE)
+
+                       MR_EXT_PORT=$(__kube_get_service_port $MR_DMAAP_APP_NAME $KUBE_ONAP_NAMESPACE "http")
+                       MR_EXT_SECURE_PORT=$(__kube_get_service_port $MR_DMAAP_APP_NAME $KUBE_ONAP_NAMESPACE "https")
+
+                       echo " Host IP, http port, https port: $MR_DMAAP_APP_NAME $MR_EXT_PORT $MR_EXT_SECURE_PORT"
+                       MR_SERVICE_PATH=""
+                       if [ $MR_HTTPX == "http" ]; then
+                               MR_DMAAP_PATH=$MR_HTTPX"://"$MR_DMAAP_HOST_NAME":"$MR_EXT_PORT
+                               MR_SERVICE_PATH=$MR_HTTPX"://"$MR_DMAAP_APP_NAME"."$KUBE_ONAP_NAMESPACE":"$MR_EXT_PORT
+                       else
+                               MR_DMAAP_PATH=$MR_HTTPX"://"$MR_DMAAP_HOST_NAME":"$MR_EXT_SECURE_PORT
+                               MR_SERVICE_PATH=$MR_HTTPX"://"$MR_DMAAP_APP_NAME"."$KUBE_ONAP_NAMESPACE":"$MR_EXT_SECURE_PORT
+                       fi
+
+                               __check_service_start $MR_DMAAP_APP_NAME $MR_DMAAP_PATH$MR_DMAAP_ALIVE_URL
+
+               fi
+
+               if [ $retcode_included_mr -eq 0 ]; then
+                       #exporting needed var for deployment
+                       export MR_STUB_APP_NAME
+                       export KUBE_ONAP_NAMESPACE
+                       export MRSTUB_IMAGE
+                       export MR_INTERNAL_PORT
+                       export MR_INTERNAL_SECURE_PORT
+                       export MR_EXTERNAL_PORT
+                       export MR_EXTERNAL_SECURE_PORT
+
+                       if [ $retcode_prestarted_dmaapmr -eq 0 ] || [ $retcode_included_dmaapmr -eq 0 ]; then  # Set topics for dmaap
+                               export TOPIC_READ="http://$MR_DMAAP_APP_NAME.$KUBE_ONAP_NAMESPACE:$MR_INTERNAL_PORT/events/$MR_READ_TOPIC"
+                               export TOPIC_WRITE="http://$MR_DMAAP_APP_NAME.$KUBE_ONAP_NAMESPACE:$MR_INTERNAL_PORT/events/$MR_WRITE_TOPIC/users/mr-stub?timeout=15000&limit=100"
+                       else
+                               export TOPIC_READ=""
+                               export TOPIC_WRITE=""
+                       fi
+
+                       #Check if onap namespace exists, if not create it
+                       __kube_create_namespace $KUBE_ONAP_NAMESPACE
+
+                       # Create service
+                       input_yaml=$SIM_GROUP"/"$MR_STUB_COMPOSE_DIR"/"svc.yaml
+                       output_yaml=$PWD/tmp/mr_svc.yaml
+                       __kube_create_instance service $MR_STUB_APP_NAME $input_yaml $output_yaml
+
+                       # Create app
+                       input_yaml=$SIM_GROUP"/"$MR_STUB_COMPOSE_DIR"/"app.yaml
+                       output_yaml=$PWD/tmp/mr_app.yaml
+                       __kube_create_instance app $MR_STUB_APP_NAME $input_yaml $output_yaml
+
+
+               fi
+
+
+               echo " Retrieving host and ports for service..."
+               MR_STUB_HOST_NAME=$(__kube_get_service_host $MR_STUB_APP_NAME $KUBE_ONAP_NAMESPACE)
+
+               MR_EXT_PORT=$(__kube_get_service_port $MR_STUB_APP_NAME $KUBE_ONAP_NAMESPACE "http")
+               MR_EXT_SECURE_PORT=$(__kube_get_service_port $MR_STUB_APP_NAME $KUBE_ONAP_NAMESPACE "https")
+
+               echo " Host IP, http port, https port: $MR_STUB_APP_NAME $MR_EXT_PORT $MR_EXT_SECURE_PORT"
+               if [ $MR_HTTPX == "http" ]; then
+                       MR_STUB_PATH=$MR_HTTPX"://"$MR_STUB_HOST_NAME":"$MR_EXT_PORT
+                       if [ -z "$MR_SERVICE_PATH" ]; then
+                               MR_SERVICE_PATH=$MR_HTTPX"://"$MR_STUB_APP_NAME"."$KUBE_ONAP_NAMESPACE":"$MR_EXT_PORT
+                       fi
+               else
+                       MR_STUB_PATH=$MR_HTTPX"://"$MR_STUB_HOST_NAME":"$MR_EXT_SECURE_PORT
+                       if [ -z "$MR_SERVICE_PATH" ]; then
+                               MR_SERVICE_PATH=$MR_HTTPX"://"$MR_STUB_APP_NAME"."$KUBE_ONAP_NAMESPACE":"$MR_EXT_SECURE_PORT
+                       fi
+               fi
+               MR_ADAPTER_HTTP="http://"$MR_STUB_HOST_NAME":"$MR_EXT_PORT
+               MR_ADAPTER_HTTPS="https://"$MR_STUB_HOST_NAME":"$MR_EXT_SECURE_PORT
+
+               __check_service_start $MR_STUB_APP_NAME $MR_STUB_PATH$MR_STUB_ALIVE_URL
+
+               echo -ne " Service $MR_STUB_APP_NAME - reset  "$SAMELINE
+               result=$(__do_curl $MR_STUB_APP_NAME $MR_STUB_PATH/reset)
+               if [ $? -ne 0 ]; then
+                       echo -e " Service $MR_STUB_APP_NAME - reset  $RED Failed $ERED - will continue"
+               else
+                       echo -e " Service $MR_STUB_APP_NAME - reset  $GREEN OK $EGREEN"
+               fi
+
+
+       else
+
+               __check_included_image 'DMAAPMR'
+               retcode_dmaapmr=$?
+               __check_included_image 'MR'
+               retcode_mr=$?
+
+               if [ $retcode_dmaapmr -ne 0 ] && [ $retcode_mr -ne 0 ]; then
+                               echo -e $RED"The Message Router apps 'MR' and/or 'DMAAPMR' are not included in this test script"$ERED
+                               echo -e $RED"The Message Router will not be started"$ERED
+                               echo -e $RED"Both MR and DAAMPMR  - or - only MR - need to be included"
+                               exit
+               fi
+
+               if [ $retcode_dmaapmr -eq 0 ] && [ $retcode_mr -ne 0 ]; then
+                               echo -e $RED"The Message Router apps 'MR' and/or 'DMAAPMR' are not included in this test script"$ERED
+                               echo -e $RED"The Message Router will not be started"$ERED
+                               echo -e $RED"Both MR and DAAMPMR  - or - only MR - need to be included"
+                               exit
+               fi
+
+               export TOPIC_READ=""
+        export TOPIC_WRITE=""
+               if [ $retcode_dmaapmr -eq 0 ]; then  # Set topics for dmaap
+                       export TOPIC_READ="http://$MR_DMAAP_APP_NAME:$MR_INTERNAL_PORT/events/$MR_READ_TOPIC"
+                       export TOPIC_WRITE="http://$MR_DMAAP_APP_NAME:$MR_INTERNAL_PORT/events/$MR_WRITE_TOPIC/users/mr-stub?timeout=15000&limit=100"
+               fi
+
+               export DOCKER_SIM_NWNAME
+               export ONAP_ZOOKEEPER_IMAGE
+               export MR_ZOOKEEPER_APP_NAME
+               export ONAP_KAFKA_IMAGE
+               export MR_KAFKA_APP_NAME
+               export ONAP_DMAAPMR_IMAGE
+               export MR_DMAAP_APP_NAME
+               export MR_DMAAP_LOCALHOST_PORT
+               export MR_INTERNAL_PORT
+               export MR_DMAAP_LOCALHOST_SECURE_PORT
+               export MR_INTERNAL_SECURE_PORT
+
+               if [ $retcode_dmaapmr -eq 0 ]; then
+                       __start_container $MR_DMAAP_COMPOSE_DIR NODOCKERARGS 1 $MR_DMAAP_APP_NAME
+
+                       __check_service_start $MR_DMAAP_APP_NAME $MR_DMAAP_PATH$MR_DMAAP_ALIVE_URL
+
+
+                       __create_topic $MR_READ_TOPIC "Topic for reading policy messages"
+
+                       __create_topic $MR_WRITE_TOPIC "Topic for writing policy messages"
+
+                       __dmaap_pipeclean $MR_READ_TOPIC "/events/A1-POLICY-AGENT-READ" "/events/A1-POLICY-AGENT-READ/users/policy-agent?timeout=1000&limit=100"
+
+                       __dmaap_pipeclean $MR_WRITE_TOPIC "/events/A1-POLICY-AGENT-WRITE" "/events/A1-POLICY-AGENT-WRITE/users/mr-stub?timeout=1000&limit=100"
+
+                       echo " Current topics:"
+                       curlString="$MR_DMAAP_PATH/topics"
+                       result=$(__do_curl "$curlString")
+                       echo $result | indent2
+               fi
+
+               export DOCKER_SIM_NWNAME
+               export MR_STUB_APP_NAME
+               export MRSTUB_IMAGE
+               export MR_INTERNAL_PORT
+               export MR_INTERNAL_SECURE_PORT
+               export MR_STUB_LOCALHOST_PORT
+               export MR_STUB_LOCALHOST_SECURE_PORT
+               export MR_STUB_CERT_MOUNT_DIR
+
+               if [ $retcode_mr -eq 0 ]; then
+                       __start_container $MR_STUB_COMPOSE_DIR NODOCKERARGS 1 $MR_STUB_APP_NAME
+
+                       __check_service_start $MR_STUB_APP_NAME $MR_STUB_PATH$MR_STUB_ALIVE_URL
+               fi
+
+       fi
+       echo ""
+       return 0
+}
+
+### Generic test cases for varaible checking
+
+# Tests if a variable value in the MR stub is equal to a target value and and optional timeout.
+# Arg: <variable-name> <target-value> - This test set pass or fail depending on if the variable is
+# equal to the target or not.
+# Arg: <variable-name> <target-value> <timeout-in-sec>  - This test waits up to the timeout seconds
+# before setting pass or fail depending on if the variable value becomes equal to the target
+# value or not.
+# (Function for test scripts)
+mr_equal() {
+       if [ $# -eq 2 ] || [ $# -eq 3 ]; then
+               __var_test "MR" $MR_STUB_PATH/counter/ $1 "=" $2 $3
+       else
+               ((RES_CONF_FAIL++))
+               __print_err "Wrong args to mr_equal, needs two or three args: <sim-param> <target-value> [ timeout ]" $@
+       fi
+}
+
+# Tests if a variable value in the MR stub is greater than a target value and and optional timeout.
+# Arg: <variable-name> <target-value> - This test set pass or fail depending on if the variable is
+# greater than the target or not.
+# Arg: <variable-name> <target-value> <timeout-in-sec>  - This test waits up to the timeout seconds
+# before setting pass or fail depending on if the variable value becomes greater than the target
+# value or not.
+# (Function for test scripts)
+mr_greater() {
+       if [ $# -eq 2 ] || [ $# -eq 3 ]; then
+               __var_test "MR" $MR_STUB_PATH/counter/ $1 ">" $2 $3
+       else
+               ((RES_CONF_FAIL++))
+               __print_err "Wrong args to mr_greater, needs two or three args: <sim-param> <target-value> [ timeout ]" $@
+       fi
+}
+
+# Read a variable value from MR sim and send to stdout. Arg: <variable-name>
+mr_read() {
+       echo "$(__do_curl $MR_STUB_PATH/counter/$1)"
+}
+
+# Print a variable value from the MR stub.
+# arg: <variable-name>
+# (Function for test scripts)
+mr_print() {
+       if [ $# != 1 ]; then
+               ((RES_CONF_FAIL++))
+       __print_err "need one arg, <mr-param>" $@
+               exit 1
+       fi
+       echo -e $BOLD"INFO(${BASH_LINENO[0]}): mrstub, $1 = $(__do_curl $MR_STUB_PATH/counter/$1)"$EBOLD
+}
\ No newline at end of file
index a27f3b4..4dfe06b 100644 (file)
 #  ============LICENSE_END=================================================
 #
 
+# This is a script that contains container/service management functions and test functions for Producer stub
+
+## Access to Prod stub sim
+# Direct access
+PROD_STUB_HTTPX="http"
+PROD_STUB_HOST_NAME=$LOCALHOST_NAME
+PROD_STUB_PATH=$PROD_STUB_HTTPX"://"$PROD_STUB_HOST_NAME":"$PROD_STUB_EXTERNAL_PORT
+
+#Docker/Kube internal path
+if [ $RUNMODE == "KUBE" ]; then
+       PROD_STUB_SERVICE_PATH=$PROD_STUB_HTTPX"://"$PROD_STUB_APP_NAME"."$KUBE_SIM_NAMESPACE":"$PROD_STUB_EXTERNAL_PORT
+else
+       PROD_STUB_SERVICE_PATH=$PROD_STUB_HTTPX"://"$PROD_STUB_APP_NAME":"$PROD_STUB_INTERNAL_PORT
+fi
+
+# Set http as the protocol to use for all communication to the Producer stub
+# args: -
+# (Function for test scripts)
+use_prod_stub_http() {
+       echo -e $BOLD"Producer stub protocol setting"$EBOLD
+       echo -e " Using $BOLD http $EBOLD towards Producer stub"
+
+       PROD_STUB_HTTPX="http"
+    PROD_STUB_PATH=$PROD_STUB_HTTPX"://"$PROD_STUB_HOST_NAME":"$PROD_STUB_EXTERNAL_PORT
+
+       if [ $RUNMODE == "KUBE" ]; then
+               PROD_STUB_SERVICE_PATH=$PROD_STUB_HTTPX"://"$PROD_STUB_APP_NAME"."$KUBE_SIM_NAMESPACE":"$PROD_STUB_EXTERNAL_PORT
+       else
+               PROD_STUB_SERVICE_PATH=$PROD_STUB_HTTPX"://"$PROD_STUB_APP_NAME":"$PROD_STUB_INTERNAL_PORT
+       fi
+
+       echo ""
+}
+
+# Set https as the protocol to use for all communication to the Producer stub
+# args: -
+# (Function for test scripts)
+use_prod_stub_https() {
+       echo -e $BOLD"Producer stub protocol setting"$EBOLD
+       echo -e " Using $BOLD https $EBOLD towards Producer stub"
+
+       PROD_STUB_HTTPX="https"
+    PROD_STUB_PATH=$PROD_STUB_HTTPX"://"$PROD_STUB_HOST_NAME":"$PROD_STUB_EXTERNAL_SECURE_PORT
+
+       if [ $RUNMODE == "KUBE" ]; then
+               PROD_STUB_SERVICE_PATH=$PROD_STUB_HTTPX"://"$PROD_STUB_APP_NAME"."$KUBE_SIM_NAMESPACE":"$PROD_STUB_EXTERNAL_SECURE_PORT
+       else
+               PROD_STUB_SERVICE_PATH=$PROD_STUB_HTTPX"://"$PROD_STUB_APP_NAME":"$PROD_STUB_INTERNAL_SECURE_PORT
+       fi
+       echo ""
+}
 
 ### Admin API functions producer stub
 
+###########################
+### Producer stub functions
+###########################
+
+# Start the Producer stub in the simulator group
+# args: -
+# (Function for test scripts)
+start_prod_stub() {
+
+       echo -e $BOLD"Starting $PROD_STUB_DISPLAY_NAME"$EBOLD
+
+       if [ $RUNMODE == "KUBE" ]; then
+
+               # Check if app shall be fully managed by the test script
+               __check_included_image "PRODSTUB"
+               retcode_i=$?
+
+               # Check if app shall only be used by the testscipt
+               __check_prestarted_image "PRODSTUB"
+               retcode_p=$?
+
+               if [ $retcode_i -ne 0 ] && [ $retcode_p -ne 0 ]; then
+                       echo -e $RED"The $ECS_APP_NAME app is not included as managed nor prestarted in this test script"$ERED
+                       echo -e $RED"The $ECS_APP_NAME will not be started"$ERED
+                       exit
+               fi
+               if [ $retcode_i -eq 0 ] && [ $retcode_p -eq 0 ]; then
+                       echo -e $RED"The $ECS_APP_NAME app is included both as managed and prestarted in this test script"$ERED
+                       echo -e $RED"The $ECS_APP_NAME will not be started"$ERED
+                       exit
+               fi
+
+               if [ $retcode_p -eq 0 ]; then
+                       echo -e " Using existing $PROD_STUB_APP_NAME deployment and service"
+                       echo " Setting RC replicas=1"
+                       __kube_scale deployment $PROD_STUB_APP_NAME $KUBE_SIM_NAMESPACE 1
+               fi
+
+               if [ $retcode_i -eq 0 ]; then
+                       echo -e " Creating $PROD_STUB_APP_NAME deployment and service"
+                       export PROD_STUB_APP_NAME
+                       export KUBE_SIM_NAMESPACE
+                       export PROD_STUB_IMAGE
+                       export PROD_STUB_INTERNAL_PORT
+                       export PROD_STUB_INTERNAL_SECURE_PORT
+                       export PROD_STUB_EXTERNAL_PORT
+                       export PROD_STUB_EXTERNAL_SECURE_PORT
+
+            __kube_create_namespace $KUBE_SIM_NAMESPACE
+
+                       # Create service
+                       input_yaml=$SIM_GROUP"/"$PROD_STUB_COMPOSE_DIR"/"svc.yaml
+                       output_yaml=$PWD/tmp/prodstub_svc.yaml
+                       __kube_create_instance service $PROD_STUB_APP_NAME $input_yaml $output_yaml
+
+                       # Create app
+                       input_yaml=$SIM_GROUP"/"$PROD_STUB_COMPOSE_DIR"/"app.yaml
+                       output_yaml=$PWD/tmp/prodstub_app.yaml
+                       __kube_create_instance app $PROD_STUB_APP_NAME $input_yaml $output_yaml
+               fi
+
+               PROD_STUB_HOST_NAME=$(__kube_get_service_host $PROD_STUB_APP_NAME $KUBE_SIM_NAMESPACE)
+
+               PROD_STUB_EXTERNAL_PORT=$(__kube_get_service_port $PROD_STUB_APP_NAME $KUBE_SIM_NAMESPACE "http")
+               PROD_STUB_EXTERNAL_SECURE_PORT=$(__kube_get_service_port $PROD_STUB_APP_NAME $KUBE_SIM_NAMESPACE "https")
+
+               echo " Host IP, http port, https port: $PROD_STUB_HOST_NAME $PROD_STUB_EXTERNAL_PORT $PROD_STUB_EXTERNAL_SECURE_PORT"
+               if [ $PROD_STUB_HTTPX == "http" ]; then
+            PROD_STUB_PATH=$PROD_STUB_HTTPX"://"$PROD_STUB_HOST_NAME":"$PROD_STUB_EXTERNAL_PORT
+                       PROD_STUB_SERVICE_PATH=$PROD_STUB_HTTPX"://"$PROD_STUB_APP_NAME"."$KUBE_SIM_NAMESPACE":"$PROD_STUB_EXTERNAL_PORT
+               else
+            PROD_STUB_PATH=$PROD_STUB_HTTPX"://"$PROD_STUB_HOST_NAME":"$PROD_STUB_EXTERNAL_SECURE_PORT
+                       PROD_STUB_SERVICE_PATH=$PROD_STUB_HTTPX"://"$PROD_STUB_APP_NAME"."$KUBE_SIM_NAMESPACE":"$PROD_STUB_EXTERNAL_SECURE_PORT
+               fi
+
+               __check_service_start $PROD_STUB_APP_NAME $PROD_STUB_PATH$PROD_STUB_ALIVE_URL
+
+               echo -ne " Service $PROD_STUB_APP_NAME - reset  "$SAMELINE
+               result=$(__do_curl $PROD_STUB_PATH/reset)
+               if [ $? -ne 0 ]; then
+                       echo -e " Service $PROD_STUB_APP_NAME - reset  $RED Failed $ERED - will continue"
+               else
+                       echo -e " Service $PROD_STUB_APP_NAME - reset  $GREEN OK $EGREEN"
+               fi
+       else
+
+               # Check if docker app shall be fully managed by the test script
+               __check_included_image 'PRODSTUB'
+               if [ $? -eq 1 ]; then
+                       echo -e $RED"The Producer stub app is not included as managed in this test script"$ERED
+                       echo -e $RED"The Producer stub will not be started"$ERED
+                       exit
+               fi
+
+        export PROD_STUB_APP_NAME
+        export PROD_STUB_APP_NAME_ALIAS
+        export PROD_STUB_INTERNAL_PORT
+        export PROD_STUB_EXTERNAL_PORT
+        export PROD_STUB_INTERNAL_SECURE_PORT
+        export PROD_STUB_EXTERNAL_SECURE_PORT
+        export DOCKER_SIM_NWNAME
+
+               __start_container $PROD_STUB_COMPOSE_DIR NODOCKERARGS 1 $PROD_STUB_APP_NAME
+
+        __check_service_start $PROD_STUB_APP_NAME $PROD_STUB_PATH$PROD_STUB_ALIVE_URL
+       fi
+    echo ""
+    return 0
+}
 
 # Excute a curl cmd towards the prodstub simulator and check the response code.
 # args: TEST|CONF <expected-response-code> <curl-cmd-string> [<json-file-to-compare-output>]
@@ -75,7 +235,7 @@ prodstub_arm_producer() {
                return 1
        fi
 
-    curlString="curl -X PUT -skw %{http_code} $PROD_STUB_LOCALHOST/arm/supervision/"$2
+    curlString="curl -X PUT -skw %{http_code} $PROD_STUB_PATH/arm/supervision/"$2
        if [ $# -eq 3 ]; then
                curlString=$curlString"?response="$3
        fi
@@ -94,7 +254,7 @@ prodstub_arm_job_create() {
                return 1
        fi
 
-    curlString="curl -X PUT -skw %{http_code} $PROD_STUB_LOCALHOST/arm/create/$2/$3"
+    curlString="curl -X PUT -skw %{http_code} $PROD_STUB_PATH/arm/create/$2/$3"
        if [ $# -eq 4 ]; then
                curlString=$curlString"?response="$4
        fi
@@ -113,7 +273,7 @@ prodstub_arm_job_delete() {
                return 1
        fi
 
-    curlString="curl -X PUT -skw %{http_code} $PROD_STUB_LOCALHOST/arm/delete/$2/$3"
+    curlString="curl -X PUT -skw %{http_code} $PROD_STUB_PATH/arm/delete/$2/$3"
        if [ $# -eq 4 ]; then
                curlString=$curlString"?response="$4
        fi
@@ -132,7 +292,7 @@ prodstub_arm_type() {
                return 1
        fi
 
-    curlString="curl -X PUT -skw %{http_code} $PROD_STUB_LOCALHOST/arm/type/$2/$3"
+    curlString="curl -X PUT -skw %{http_code} $PROD_STUB_PATH/arm/type/$2/$3"
 
     __execute_curl_to_prodstub CONF $1 "$curlString"
     return $?
@@ -148,7 +308,7 @@ prodstub_disarm_type() {
                return 1
        fi
 
-    curlString="curl -X DELETE -skw %{http_code} $PROD_STUB_LOCALHOST/arm/type/$2/$3"
+    curlString="curl -X DELETE -skw %{http_code} $PROD_STUB_PATH/arm/type/$2/$3"
 
     __execute_curl_to_prodstub CONF $1 "$curlString"
     return $?
@@ -174,7 +334,7 @@ prodstub_check_jobdata() {
     file="./tmp/.p.json"
        echo "$targetJson" > $file
 
-    curlString="curl -X GET -skw %{http_code} $PROD_STUB_LOCALHOST/jobdata/$2/$3"
+    curlString="curl -X GET -skw %{http_code} $PROD_STUB_PATH/jobdata/$2/$3"
 
     __execute_curl_to_prodstub TEST $1 "$curlString" $file
     return $?
@@ -189,7 +349,7 @@ prodstub_delete_jobdata() {
                __print_err "<response-code> <producer-id> <job-id> " $@
                return 1
        fi
-    curlString="curl -X DELETE -skw %{http_code} $PROD_STUB_LOCALHOST/jobdata/$2/$3"
+    curlString="curl -X DELETE -skw %{http_code} $PROD_STUB_PATH/jobdata/$2/$3"
 
     __execute_curl_to_prodstub CONF $1 "$curlString"
     return $?
@@ -204,7 +364,7 @@ prodstub_delete_jobdata() {
 # (Function for test scripts)
 prodstub_equal() {
        if [ $# -eq 2 ] || [ $# -eq 3 ]; then
-               __var_test "PRODSTUB" "$LOCALHOST$PROD_STUB_EXTERNAL_PORT/counter/" $1 "=" $2 $3
+               __var_test "PRODSTUB" "$PROD_STUB_PATH/counter/" $1 "=" $2 $3
        else
                __print_err "Wrong args to prodstub_equal, needs two or three args: <sim-param> <target-value> [ timeout ]" $@
        fi
index dce28f3..777b9d3 100644 (file)
 #  ============LICENSE_END=================================================
 #
 
-# This is a script that contains specific test functions for RAPP Catalogue API
+# This is a script that contains container/service managemnt functions test functions for RAPP Catalogue API
 
-. ../common/api_curl.sh
+## Access to RAPP Catalogue
+# Host name may be changed if app started by kube
+# Direct access from script
+RC_HTTPX="http"
+RC_HOST_NAME=$LOCALHOST_NAME
+RC_PATH=$RC_HTTPX"://"$RC_HOST_NAME":"$RAPP_CAT_EXTERNAL_PORT
+# RC_ADAPTER used for switch between REST and DMAAP (only REST supported currently)
+RC_ADAPTER_TYPE="REST"
+RC_ADAPTER=$RC_PATH
+
+
+###########################
+### RAPP Catalogue
+###########################
+
+# Set http as the protocol to use for all communication to the RAPP Catalogue
+# args: -
+# (Function for test scripts)
+use_rapp_catalogue_http() {
+       echo -e $BOLD"RAPP Catalogue protocol setting"$EBOLD
+       echo -e " Using $BOLD http $EBOLD towards the RAPP Catalogue"
+       RC_HTTPX="http"
+       RC_PATH=$RC_HTTPX"://"$RC_HOST_NAME":"$RAPP_CAT_EXTERNAL_PORT
+       RC_ADAPTER_TYPE="REST"
+       RC_ADAPTER=$RC_PATH
+       echo ""
+}
+
+# Set https as the protocol to use for all communication to the RAPP Catalogue
+# args: -
+# (Function for test scripts)
+use_rapp_catalogue_https() {
+       echo -e $BOLD"RAPP Catalogue protocol setting"$EBOLD
+       echo -e " Using $BOLD https $EBOLD towards the RAPP Catalogue"
+       RC_HTTPX="https"
+       RC_PATH=$RC_HTTPX"://"$RC_HOST_NAME":"$RAPP_CAT_EXTERNAL_SECURE_PORT
+       RC_ADAPTER_TYPE="REST"
+       RC_ADAPTER=$RC_PATH
+       echo ""
+}
+
+# Start the RAPP Catalogue container
+# args: -
+# (Function for test scripts)
+start_rapp_catalogue() {
+
+       echo -e $BOLD"Starting $RAPP_CAT_DISPLAY_NAME"$EBOLD
+
+       if [ $RUNMODE == "KUBE" ]; then
+
+               # Check if app shall be fully managed by the test script
+               __check_included_image "RC"
+               retcode_i=$?
+
+               # Check if app shall only be used by the testscipt
+               __check_prestarted_image "RC"
+               retcode_p=$?
+
+               if [ $retcode_i -ne 0 ] && [ $retcode_p -ne 0 ]; then
+                       echo -e $RED"The $RAPP_CAT_APP_NAME app is not included as managed nor prestarted in this test script"$ERED
+                       echo -e $RED"The $RAPP_CAT_APP_NAME will not be started"$ERED
+                       exit
+               fi
+               if [ $retcode_i -eq 0 ] && [ $retcode_p -eq 0 ]; then
+                       echo -e $RED"The $RAPP_CAT_APP_NAME app is included both as managed and prestarted in this test script"$ERED
+                       echo -e $RED"The $RAPP_CAT_APP_NAME will not be started"$ERED
+                       exit
+               fi
+
+               if [ $retcode_p -eq 0 ]; then
+                       echo -e " Using existing $RAPP_CAT_APP_NAME deployment and service"
+                       echo " Setting $RAPP_CAT_APP_NAME replicas=1"
+                       __kube_scale deployment $RAPP_CAT_APP_NAME $KUBE_NONRTRIC_NAMESPACE 1
+               fi
+
+               if [ $retcode_i -eq 0 ]; then
+
+                       echo -e " Creating $RAPP_CAT_APP_NAME app and expose service"
+
+                       #Check if nonrtric namespace exists, if not create it
+                       __kube_create_namespace $KUBE_NONRTRIC_NAMESPACE
+
+                       export RAPP_CAT_APP_NAME
+                       export KUBE_NONRTRIC_NAMESPACE
+                       export RAPP_CAT_IMAGE
+                       export RAPP_CAT_INTERNAL_PORT
+                       export RAPP_CAT_INTERNAL_SECURE_PORT
+                       export RAPP_CAT_EXTERNAL_PORT
+                       export RAPP_CAT_EXTERNAL_SECURE_PORT
+
+                       #Create service
+                       input_yaml=$SIM_GROUP"/"$RAPP_CAT_COMPOSE_DIR"/"svc.yaml
+                       output_yaml=$PWD/tmp/rac_svc.yaml
+                       __kube_create_instance service $RAPP_CAT_APP_NAME $input_yaml $output_yaml
+
+                       #Create app
+                       input_yaml=$SIM_GROUP"/"$RAPP_CAT_COMPOSE_DIR"/"app.yaml
+                       output_yaml=$PWD/tmp/rac_app.yaml
+                       __kube_create_instance app $RAPP_CAT_APP_NAME $input_yaml $output_yaml
+               fi
+
+               echo " Retrieving host and ports for service..."
+               RC_HOST_NAME=$(__kube_get_service_host $RAPP_CAT_APP_NAME $KUBE_NONRTRIC_NAMESPACE)
+
+               RAPP_CAT_EXTERNAL_PORT=$(__kube_get_service_port $RAPP_CAT_APP_NAME $KUBE_NONRTRIC_NAMESPACE "http")
+               RAPP_CAT_EXTERNAL_SECURE_PORT=$(__kube_get_service_port $RAPP_CAT_APP_NAME $KUBE_NONRTRIC_NAMESPACE "https")
+
+               echo " Host IP, http port, https port: $RC_HOST_NAME $RAPP_CAT_EXTERNAL_PORT $RAPP_CAT_EXTERNAL_SECURE_PORT"
+               if [ $RC_HTTPX == "http" ]; then
+                       RC_PATH=$RC_HTTPX"://"$RC_HOST_NAME":"$RAPP_CAT_EXTERNAL_PORT
+               else
+                       RC_PATH=$RC_HTTPX"://"$RC_HOST_NAME":"$RAPP_CAT_EXTERNAL_SECURE_PORT
+               fi
+
+               __check_service_start $RAPP_CAT_APP_NAME $RC_PATH$RAPP_CAT_ALIVE_URL
+
+               # Update the curl adapter if set to rest, no change if type dmaap
+               if [ $RC_ADAPTER_TYPE == "REST" ]; then
+                       RC_ADAPTER=$RC_PATH
+               fi
+       else
+               __check_included_image 'RC'
+               if [ $? -eq 1 ]; then
+                       echo -e $RED"The RAPP Catalogue app is not included as managed in this test script"$ERED
+                       echo -e $RED"The RAPP Catalogue will not be started"$ERED
+                       exit
+               fi
+
+               export RAPP_CAT_APP_NAME
+        export RAPP_CAT_INTERNAL_PORT
+        export RAPP_CAT_EXTERNAL_PORT
+        export RAPP_CAT_INTERNAL_SECURE_PORT
+        export RAPP_CAT_EXTERNAL_SECURE_PORT
+        export DOCKER_SIM_NWNAME
+
+               __start_container $RAPP_CAT_COMPOSE_DIR NODOCKERARGS 1 $RAPP_CAT_APP_NAME
+
+               __check_service_start $RAPP_CAT_APP_NAME $RC_PATH$RAPP_CAT_ALIVE_URL
+       fi
+       echo ""
+}
 
 # Tests if a variable value in the RAPP Catalogue is equal to a target value and and optional timeout.
 # Arg: <variable-name> <target-value> - This test set pass or fail depending on if the variable is
 # (Function for test scripts)
 rc_equal() {
        if [ $# -eq 2 ] || [ $# -eq 3 ]; then
-               __var_test RC "$LOCALHOST$RC_EXTERNAL_PORT/" $1 "=" $2 $3
+               #__var_test RC "$LOCALHOST_HTTP:$RC_EXTERNAL_PORT/" $1 "=" $2 $3
+               __var_test RC "$RC_PATH/" $1 "=" $2 $3
        else
                __print_err "Wrong args to ecs_equal, needs two or three args: <sim-param> <target-value> [ timeout ]" $@
        fi
index 2a68aa0..bb057ce 100644 (file)
 #  ============LICENSE_END=================================================
 #
 
+# This is a script that contains container/service management functions and test functions for RICSIM A1 simulators
+
+RIC_SIM_HTTPX="http"
+RIC_SIM_HOST=$RIC_SIM_HTTPX"://"$LOCALHOST_NAME
+RIC_SIM_PORT=$RIC_SIM_INTERNAL_PORT
+
+
+#Vars for A1 interface version and container count
+G1_A1_VERSION=""
+G2_A1_VERSION=""
+G3_A1_VERSION=""
+G4_A1_VERSION=""
+G5_A1_VERSION=""
+G1_COUNT=0
+G2_COUNT=0
+G3_COUNT=0
+G4_COUNT=0
+G5_COUNT=0
+
+
+###########################
+### RIC Simulator functions
+###########################
+
+use_simulator_http() {
+       echo -e $BOLD"RICSIM protocol setting"$EBOLD
+       echo -e " Using $BOLD http $EBOLD towards the simulators"
+       RIC_SIM_HTTPX="http"
+       RIC_SIM_HOST=$RIC_SIM_HTTPX"://"$LOCALHOST_NAME
+       RIC_SIM_PORT=$RIC_SIM_INTERNAL_PORT
+       echo ""
+}
+
+use_simulator_https() {
+       echo -e $BOLD"RICSIM protocol setting"$EBOLD
+       echo -e " Using $BOLD https $EBOLD towards the simulators"
+       RIC_SIM_HTTPX="https"
+       RIC_SIM_HOST=$RIC_SIM_HTTPX"://"$LOCALHOST_NAME
+       RIC_SIM_PORT=$RIC_SIM_INTERNAL_SECURE_PORT
+       echo ""
+}
+
+# Start one group (ricsim_g1, ricsim_g2 .. ricsim_g5) with a number of RIC Simulators using a given A interface
+# 'ricsim' may be set on command line to other prefix
+# args:  ricsim_g1|ricsim_g2|ricsim_g3|ricsim_g4|ricsim_g5 <count> <interface-id>
+# (Function for test scripts)
+start_ric_simulators() {
+
+       echo -e $BOLD"Starting $RIC_SIM_DISPLAY_NAME"$EBOLD
+
+       if [ $RUNMODE == "KUBE" ]; then
+
+               # Check if app shall be fully managed by the test script
+               __check_included_image "RICSIM"
+               retcode_i=$?
+
+               # Check if app shall only be used by the testscipt
+               __check_prestarted_image "RICSIM"
+               retcode_p=$?
+
+               if [ $retcode_i -ne 0 ] && [ $retcode_p -ne 0 ]; then
+                       echo -e $RED"The $1 app is not included as managed nor prestarted in this test script"$ERED
+                       echo -e $RED"The $1 will not be started"$ERED
+                       exit
+               fi
+               if [ $retcode_i -eq 0 ] && [ $retcode_p -eq 0 ]; then
+                       echo -e $RED"The $1 stub app is included both as managed and prestarted in this test script"$ERED
+                       echo -e $RED"The $1 will not be started"$ERED
+                       exit
+               fi
+
+               if [ $retcode_p -eq 0 ]; then
+                       echo -e " Using existing $1 statefulset and service"
+                       echo " Using existing simulator deployment and service for statefulset $1"
+                       echo " Setting $1 replicas=$2"
+                       __kube_scale statefulset $1 $KUBE_NONRTRIC_NAMESPACE $2
+                       echo ""
+                       return
+               fi
+       fi
+
+       RIC1=$RIC_SIM_PREFIX"_g1"
+       RIC2=$RIC_SIM_PREFIX"_g2"
+       RIC3=$RIC_SIM_PREFIX"_g3"
+       RIC4=$RIC_SIM_PREFIX"_g4"
+       RIC5=$RIC_SIM_PREFIX"_g5"
+
+       if [ $# != 3 ]; then
+               ((RES_CONF_FAIL++))
+               __print_err "need three args,  $RIC1|$RIC2|$RIC3|$RIC4|$RIC5 <count> <interface-id>" $@
+               exit 1
+       fi
+
+       echo " $2 simulators using basename: $1 on interface: $3"
+       #Set env var for simulator count and A1 interface vesion for the given group
+       if [ $1 == "$RIC1" ]; then
+               G1_COUNT=$2
+               G1_A1_VERSION=$3
+       elif [ $1 == "$RIC2" ]; then
+               G2_COUNT=$2
+               G2_A1_VERSION=$3
+       elif [ $1 == "$RIC3" ]; then
+               G3_COUNT=$2
+               G3_A1_VERSION=$3
+       elif [ $1 == "$RIC4" ]; then
+               G4_COUNT=$2
+               G4_A1_VERSION=$3
+       elif [ $1 == "$RIC5" ]; then
+               G5_COUNT=$2
+               G5_A1_VERSION=$3
+       else
+               ((RES_CONF_FAIL++))
+               __print_err "need three args, $RIC1|$RIC2|$RIC3|$RIC4|$RIC5 <count> <interface-id>" $@
+               exit 1
+       fi
+
+       if [ $RUNMODE == "KUBE" ]; then
+
+               if [ $retcode_i -eq 0 ]; then
+
+                       #export needed env var for statefulset
+                       export RIC_SIM_SET_NAME=$(echo "$1" | tr '_' '-')  #kube does not accept underscore in names
+                       export KUBE_NONRTRIC_NAMESPACE
+                       export RIC_SIM_IMAGE
+                       #Adding 1 more instance, instance 0 is never used. This is done to keep test scripts compatible
+                       # with docker that starts instance index on 1.....
+                       export RIC_SIM_COUNT=$(($2+1))
+                       export A1_VERSION=$3
+                       export RIC_SIM_INTERNAL_PORT
+                       export RIC_SIM_INTERNAL_SECURE_PORT
+
+                       echo -e " Creating $POLICY_AGENT_APP_NAME app and expose service"
+
+                       #Check if nonrtric namespace exists, if not create it
+                       __kube_create_namespace $KUBE_NONRTRIC_NAMESPACE
+
+                       # Create service
+                       input_yaml=$SIM_GROUP"/"$RIC_SIM_COMPOSE_DIR"/"svc.yaml
+                       output_yaml=$PWD/tmp/ric_${1}_svc.yaml
+                       __kube_create_instance service $RIC_SIM_SET_NAME $input_yaml $output_yaml
+
+                       # Create app
+                       input_yaml=$SIM_GROUP"/"$RIC_SIM_COMPOSE_DIR"/"app.yaml
+                       output_yaml=$PWD/tmp/pa_${1}_app.yaml
+                       __kube_create_instance app $RIC_SIM_SET_NAME $input_yaml $output_yaml
+
+                       #Using only instance from index 1 to keep compatability with docker
+                       for (( count=1; count<${RIC_SIM_COUNT}; count++ )); do
+                               host=$(__find_sim_host $RIC_SIM_SET_NAME"-"$count)
+                               __check_service_start $RIC_SIM_SET_NAME"-"$count $host"/"
+                       done
+               fi
+       else
+
+               __check_included_image 'RICSIM'
+               if [ $? -eq 1 ]; then
+                       echo -e $RED"The Near-RT RIC Simulator app is not included as managed in this test script"$ERED
+                       echo -e $RED"Near-RT RIC Simulator will not be started"$ERED
+                       exit 1
+               fi
+
+               # Create .env file to compose project, all ric container will get this prefix
+               echo "COMPOSE_PROJECT_NAME="$RIC_SIM_PREFIX > $SIM_GROUP/$RIC_SIM_COMPOSE_DIR/.env
+
+               export G1_A1_VERSION
+               export G2_A1_VERSION
+               export G3_A1_VERSION
+               export G4_A1_VERSION
+               export G5_A1_VERSION
+               export RIC_SIM_INTERNAL_PORT
+               export RIC_SIM_INTERNAL_SECURE_PORT
+               export RIC_SIM_CERT_MOUNT_DIR
+               export DOCKER_SIM_NWNAME
+
+               docker_args="--scale g1=$G1_COUNT --scale g2=$G2_COUNT --scale g3=$G3_COUNT --scale g4=$G4_COUNT --scale g5=$G5_COUNT"
+               app_data=""
+               cntr=1
+               while [ $cntr -le $2 ]; do
+                       app=$1"_"$cntr
+                       app_data="$app_data $app"
+                       let cntr=cntr+1
+               done
+
+               __start_container $RIC_SIM_COMPOSE_DIR "$docker_args" $2 $app_data
+
+               cntr=1
+               while [ $cntr -le $2 ]; do
+                       app=$1"_"$cntr
+                       localport=0
+
+                       while [ $localport -eq 0 ]; do
+                               echo -ne " Waiting for container ${app} to publish its ports...${SAMELINE}"
+                               localport=$(__find_sim_port $app)
+                               sleep 0.5
+                               echo -ne " Waiting for container ${app} to publish its ports...retrying....${SAMELINE}"
+                       done
+                       echo -e " Waiting for container ${app} to publish its ports...retrying....$GREEN OK $EGREEN"
+                       __check_service_start $app $RIC_SIM_HOST":"$localport$RIC_SIM_ALIVE_URL
+                       let cntr=cntr+1
+               done
+       fi
+       echo ""
+       return 0
+}
 
-### Admin API functions for the RIC simulator
 
 
 # Excute a curl cmd towards a ricsimulator and check the response code.
@@ -55,8 +258,8 @@ __execute_curl_to_sim() {
 sim_equal() {
 
        if [ $# -eq 3 ] || [ $# -eq 4 ]; then
-               port=$(__find_sim_port $1)
-               __var_test $1 "$RIC_SIM_LOCALHOST$port/counter/" $2 "=" $3 $4
+               host=$(__find_sim_host $1)
+               __var_test $1 "$host/counter/" $2 "=" $3 $4
                return 0
        else
                __print_err "needs three or four args: <ric-id> <sim-param> <target-value> [ timeout ]"
@@ -73,8 +276,8 @@ sim_print() {
        __print_err "need two args, <ric-id> <sim-param>" $@
                exit 1
        fi
-       port=$(__find_sim_port $1)
-       echo -e $BOLD"INFO(${BASH_LINENO[0]}): $1, $2 = $(__do_curl $RIC_SIM_LOCALHOST$port/counter/$2)"$EBOLD
+       host=$(__find_sim_host $1)
+       echo -e $BOLD"INFO(${BASH_LINENO[0]}): $1, $2 = $(__do_curl $host/counter/$2)"$EBOLD
 }
 
 # Tests if a variable value in the RIC simulator contains the target string and and optional timeout
@@ -87,8 +290,8 @@ sim_print() {
 sim_contains_str() {
 
        if [ $# -eq 3 ] || [ $# -eq 4 ]; then
-               port=$(__find_sim_port $1)
-               __var_test $1 "$RIC_SIM_LOCALHOST$port/counter/" $2 "contain_str" $3 $4
+               host=$(__find_sim_host $1)
+               __var_test $1 "$host/counter/" $2 "contain_str" $3 $4
                return 0
        else
                __print_err "needs three or four args: <ric-id> <sim-param> <target-value> [ timeout ]"
@@ -105,8 +308,8 @@ sim_put_policy_type() {
                __print_err "<response-code> <ric-id> <policy-type-id> <policy-type-file>" $@
                return 1
        fi
-       res=$(__find_sim_port $2)
-    curlString="curl -X PUT -skw %{http_code} $RIC_SIM_LOCALHOST"$res"/policytype?id="$3" -H Content-Type:application/json --data-binary @"$4
+       host=$(__find_sim_host $2)
+    curlString="curl -X PUT -skw %{http_code} "$host"/policytype?id="$3" -H Content-Type:application/json --data-binary @"$4
        __execute_curl_to_sim $1 "$curlString"
        return $?
 }
@@ -120,8 +323,8 @@ sim_delete_policy_type() {
                __print_err "<response-code> <ric-id> <policy_type_id>" $@
                return 1
        fi
-       res=$(__find_sim_port $2)
-    curlString="curl -X DELETE -skw %{http_code} $RIC_SIM_LOCALHOST"$res"/policytype?id="$3
+       host=$(__find_sim_host $2)
+    curlString="curl -X DELETE -skw %{http_code} "$host"/policytype?id="$3
     __execute_curl_to_sim $1 "$curlString"
        return $?
 }
@@ -135,8 +338,8 @@ sim_post_delete_instances() {
                __print_err "<response-code> <ric-id>" $@
                return 1
        fi
-       res=$(__find_sim_port $2)
-    curlString="curl -X POST -skw %{http_code} $RIC_SIM_LOCALHOST"$res"/deleteinstances"
+       host=$(__find_sim_host $2)
+    curlString="curl -X POST -skw %{http_code} "$host"/deleteinstances"
     __execute_curl_to_sim $1 "$curlString"
        return $?
 }
@@ -150,8 +353,8 @@ sim_post_delete_all() {
                __print_err "<response-code> <numericic-id>" $@
                return 1
        fi
-       res=$(__find_sim_port $2)
-    curlString="curl -X POST -skw %{http_code} $RIC_SIM_LOCALHOST"$res"/deleteall"
+       host=$(__find_sim_host $2)
+    curlString="curl -X POST -skw %{http_code} "$host"/deleteall"
     __execute_curl_to_sim $1 "$curlString"
        return $?
 }
@@ -165,8 +368,8 @@ sim_post_forcedresponse() {
                __print_err "<response-code> <ric-id> <forced_response_code>" $@
                return 1
        fi
-       res=$(__find_sim_port $2)
-    curlString="curl -X POST -skw %{http_code} $RIC_SIM_LOCALHOST"$res"/forceresponse"
+       host=$(__find_sim_host $2)
+    curlString="curl -X POST -skw %{http_code} "$host"/forceresponse"
        if [ $# -eq 3 ]; then
                curlString=$curlString"?code="$3
        fi
@@ -183,8 +386,8 @@ sim_post_forcedelay() {
                __print_err "<response-code> <ric-id> [<delay-in-seconds>]" $@
                return 1
        fi
-       res=$(__find_sim_port $2)
-    curlString="curl -X POST -skw %{http_code} $RIC_SIM_LOCALHOST$res/forcedelay"
+       host=$(__find_sim_host $2)
+    curlString="curl -X POST -skw %{http_code} $host/forcedelay"
        if [ $# -eq 3 ]; then
                curlString=$curlString"?delay="$3
        fi
index 9b85bf0..e0e732c 100644 (file)
@@ -7,7 +7,7 @@
 #  you may not use this file except in compliance with the License.
 #  You may obtain a copy of the License at
 #
-#       http://www.apache.org/licenses/LICENSE-2.0
+#    http://www.apache.org/licenses/LICENSE-2.0
 #
 #  Unless required by applicable law or agreed to in writing, software
 #  distributed under the License is distributed on an "AS IS" BASIS,
@@ -18,6 +18,7 @@
 #
 #Profile for ONAP guilin release
 TEST_ENV_PROFILE="ONAP-GUILIN"
+FLAVOUR="ONAP"
 
 ########################################
 ## Nexus repo settings
@@ -112,12 +113,26 @@ CR_IMAGE_BASE="callback-receiver"
 CR_IMAGE_TAG_LOCAL="latest"
 #No remote image for CR, local image always used
 
+#Http proxy remote image and tag
+HTTP_PROXY_IMAGE_BASE="mitmproxy/mitmproxy"
+HTTP_PROXY_IMAGE_TAG_REMOTE_PROXY="6.0.2"
+#No local image for SSDNC DB, remote image always used
 
-#Producer stub image and tag
-PROD_STUB_IMAGE_BASE="producer-stub"
-PROD_STUB_IMAGE_TAG_LOCAL="latest"
-#No remote image for producer stub, local image always used
 
+#ONAP Zookeeper remote image and tag
+ONAP_ZOOKEEPER_IMAGE_BASE="onap/dmaap/zookeeper"
+ONAP_ZOOKEEPER_IMAGE_TAG_REMOTE_RELEASE_ONAP="6.0.3"
+#No local image for ONAP Zookeeper, remote image always used
+
+#ONAP Kafka remote image and tag
+ONAP_KAFKA_IMAGE_BASE="onap/dmaap/kafka111"
+ONAP_KAFKA_IMAGE_TAG_REMOTE_RELEASE_ONAP="1.0.4"
+#No local image for ONAP Kafka, remote image always used
+
+#ONAP DMAAP-MR remote image and tag
+ONAP_DMAAPMR_IMAGE_BASE="onap/dmaap/dmaap-mr"
+ONAP_DMAAPMR_IMAGE_TAG_REMOTE_RELEASE_ONAP="1.1.18"
+#No local image for ONAP DMAAP-MR, remote image always used
 
 # List of app short names produced by the project
 PROJECT_IMAGES_APP_NAMES="PA SDNC"
@@ -132,85 +147,143 @@ ONAP_IMAGES_APP_NAMES=""   # Not used
 # Detailed settings per app
 ########################################
 
-# Vars used by docker-compose need to be exported
-
-
-export DOCKER_SIM_NWNAME="nonrtric-docker-net"                  # Name of docker private network
-
-export POLICY_AGENT_EXTERNAL_PORT=8081                          # Policy Agent container external port (host -> container)
-export POLICY_AGENT_INTERNAL_PORT=8081                          # Policy Agent container internal port (container -> container)
-export POLICY_AGENT_EXTERNAL_SECURE_PORT=8433                   # Policy Agent container external secure port (host -> container)
-export POLICY_AGENT_INTERNAL_SECURE_PORT=8433                   # Policy Agent container internal secure port (container -> container)
-export POLICY_AGENT_APIS="V1"                                   # Supported northbound api versions
-
-export POLICY_AGENT_APP_NAME="policy-agent"                     # Name for Policy Agent container
-POLICY_AGENT_LOGPATH="/var/log/policy-agent/application.log"    # Path the application log in the Policy Agent container
-export POLICY_AGENT_APP_NAME_ALIAS="policy-agent-container"     # Alias name, name used by the control panel
-
-export MR_EXTERNAL_PORT=3905                                    # MR stub container external port (host -> container)
-export MR_INTERNAL_PORT=3905                                    # MR stub container internal port (container -> container)
-export MR_EXTERNAL_SECURE_PORT=3906                             # MR stub container external secure port (host -> container)
-export MR_INTERNAL_SECURE_PORT=3906                             # MR stub container internal secure port (container -> container)
-export MR_APP_NAME="message-router"                             # Name for the MR
-export MR_READ_URL="/events/A1-POLICY-AGENT-READ/users/policy-agent?timeout=15000&limit=100" # Path to read messages from MR
-export MR_WRITE_URL="/events/A1-POLICY-AGENT-WRITE"             # Path write messages to MR
-
-export CR_EXTERNAL_PORT=8090                                    # Callback receiver container external port (host -> container)
-export CR_INTERNAL_PORT=8090                                    # Callback receiver container internal port (container -> container)
-export CR_EXTERNAL_SECURE_PORT=8091                             # Callback receiver container external secure port (host -> container)
-export CR_INTERNAL_SECURE_PORT=8091                             # Callback receiver container internal secure port (container -> container)
-export CR_APP_NAME="callback-receiver"                          # Name for the Callback receiver
-
-export CONSUL_HOST="consul-server"                              # Host name of consul
-export CONSUL_EXTERNAL_PORT=8500                                # Consul container external port (host -> container)
-export CONSUL_INTERNAL_PORT=8500                                # Consul container internal port (container -> container)
-export CONSUL_APP_NAME="polman-consul"                          # Name for consul container
-
-export CBS_APP_NAME="polman-cbs"                                # Name for CBS container
-export CBS_EXTERNAL_PORT=10000                                  # CBS container external port (host -> container)
-export CBS_INTERNAL_PORT=10000                                  # CBS container internal port (container -> container)
-export CONFIG_BINDING_SERVICE="config-binding-service"          # Host name of CBS
-
-export RIC_SIM_BASE="g"                                         # Base name of the RIC Simulator container, shall be the group code
-                                                                # Note, a prefix is added to each container name by the .env file in the 'ric' dir
-RIC_SIM_PREFIX="ricsim"                                         # Prefix added to ric container name, added in the .env file in the 'ric' dir
-                                                                # This prefix can be changed from the command line
-export RIC_SIM_INTERNAL_PORT=8085                               # RIC Simulator container internal port (container -> container).
-                                                                # (external ports allocated by docker)
-export RIC_SIM_INTERNAL_SECURE_PORT=8185                        # RIC Simulator container internal secure port (container -> container).
-                                                                # (external ports allocated by docker)
-
-export SDNC_APP_NAME="a1-controller"                            # Name of the SNDC A1 Controller container
-export SDNC_EXTERNAL_PORT=8282                                  # SNDC A1 Controller container external port (host -> container)
-export SDNC_INTERNAL_PORT=8181                                  # SNDC A1 Controller container internal port (container -> container)
-export SDNC_EXTERNAL_SECURE_PORT=8443                           # SNDC A1 Controller container external securee port (host -> container)
-export SDNC_INTERNAL_SECURE_PORT=8443                           # SNDC A1 Controller container internal secure port (container -> container)
-export SDNC_DB_APP_NAME="sdnc-db"                               # Name of the SDNC DB container
-export SDNC_A1_TRUSTSTORE_PASSWORD="a1adapter"                  # SDNC truststore password
-SDNC_USER="admin"                                               # SDNC username
-SDNC_PWD="Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U"          # SNDC PWD
-SDNC_API_URL="/restconf/operations/A1-ADAPTER-API:"             # Base url path for SNDC API
-SDNC_ALIVE_URL="/apidoc/explorer/"                              # Base url path for SNDC API docs (for alive check)
-SDNC_KARAF_LOG="/opt/opendaylight/data/log/karaf.log"           # Path to karaf log
-
-
-export CONTROL_PANEL_APP_NAME="control-panel"                   # Name of the Control Panel container
-export CONTROL_PANEL_EXTERNAL_PORT=8080                         # Control Panel container external port (host -> container)
-export CONTROL_PANEL_INTERNAL_PORT=8080                         # Control Panel container external port (host -> container)
-CONTROL_PANEL_LOGPATH="/logs/nonrtric-controlpanel.log"         # Path the application log in the Control Panel container
 
+DOCKER_SIM_NWNAME="nonrtric-docker-net"                  # Name of docker private network
+
+KUBE_NONRTRIC_NAMESPACE="nonrtric"                       # Namespace for all nonrtric components
+KUBE_SIM_NAMESPACE="nonrtric-ft"                         # Namespace for simulators (except MR and RICSIM)
+KUBE_ONAP_NAMESPACE="onap"                               # Namespace for onap (only message router)
+
+POLICY_AGENT_EXTERNAL_PORT=8081                          # Policy Agent container external port (host -> container)
+POLICY_AGENT_INTERNAL_PORT=8081                          # Policy Agent container internal port (container -> container)
+POLICY_AGENT_EXTERNAL_SECURE_PORT=8433                   # Policy Agent container external secure port (host -> container)
+POLICY_AGENT_INTERNAL_SECURE_PORT=8433                   # Policy Agent container internal secure port (container -> container)
+POLICY_AGENT_APIS="V1"                                   # Supported northbound api versions
+PMS_VERSION="V1"                                         # Tested version of northbound API
+PMS_API_PREFIX=""                                        # api url prefix, only for V2
+
+POLICY_AGENT_APP_NAME="policymanagementservice"          # Name for Policy Agent container
+POLICY_AGENT_DISPLAY_NAME="Policy Management Service"
+POLICY_AGENT_HOST_MNT_DIR="./mnt"                        # Mounted dir, relative to compose file, on the host
+POLICY_AGENT_LOGPATH="/var/log/policy-agent/application.log" # Path the application log in the Policy Agent container
+POLICY_AGENT_APP_NAME_ALIAS="policy-agent-container"     # Alias name, name used by the control panel
+POLICY_AGENT_CONFIG_KEY="policy-agent"                   # Key for consul config
+POLICY_AGENT_PKG_NAME="org.onap.ccsdk.oran.a1policymanagementservice"  # Java base package name
+POLICY_AGENT_ACTUATOR="/actuator/loggers/$POLICY_AGENT_PKG_NAME" # Url for trace/debug
+POLICY_AGENT_ALIVE_URL="/status"                         # Base path for alive check
+POLICY_AGENT_COMPOSE_DIR="policy_agent"                  # Dir in simulator_group for docker-compose
+POLICY_AGENT_CONFIG_MOUNT_PATH="/opt/app/policy-agent/config" # Path in container for config file
+POLICY_AGENT_DATA_MOUNT_PATH="/opt/app/policy-agent/data" # Path in container for data file
+POLICY_AGENT_CONFIG_FILE="application.yaml"              # Container config file name
+POLICY_AGENT_DATA_FILE="application_configuration.json"  # Container data file name
+
+MR_DMAAP_APP_NAME="dmaap-mr"                             # Name for the Dmaap MR
+MR_STUB_APP_NAME="mr-stub"                               # Name of the MR stub
+MR_DMAAP_DISPLAY_NAME="DMAAP Message Router"
+MR_STUB_DISPLAY_NAME="Message Router stub"
+MR_STUB_CERT_MOUNT_DIR="./cert"
+MR_EXTERNAL_PORT=3904                                    # MR dmaap/stub container external port
+MR_INTERNAL_PORT=3904                                    # MR dmaap/stub container internal port
+MR_EXTERNAL_SECURE_PORT=3905                             # MR dmaap/stub container external secure port
+MR_INTERNAL_SECURE_PORT=3905                             # MR dmaap/stub container internal secure port
+MR_DMAAP_LOCALHOST_PORT=3904                             # MR stub container external port (host -> container)
+MR_STUB_LOCALHOST_PORT=3908                              # MR stub container external port (host -> container)
+MR_DMAAP_LOCALHOST_SECURE_PORT=3905                      # MR stub container internal port (container -> container)
+MR_STUB_LOCALHOST_SECURE_PORT=3909                       # MR stub container external secure port (host -> container)
+MR_READ_URL="/events/A1-POLICY-AGENT-READ/users/policy-agent?timeout=15000&limit=100" # Path to read messages from MR
+MR_WRITE_URL="/events/A1-POLICY-AGENT-WRITE"             # Path write messages to MR
+MR_READ_TOPIC="A1-POLICY-AGENT-READ"                     # Read topic
+MR_WRITE_TOPIC="A1-POLICY-AGENT-WRITE"                   # Write topic
+MR_STUB_ALIVE_URL="/"                                    # Base path for mr stub alive check
+MR_DMAAP_ALIVE_URL="/topics"                             # Base path for dmaap-mr alive check
+MR_DMAAP_COMPOSE_DIR="dmaapmr"                           # Dir in simulator_group for dmaap mr for - docker-compose
+MR_STUB_COMPOSE_DIR="mrstub"                             # Dir in simulator_group for mr stub for - docker-compose
+MR_KAFKA_APP_NAME="kafka"                                # Kafka app name
+MR_ZOOKEEPER_APP_NAME="zookeeper"                        # Zookeeper app name
+
+
+CR_APP_NAME="callback-receiver"                          # Name for the Callback receiver
+CR_DISPLAY_NAME="Callback Reciever"
+CR_EXTERNAL_PORT=8090                                    # Callback receiver container external port (host -> container)
+CR_INTERNAL_PORT=8090                                    # Callback receiver container internal port (container -> container)
+CR_EXTERNAL_SECURE_PORT=8091                             # Callback receiver container external secure port (host -> container)
+CR_INTERNAL_SECURE_PORT=8091                             # Callback receiver container internal secure port (container -> container)
+CR_APP_CALLBACK="/callbacks"                             # Url for callbacks
+CR_ALIVE_URL="/"                                         # Base path for alive check
+CR_COMPOSE_DIR="cr"                                      # Dir in simulator_group for docker-compose
+
+CONSUL_HOST="consul-server"                              # Host name of consul
+CONSUL_DISPLAY_NAME="Consul"
+CONSUL_EXTERNAL_PORT=8500                                # Consul container external port (host -> container)
+CONSUL_INTERNAL_PORT=8500                                # Consul container internal port (container -> container)
+CONSUL_APP_NAME="polman-consul"                          # Name for consul container
+CONSUL_ALIVE_URL="/ui/dc1/kv"                            # Base path for alive check
+CONSUL_CBS_COMPOSE_DIR="consul_cbs"                      # Dir in simulator group for docker compose
+
+CBS_APP_NAME="polman-cbs"                                # Name for CBS container
+CBS_DISPLAY_NAME="Config Binding Service"
+CBS_EXTERNAL_PORT=10000                                  # CBS container external port (host -> container)
+CBS_INTERNAL_PORT=10000                                  # CBS container internal port (container -> container)
+CONFIG_BINDING_SERVICE="config-binding-service"          # Host name of CBS
+CBS_ALIVE_URL="/healthcheck"                             # Base path for alive check
+
+RIC_SIM_DISPLAY_NAME="Near-RT RIC A1 Simulator"
+RIC_SIM_BASE="g"                                         # Base name of the RIC Simulator container, shall be the group code
+                                                         # Note, a prefix is added to each container name by the .env file in the 'ric' dir
+RIC_SIM_PREFIX="ricsim"                                  # Prefix added to ric container name, added in the .env file in the 'ric' dir
+                                                         # This prefix can be changed from the command line
+RIC_SIM_INTERNAL_PORT=8085                               # RIC Simulator container internal port (container -> container).
+                                                         # (external ports allocated by docker)
+RIC_SIM_INTERNAL_SECURE_PORT=8185                        # RIC Simulator container internal secure port (container -> container).
+                                                         # (external ports allocated by docker)
+RIC_SIM_CERT_MOUNT_DIR="./cert"
+RIC_SIM_COMPOSE_DIR="ric"                                # Dir in simulator group for docker compose
+RIC_SIM_ALIVE_URL="/"
+
+SDNC_APP_NAME="a1controller"                             # Name of the SNDC A1 Controller container
+SDNC_DISPLAY_NAME="SDNC A1 Controller"
+SDNC_EXTERNAL_PORT=8282                                  # SNDC A1 Controller container external port (host -> container)
+SDNC_INTERNAL_PORT=8181                                  # SNDC A1 Controller container internal port (container -> container)
+SDNC_EXTERNAL_SECURE_PORT=8443                           # SNDC A1 Controller container external securee port (host -> container)
+SDNC_INTERNAL_SECURE_PORT=8443                           # SNDC A1 Controller container internal secure port (container -> container)
+SDNC_DB_APP_NAME="sdncdb"                                # Name of the SDNC DB container
+SDNC_A1_TRUSTSTORE_PASSWORD="a1adapter"                  # SDNC truststore password
+SDNC_USER="admin"                                        # SDNC username
+SDNC_PWD="Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U"   # SNDC PWD
+SDNC_API_URL="/restconf/operations/A1-ADAPTER-API:"      # Base url path for SNDC API
+SDNC_ALIVE_URL="/apidoc/explorer/"                       # Base url path for SNDC API docs (for alive check)
+SDNC_COMPOSE_DIR="sdnc"                                  # Dir in simulator_group for docker-compose
+SDNC_KARAF_LOG="/opt/opendaylight/data/log/karaf.log"    # Path to karaf log
+
+
+CONTROL_PANEL_APP_NAME="controlpanel"                    # Name of the Control Panel container
+CONTROL_PANEL_DISPLAY_NAME="Non-RT RIC Control Panel"
+CONTROL_PANEL_EXTERNAL_PORT=8080                         # Control Panel container external port (host -> container)
+CONTROL_PANEL_INTERNAL_PORT=8080                         # Control Panel container internal port (container -> container)
+CONTROL_PANEL_EXTERNAL_SECURE_PORT=8880                  # Control Panel container external port (host -> container)
+CONTROL_PANEL_INTERNAL_SECURE_PORT=8082                  # Control Panel container internal port (container -> container)
+CONTROL_PANEL_LOGPATH="/logs/nonrtric-controlpanel.log"  # Path the application log in the Control Panel container
+CONTROL_PANEL_ALIVE_URL="/"                              # Base path for alive check
+CONTROL_PANEL_COMPOSE_DIR="control_panel"                # Dir in simulator_group for docker-compose
+CONTROL_PANEL_CONFIG_MOUNT_PATH=/maven                   # Container internal path for config
+CONTROL_PANEL_CONFIG_FILE=application.properties         # Config file name
+
+HTTP_PROXY_APP_NAME="httpproxy"                          # Name of the Http Proxy container
+HTTP_PROXY_DISPLAY_NAME="Http Proxy"
+HTTP_PROXY_EXTERNAL_PORT=8780                            # Http Proxy container external port (host -> container)
+HTTP_PROXY_INTERNAL_PORT=8080                            # Http Proxy container internal port (container -> container)
+HTTP_PROXY_WEB_EXTERNAL_PORT=8781                        # Http Proxy container external port (host -> container)
+HTTP_PROXY_WEB_INTERNAL_PORT=8081                        # Http Proxy container internal port (container -> container)
+HTTP_PROXY_CONFIG_PORT=0                                 # Port number for proxy config, will be set if proxy is started
+HTTP_PROXY_CONFIG_HOST_NAME=""                           # Proxy host, will be set if proxy is started
+HTTP_PROXY_ALIVE_URL="/"                                 # Base path for alive check
+HTTP_PROXY_COMPOSE_DIR="httpproxy"                       # Dir in simulator_group for docker-compose
 
 ########################################
 # Setting for common curl-base function
 ########################################
 
 
-UUID=""                                                         # UUID used as prefix to the policy id to simulate a real UUID
-                                                                # Testscript need to set the UUID to use other this empty prefix is used
+UUID=""                                                  # UUID used as prefix to the policy id to simulate a real UUID
+                                                         # Testscript need to set the UUID to use other this empty prefix is used
 
-RESTBASE="http://localhost:"$POLICY_AGENT_EXTERNAL_PORT         # Base url to the Agent NB REST interface
-RESTBASE_SECURE="https://localhost:"$POLICY_AGENT_EXTERNAL_SECURE_PORT # Base url to the secure Agent NB REST interface
-DMAAPBASE="http://localhost:"$MR_EXTERNAL_PORT                  # Base url to the Dmaap adapter, http
-DMAAPBASE_SECURE="https://localhost:"$MR_EXTERNAL_SECURE_PORT   # Base url to the Dmaap adapter, https
-ADAPTER=$RESTBASE                                               # Adapter holds the address the agent R-APP interface (REST OR DMAAP)
-                                                                # The values of this var is swiched between the two base url when needed
index a8c852e..ad78a21 100644 (file)
@@ -18,6 +18,7 @@
 #
 #Profile for ONAP honolulu release
 TEST_ENV_PROFILE="ONAP-HONOLULU"
+FLAVOUR="ONAP"
 
 ########################################
 ## Nexus repo settings
@@ -60,7 +61,7 @@ NEXUS_RELEASE_REPO_ONAP=$NEXUS_RELEASE_REPO
 POLICY_AGENT_IMAGE_BASE="onap/ccsdk-oran-a1policymanagementservice"
 POLICY_AGENT_IMAGE_TAG_LOCAL="1.1.1-SNAPSHOT"
 POLICY_AGENT_IMAGE_TAG_REMOTE_SNAPSHOT="1.1.1-SNAPSHOT"
-POLICY_AGENT_IMAGE_TAG_REMOTE="1.1.1-SNAPSHOT" #Will use snapshot repo
+POLICY_AGENT_IMAGE_TAG_REMOTE="1.1.1-STAGING-latest" #Will use snapshot repo
 POLICY_AGENT_IMAGE_TAG_REMOTE_RELEASE="1.1.1"
 
 
@@ -127,6 +128,27 @@ PROD_STUB_IMAGE_TAG_LOCAL="latest"
 #No remote image for producer stub, local image always used
 
 
+#Http proxy remote image and tag
+HTTP_PROXY_IMAGE_BASE="mitmproxy/mitmproxy"
+HTTP_PROXY_IMAGE_TAG_REMOTE_PROXY="6.0.2"
+#No local image for SSDNC DB, remote image always used
+
+#ONAP Zookeeper remote image and tag
+ONAP_ZOOKEEPER_IMAGE_BASE="onap/dmaap/zookeeper"
+ONAP_ZOOKEEPER_IMAGE_TAG_REMOTE_RELEASE_ONAP="6.0.3"
+#No local image for ONAP Zookeeper, remote image always used
+
+#ONAP Kafka remote image and tag
+ONAP_KAFKA_IMAGE_BASE="onap/dmaap/kafka111"
+ONAP_KAFKA_IMAGE_TAG_REMOTE_RELEASE_ONAP="1.0.4"
+#No local image for ONAP Kafka, remote image always used
+
+#ONAP DMAAP-MR remote image and tag
+ONAP_DMAAPMR_IMAGE_BASE="onap/dmaap/dmaap-mr"
+ONAP_DMAAPMR_IMAGE_TAG_REMOTE_RELEASE_ONAP="1.1.18"
+#No local image for ONAP DMAAP-MR, remote image always used
+
+
 # List of app short names produced by the project
 PROJECT_IMAGES_APP_NAMES="PA SDNC"
 
@@ -141,125 +163,178 @@ ONAP_IMAGES_APP_NAMES=""   # Not used
 # Detailed settings per app
 ########################################
 
-# Vars used by docker-compose need to be exported
 
+DOCKER_SIM_NWNAME="nonrtric-docker-net"                  # Name of docker private network
+
+KUBE_NONRTRIC_NAMESPACE="nonrtric"                       # Namespace for all nonrtric components
+KUBE_SIM_NAMESPACE="nonrtric-ft"                         # Namespace for simulators (except MR and RICSIM)
+KUBE_ONAP_NAMESPACE="onap"                               # Namespace for onap (only message router)
+
+POLICY_AGENT_EXTERNAL_PORT=8081                          # Policy Agent container external port (host -> container)
+POLICY_AGENT_INTERNAL_PORT=8081                          # Policy Agent container internal port (container -> container)
+POLICY_AGENT_EXTERNAL_SECURE_PORT=8433                   # Policy Agent container external secure port (host -> container)
+POLICY_AGENT_INTERNAL_SECURE_PORT=8433                   # Policy Agent container internal secure port (container -> container)
+POLICY_AGENT_APIS="V1 V2"                                # Supported northbound api versions
+PMS_VERSION="V2"                                         # Tested version of northbound API
+PMS_API_PREFIX=""                                        # api url prefix, only for V2
+
+POLICY_AGENT_APP_NAME="policymanagementservice"          # Name for Policy Agent container
+POLICY_AGENT_DISPLAY_NAME="Policy Management Service"
+POLICY_AGENT_HOST_MNT_DIR="./mnt"                        # Mounted dir, relative to compose file, on the host
+POLICY_AGENT_LOGPATH="/var/log/policy-agent/application.log" # Path the application log in the Policy Agent container
+POLICY_AGENT_APP_NAME_ALIAS="policy-agent-container"     # Alias name, name used by the control panel
+POLICY_AGENT_CONFIG_KEY="policy-agent"                   # Key for consul config
+POLICY_AGENT_PKG_NAME="org.onap.ccsdk.oran.a1policymanagementservice"  # Java base package name
+POLICY_AGENT_ACTUATOR="/actuator/loggers/$POLICY_AGENT_PKG_NAME" # Url for trace/debug
+POLICY_AGENT_ALIVE_URL="/v2/status"                         # Base path for alive check
+POLICY_AGENT_COMPOSE_DIR="policy_agent"                  # Dir in simulator_group for docker-compose
+POLICY_AGENT_CONFIG_MOUNT_PATH="/opt/app/policy-agent/config" # Path in container for config file
+POLICY_AGENT_DATA_MOUNT_PATH="/opt/app/policy-agent/data" # Path in container for data file
+POLICY_AGENT_CONFIG_FILE="application.yaml"              # Container config file name
+POLICY_AGENT_DATA_FILE="application_configuration.json"  # Container data file name
+
+ECS_APP_NAME="enrichmentservice"                         # Name for ECS container
+ECS_DISPLAY_NAME="Enrichment Coordinator Service"        # Display name for ECS container
+ECS_EXTERNAL_PORT=8083                                   # ECS container external port (host -> container)
+ECS_INTERNAL_PORT=8083                                   # ECS container internal port (container -> container)
+ECS_EXTERNAL_SECURE_PORT=8434                            # ECS container external secure port (host -> container)
+ECS_INTERNAL_SECURE_PORT=8434                            # ECS container internal secure port (container -> container)
 
-export DOCKER_SIM_NWNAME="nonrtric-docker-net"                  # Name of docker private network
-
-export POLICY_AGENT_EXTERNAL_PORT=8081                          # Policy Agent container external port (host -> container)
-export POLICY_AGENT_INTERNAL_PORT=8081                          # Policy Agent container internal port (container -> container)
-export POLICY_AGENT_EXTERNAL_SECURE_PORT=8433                   # Policy Agent container external secure port (host -> container)
-export POLICY_AGENT_INTERNAL_SECURE_PORT=8433                   # Policy Agent container internal secure port (container -> container)
-export POLICY_AGENT_APIS="V1 V2"                                # Supported northbound api versions
-export PMS_VERSION="V2"                                         # Tested version of northbound API
-
-export POLICY_AGENT_APP_NAME="policy-agent"                     # Name for Policy Agent container
-POLICY_AGENT_LOGPATH="/var/log/policy-agent/application.log"    # Path the application log in the Policy Agent container
-export POLICY_AGENT_APP_NAME_ALIAS="policy-agent-container"     # Alias name, name used by the control panel
-
-export ECS_EXTERNAL_PORT=8083                                   # ECS container external port (host -> container)
-export ECS_INTERNAL_PORT=8083                                   # ECS container internal port (container -> container)
-export ECS_EXTERNAL_SECURE_PORT=8434                            # ECS container external secure port (host -> container)
-export ECS_INTERNAL_SECURE_PORT=8434                            # ECS container internal secure port (container -> container)
-
-export ECS_APP_NAME="ecs"                                       # Name for ECS container
 ECS_LOGPATH="/var/log/enrichment-coordinator-service/application.log" # Path the application log in the ECS container
-export ECS_APP_NAME_ALIAS="enrichment-service-container"        # Alias name, name used by the control panel
-export ECS_HOST_MNT_DIR="./mnt"                                 # Mounted dir, relative to compose file, on the host
-export ECS_CONTAINER_MNT_DIR="/var/enrichment-coordinator-service" # Mounted dir in the container
-
-export MR_EXTERNAL_PORT=3905                                    # MR stub container external port (host -> container)
-export MR_INTERNAL_PORT=3905                                    # MR stub container internal port (container -> container)
-export MR_EXTERNAL_SECURE_PORT=3906                             # MR stub container external secure port (host -> container)
-export MR_INTERNAL_SECURE_PORT=3906                             # MR stub container internal secure port (container -> container)
-export MR_APP_NAME="message-router"                             # Name for the MR
-export MR_READ_URL="/events/A1-POLICY-AGENT-READ/users/policy-agent?timeout=15000&limit=100" # Path to read messages from MR
-export MR_WRITE_URL="/events/A1-POLICY-AGENT-WRITE"             # Path write messages to MR
-
-export CR_EXTERNAL_PORT=8090                                    # Callback receiver container external port (host -> container)
-export CR_INTERNAL_PORT=8090                                    # Callback receiver container internal port (container -> container)
-export CR_EXTERNAL_SECURE_PORT=8091                             # Callback receiver container external secure port (host -> container)
-export CR_INTERNAL_SECURE_PORT=8091                             # Callback receiver container internal secure port (container -> container)
-export CR_APP_NAME="callback-receiver"                          # Name for the Callback receiver
-export CR_APP_CALLBACK="/callbacks"                             # Url for callbacks
-
-export PROD_STUB_EXTERNAL_PORT=8092                             # Producer stub container external port (host -> container)
-export PROD_STUB_INTERNAL_PORT=8092                             # Producer stub container internal port (container -> container)
-export PROD_STUB_EXTERNAL_SECURE_PORT=8093                      # Producer stub container external secure port (host -> container)
-export PROD_STUB_INTERNAL_SECURE_PORT=8093                      # Producer stub container internal secure port (container -> container)
-export PROD_STUB_APP_NAME="producer-stub"                       # Name for the Producer stub
-
-export CONSUL_HOST="consul-server"                              # Host name of consul
-export CONSUL_EXTERNAL_PORT=8500                                # Consul container external port (host -> container)
-export CONSUL_INTERNAL_PORT=8500                                # Consul container internal port (container -> container)
-export CONSUL_APP_NAME="polman-consul"                          # Name for consul container
-
-export CBS_APP_NAME="polman-cbs"                                # Name for CBS container
-export CBS_EXTERNAL_PORT=10000                                  # CBS container external port (host -> container)
-export CBS_INTERNAL_PORT=10000                                  # CBS container internal port (container -> container)
-export CONFIG_BINDING_SERVICE="config-binding-service"          # Host name of CBS
-
-export RIC_SIM_BASE="g"                                         # Base name of the RIC Simulator container, shall be the group code
-                                                                # Note, a prefix is added to each container name by the .env file in the 'ric' dir
-RIC_SIM_PREFIX="ricsim"                                         # Prefix added to ric container name, added in the .env file in the 'ric' dir
-                                                                # This prefix can be changed from the command line
-export RIC_SIM_INTERNAL_PORT=8085                               # RIC Simulator container internal port (container -> container).
-                                                                # (external ports allocated by docker)
-export RIC_SIM_INTERNAL_SECURE_PORT=8185                        # RIC Simulator container internal secure port (container -> container).
-                                                                # (external ports allocated by docker)
-
-export SDNC_APP_NAME="a1-controller"                            # Name of the SNDC A1 Controller container
-export SDNC_EXTERNAL_PORT=8282                                  # SNDC A1 Controller container external port (host -> container)
-export SDNC_INTERNAL_PORT=8181                                  # SNDC A1 Controller container internal port (container -> container)
-export SDNC_EXTERNAL_SECURE_PORT=8443                           # SNDC A1 Controller container external securee port (host -> container)
-export SDNC_INTERNAL_SECURE_PORT=8443                           # SNDC A1 Controller container internal secure port (container -> container)
-export SDNC_DB_APP_NAME="sdnc-db"                               # Name of the SDNC DB container
-export SDNC_A1_TRUSTSTORE_PASSWORD="a1adapter"                  # SDNC truststore password
-SDNC_USER="admin"                                               # SDNC username
-SDNC_PWD="Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U"          # SNDC PWD
-SDNC_API_URL="/restconf/operations/A1-ADAPTER-API:"             # Base url path for SNDC API
-SDNC_ALIVE_URL="/apidoc/explorer/"                              # Base url path for SNDC API docs (for alive check)
-SDNC_KARAF_LOG="/opt/opendaylight/data/log/karaf.log"           # Path to karaf log
-
-export RAPP_CAT_APP_NAME="rapp-catalogue"                      # Name for the RAPP Catalogue
-export RAPP_CAT_EXTERNAL_PORT=8680                             # RAPP Catalogue container external port (host -> container)
-export RAPP_CAT_INTERNAL_PORT=8080                             # RAPP Catalogue container internal port (container -> container)
-export RAPP_CAT_EXTERNAL_SECURE_PORT=8633                      # RAPP Catalogue container external secure port (host -> container)
-export RAPP_CAT_INTERNAL_SECURE_PORT=8433                      # RAPP Catalogue container internal secure port (container -> container)
-
-export CONTROL_PANEL_APP_NAME="control-panel"                   # Name of the Control Panel container
-export CONTROL_PANEL_EXTERNAL_PORT=8080                         # Control Panel container external port (host -> container)
-export CONTROL_PANEL_INTERNAL_PORT=8080                         # Control Panel container external port (host -> container)
-CONTROL_PANEL_LOGPATH="/logs/nonrtric-controlpanel.log"         # Path the application log in the Control Panel container
-
+ECS_APP_NAME_ALIAS="enrichment-service-container"        # Alias name, name used by the control panel
+ECS_HOST_MNT_DIR="./mnt/db"                              # Mounted dir, relative to compose file, on the host
+ECS_CONTAINER_MNT_DIR="/var/enrichment-coordinator-service" # Mounted dir in the container
+ECS_ACTUATOR="/actuator/loggers/org.oransc.enrichment"   # Url for trace/debug
+ECS_CERT_MOUNT_DIR="./cert"
+ECS_ALIVE_URL="/status"                                  # Base path for alive check
+ECS_COMPOSE_DIR="ecs"                                    # Dir in simulator_group for docker-compose
+ECS_CONFIG_MOUNT_PATH=/opt/app/enrichment-coordinator-service/config # Internal container path for configuration
+ECS_CONFIG_FILE=application.yaml                         # Config file name
+
+MR_DMAAP_APP_NAME="dmaap-mr"                             # Name for the Dmaap MR
+MR_STUB_APP_NAME="mr-stub"                               # Name of the MR stub
+MR_DMAAP_DISPLAY_NAME="DMAAP Message Router"
+MR_STUB_DISPLAY_NAME="Message Router stub"
+MR_STUB_CERT_MOUNT_DIR="./cert"
+MR_EXTERNAL_PORT=3904                                    # MR dmaap/stub container external port
+MR_INTERNAL_PORT=3904                                    # MR dmaap/stub container internal port
+MR_EXTERNAL_SECURE_PORT=3905                             # MR dmaap/stub container external secure port
+MR_INTERNAL_SECURE_PORT=3905                             # MR dmaap/stub container internal secure port
+MR_DMAAP_LOCALHOST_PORT=3904                             # MR stub container external port (host -> container)
+MR_STUB_LOCALHOST_PORT=3908                              # MR stub container external port (host -> container)
+MR_DMAAP_LOCALHOST_SECURE_PORT=3905                      # MR stub container internal port (container -> container)
+MR_STUB_LOCALHOST_SECURE_PORT=3909                       # MR stub container external secure port (host -> container)
+MR_READ_URL="/events/A1-POLICY-AGENT-READ/users/policy-agent?timeout=15000&limit=100" # Path to read messages from MR
+MR_WRITE_URL="/events/A1-POLICY-AGENT-WRITE"             # Path write messages to MR
+MR_READ_TOPIC="A1-POLICY-AGENT-READ"                     # Read topic
+MR_WRITE_TOPIC="A1-POLICY-AGENT-WRITE"                   # Write topic
+MR_STUB_ALIVE_URL="/"                                    # Base path for mr stub alive check
+MR_DMAAP_ALIVE_URL="/topics"                             # Base path for dmaap-mr alive check
+MR_DMAAP_COMPOSE_DIR="dmaapmr"                           # Dir in simulator_group for dmaap mr for - docker-compose
+MR_STUB_COMPOSE_DIR="mrstub"                             # Dir in simulator_group for mr stub for - docker-compose
+MR_KAFKA_APP_NAME="kafka"                                # Kafka app name
+MR_ZOOKEEPER_APP_NAME="zookeeper"                        # Zookeeper app name
+
+CR_APP_NAME="callback-receiver"                          # Name for the Callback receiver
+CR_DISPLAY_NAME="Callback Reciever"
+CR_EXTERNAL_PORT=8090                                    # Callback receiver container external port (host -> container)
+CR_INTERNAL_PORT=8090                                    # Callback receiver container internal port (container -> container)
+CR_EXTERNAL_SECURE_PORT=8091                             # Callback receiver container external secure port (host -> container)
+CR_INTERNAL_SECURE_PORT=8091                             # Callback receiver container internal secure port (container -> container)
+CR_APP_NAME="callback-receiver"                          # Name for the Callback receiver
+CR_APP_CALLBACK="/callbacks"                             # Url for callbacks
+CR_ALIVE_URL="/"                                         # Base path for alive check
+CR_COMPOSE_DIR="cr"                                      # Dir in simulator_group for docker-compose
+
+PROD_STUB_APP_NAME="producer-stub"                       # Name for the Producer stub
+PROD_STUB_DISPLAY_NAME="Producer Stub"
+PROD_STUB_EXTERNAL_PORT=8092                             # Producer stub container external port (host -> container)
+PROD_STUB_INTERNAL_PORT=8092                             # Producer stub container internal port (container -> container)
+PROD_STUB_EXTERNAL_SECURE_PORT=8093                      # Producer stub container external secure port (host -> container)
+PROD_STUB_INTERNAL_SECURE_PORT=8093                      # Producer stub container internal secure port (container -> container)
+PROD_STUB_JOB_CALLBACK="/callbacks/job"                  # Callback path for job create/update/delete
+PROD_STUB_SUPERVISION_CALLBACK="/callbacks/supervision"  # Callback path for producre supervision
+PROD_STUB_ALIVE_URL="/"                                  # Base path for alive check
+PROD_STUB_COMPOSE_DIR="prodstub"                         # Dir in simulator_group for docker-compose
+
+CONSUL_HOST="consul-server"                              # Host name of consul
+CONSUL_DISPLAY_NAME="Consul"
+CONSUL_EXTERNAL_PORT=8500                                # Consul container external port (host -> container)
+CONSUL_INTERNAL_PORT=8500                                # Consul container internal port (container -> container)
+CONSUL_APP_NAME="polman-consul"                          # Name for consul container
+CONSUL_ALIVE_URL="/ui/dc1/kv"                            # Base path for alive check
+CONSUL_CBS_COMPOSE_DIR="consul_cbs"                      # Dir in simulator group for docker compose
+
+CBS_APP_NAME="polman-cbs"                                # Name for CBS container
+CBS_DISPLAY_NAME="Config Binding Service"
+CBS_EXTERNAL_PORT=10000                                  # CBS container external port (host -> container)
+CBS_INTERNAL_PORT=10000                                  # CBS container internal port (container -> container)
+CONFIG_BINDING_SERVICE="config-binding-service"          # Host name of CBS
+CBS_ALIVE_URL="/healthcheck"                             # Base path for alive check
+
+RIC_SIM_DISPLAY_NAME="Near-RT RIC A1 Simulator"
+RIC_SIM_BASE="g"                                         # Base name of the RIC Simulator container, shall be the group code
+                                                         # Note, a prefix is added to each container name by the .env file in the 'ric' dir
+RIC_SIM_PREFIX="ricsim"                                  # Prefix added to ric container name, added in the .env file in the 'ric' dir
+                                                         # This prefix can be changed from the command line
+RIC_SIM_INTERNAL_PORT=8085                               # RIC Simulator container internal port (container -> container).
+                                                         # (external ports allocated by docker)
+RIC_SIM_INTERNAL_SECURE_PORT=8185                        # RIC Simulator container internal secure port (container -> container).
+                                                         # (external ports allocated by docker)
+RIC_SIM_CERT_MOUNT_DIR="./cert"
+RIC_SIM_COMPOSE_DIR="ric"                                # Dir in simulator group for docker compose
+RIC_SIM_ALIVE_URL="/"
+
+SDNC_APP_NAME="a1controller"                             # Name of the SNDC A1 Controller container
+SDNC_DISPLAY_NAME="SDNC A1 Controller"
+SDNC_EXTERNAL_PORT=8282                                  # SNDC A1 Controller container external port (host -> container)
+SDNC_INTERNAL_PORT=8181                                  # SNDC A1 Controller container internal port (container -> container)
+SDNC_EXTERNAL_SECURE_PORT=8443                           # SNDC A1 Controller container external securee port (host -> container)
+SDNC_INTERNAL_SECURE_PORT=8443                           # SNDC A1 Controller container internal secure port (container -> container)
+SDNC_DB_APP_NAME="sdncdb"                                # Name of the SDNC DB container
+SDNC_A1_TRUSTSTORE_PASSWORD="a1adapter"                  # SDNC truststore password
+SDNC_USER="admin"                                        # SDNC username
+SDNC_PWD="Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U"   # SNDC PWD
+SDNC_API_URL="/restconf/operations/A1-ADAPTER-API:"      # Base url path for SNDC API
+SDNC_ALIVE_URL="/apidoc/explorer/"                       # Base url path for SNDC API docs (for alive check)
+SDNC_COMPOSE_DIR="sdnc"
+SDNC_KARAF_LOG="/opt/opendaylight/data/log/karaf.log"    # Path to karaf log
+
+RAPP_CAT_APP_NAME="rappcatalogueservice"                 # Name for the RAPP Catalogue
+RAPP_CAT_DISPLAY_NAME="RAPP Catalogue Service"
+RAPP_CAT_EXTERNAL_PORT=8680                              # RAPP Catalogue container external port (host -> container)
+RAPP_CAT_INTERNAL_PORT=8080                              # RAPP Catalogue container internal port (container -> container)
+RAPP_CAT_EXTERNAL_SECURE_PORT=8633                       # RAPP Catalogue container external secure port (host -> container)
+RAPP_CAT_INTERNAL_SECURE_PORT=8433                       # RAPP Catalogue container internal secure port (container -> container)
+RAPP_CAT_ALIVE_URL="/services"                           # Base path for alive check
+RAPP_CAT_COMPOSE_DIR="rapp_catalogue"                    # Dir in simulator_group for docker-compose
+
+CONTROL_PANEL_APP_NAME="controlpanel"                    # Name of the Control Panel container
+CONTROL_PANEL_DISPLAY_NAME="Non-RT RIC Control Panel"
+CONTROL_PANEL_EXTERNAL_PORT=8080                         # Control Panel container external port (host -> container)
+CONTROL_PANEL_INTERNAL_PORT=8080                         # Control Panel container internal port (container -> container)
+CONTROL_PANEL_EXTERNAL_SECURE_PORT=8880                  # Control Panel container external port (host -> container)
+CONTROL_PANEL_INTERNAL_SECURE_PORT=8082                  # Control Panel container intternal port (container -> container)
+CONTROL_PANEL_LOGPATH="/logs/nonrtric-controlpanel.log"  # Path the application log in the Control Panel container
+CONTROL_PANEL_ALIVE_URL="/"                              # Base path for alive check
+CONTROL_PANEL_COMPOSE_DIR="control_panel"                # Dir in simulator_group for docker-compose
+CONTROL_PANEL_CONFIG_MOUNT_PATH=/maven                   # Container internal path for config
+CONTROL_PANEL_CONFIG_FILE=application.properties         # Config file name
+
+HTTP_PROXY_APP_NAME="httpproxy"                          # Name of the Http Proxy container
+HTTP_PROXY_DISPLAY_NAME="Http Proxy"
+HTTP_PROXY_EXTERNAL_PORT=8780                            # Http Proxy container external port (host -> container)
+HTTP_PROXY_INTERNAL_PORT=8080                            # Http Proxy container internal port (container -> container)
+HTTP_PROXY_WEB_EXTERNAL_PORT=8781                        # Http Proxy container external port (host -> container)
+HTTP_PROXY_WEB_INTERNAL_PORT=8081                        # Http Proxy container internal port (container -> container)
+HTTP_PROXY_CONFIG_PORT=0                                 # Port number for proxy config, will be set if proxy is started
+HTTP_PROXY_CONFIG_HOST_NAME=""                           # Proxy host, will be set if proxy is started
+HTTP_PROXY_ALIVE_URL="/"                                 # Base path for alive check
+HTTP_PROXY_COMPOSE_DIR="httpproxy"                       # Dir in simulator_group for docker-compose
 
 ########################################
 # Setting for common curl-base function
 ########################################
 
-UUID=""                                                         # UUID used as prefix to the policy id to simulate a real UUID
-                                                                # Testscript need to set the UUID to use other this empty prefix is used
-
-RESTBASE="http://localhost:"$POLICY_AGENT_EXTERNAL_PORT         # Base url to the Agent NB REST interface
-RESTBASE_SECURE="https://localhost:"$POLICY_AGENT_EXTERNAL_SECURE_PORT # Base url to the secure Agent NB REST interface
-DMAAPBASE="http://localhost:"$MR_EXTERNAL_PORT                  # Base url to the Dmaap adapter, http
-DMAAPBASE_SECURE="https://localhost:"$MR_EXTERNAL_SECURE_PORT   # Base url to the Dmaap adapter, https
-ADAPTER=$RESTBASE                                               # Adapter holds the address the agent R-APP interface (REST OR DMAAP)
-                                                                # The values of this var is swiched between the two base url when needed
-                                                                # The values of this var is swiched between the four base url when needed
-
-ECS_RESTBASE="http://localhost:"$ECS_EXTERNAL_PORT              # Base url to the ECS NB REST interface
-ECS_RESTBASE_SECURE="https://localhost:"$ECS_EXTERNAL_SECURE_PORT # Base url to the secure ECS NB REST interface
-ECS_DMAAPBASE="http://localhost:"$MR_EXTERNAL_PORT              # Base url to the Dmaap adapter, http
-ECS_DMAAPBASE_SECURE="https://localhost:"$MR_EXTERNAL_SECURE_PORT   # Base url to the Dmaap adapter, https
-ECS_ADAPTER=$ECS_RESTBASE                                       # Adapter holds the address the ECS R-APP interface (REST OR DMAAP)
-                                                                # The values of this var is swiched between the four base url when needed
-
-CR_RESTBASE="http://localhost:"$CR_EXTERNAL_PORT                # Base url to the Callback receiver REST interface
-CR_RESTBASE_SECURE="https://localhost:"$CR_EXTERNAL_SECURE_PORT # Base url to the secure Callback receiver REST interface
-CR_ADAPTER=$CR_RESTBASE                                         # Adapter holds the address the CR admin interface (REST only)
-                                                                # The values of this var is swiched between the two base url when needed
-
-RC_RESTBASE="http://localhost:"$RAPP_CAT_EXTERNAL_PORT          # Base url to the RAPP Catalogue REST interface
-RC_RESTBASE_SECURE="https://localhost:"$RAPP_CAT_EXTERNAL_SECURE_PORT # Base url to the secure RAPP Catalogue REST interface
-RC_ADAPTER=$RC_RESTBASE                                         # Adapter holds the address the RAPP Catalogue interface
\ No newline at end of file
+UUID=""                                                  # UUID used as prefix to the policy id to simulate a real UUID
+                                                         # Testscript need to set the UUID to use other this empty prefix is used
index a0f8871..156600d 100755 (executable)
@@ -18,6 +18,7 @@
 #
 #Profile for ORAN Cherry
 TEST_ENV_PROFILE="ORAN-CHERRY"
+FLAVOUR="ORAN"
 
 ########################################
 ## Nexus repo settings
@@ -139,6 +140,25 @@ PROD_STUB_IMAGE_BASE="producer-stub"
 PROD_STUB_IMAGE_TAG_LOCAL="latest"
 #No remote image for producer stub, local image always used
 
+#Http proxy remote image and tag
+HTTP_PROXY_IMAGE_BASE="mitmproxy/mitmproxy"
+HTTP_PROXY_IMAGE_TAG_REMOTE_PROXY="6.0.2"
+#No local image for Http proxy, remote image always used
+
+#ONAP Zookeeper remote image and tag
+ONAP_ZOOKEEPER_IMAGE_BASE="onap/dmaap/zookeeper"
+ONAP_ZOOKEEPER_IMAGE_TAG_REMOTE_RELEASE_ONAP="6.0.3"
+#No local image for ONAP Zookeeper, remote image always used
+
+#ONAP Kafka remote image and tag
+ONAP_KAFKA_IMAGE_BASE="onap/dmaap/kafka111"
+ONAP_KAFKA_IMAGE_TAG_REMOTE_RELEASE_ONAP="1.0.4"
+#No local image for ONAP Kafka, remote image always used
+
+#ONAP DMAAP-MR remote image and tag
+ONAP_DMAAPMR_IMAGE_BASE="onap/dmaap/dmaap-mr"
+ONAP_DMAAPMR_IMAGE_TAG_REMOTE_RELEASE_ONAP="1.1.18"
+#No local image for ONAP DMAAP-MR, remote image always used
 
 # List of app short names produced by the project
 PROJECT_IMAGES_APP_NAMES="PA ECS CP SDNC RC RICSIM"
@@ -147,131 +167,186 @@ PROJECT_IMAGES_APP_NAMES="PA ECS CP SDNC RC RICSIM"
 ORAN_IMAGES_APP_NAMES=""  # Not used
 
 # List of app short names which images pulled from ONAP
-ONAP_IMAGES_APP_NAMES="CBS"
+ONAP_IMAGES_APP_NAMES="CBS DMAAPMR"
 
 
 ########################################
 # Detailed settings per app
 ########################################
 
-# Vars used by docker-compose need to be exported
-
-export DOCKER_SIM_NWNAME="nonrtric-docker-net"                  # Name of docker private network
+DOCKER_SIM_NWNAME="nonrtric-docker-net"                  # Name of docker private network
+
+KUBE_NONRTRIC_NAMESPACE="nonrtric"                       # Namespace for all nonrtric components
+KUBE_SIM_NAMESPACE="nonrtric-ft"                         # Namespace for simulators (except MR and RICSIM)
+KUBE_ONAP_NAMESPACE="onap"                               # Namespace for onap (only message router)
+
+POLICY_AGENT_EXTERNAL_PORT=8081                          # Policy Agent container external port (host -> container)
+POLICY_AGENT_INTERNAL_PORT=8081                          # Policy Agent container internal port (container -> container)
+POLICY_AGENT_EXTERNAL_SECURE_PORT=8433                   # Policy Agent container external secure port (host -> container)
+POLICY_AGENT_INTERNAL_SECURE_PORT=8433                   # Policy Agent container internal secure port (container -> container)
+POLICY_AGENT_APIS="V1 V2"                                # Supported northbound api versions
+PMS_VERSION="V2"                                         # Tested version of northbound API
+PMS_API_PREFIX=""                                        # api url prefix, only for V2
+
+POLICY_AGENT_APP_NAME="policymanagementservice"          # Name for Policy Agent container
+POLICY_AGENT_DISPLAY_NAME="Policy Management Service"
+POLICY_AGENT_HOST_MNT_DIR="./mnt"                        # Mounted dir, relative to compose file, on the host
+POLICY_AGENT_LOGPATH="/var/log/policy-agent/application.log" # Path the application log in the Policy Agent container
+POLICY_AGENT_APP_NAME_ALIAS="policy-agent-container"     # Alias name, name used by the control panel
+POLICY_AGENT_CONFIG_KEY="policy-agent"                   # Key for consul config
+POLICY_AGENT_PKG_NAME="org.oransc.policyagent"           # Java base package name
+POLICY_AGENT_ACTUATOR="/actuator/loggers/$POLICY_AGENT_PKG_NAME" # Url for trace/debug
+POLICY_AGENT_ALIVE_URL=$PMS_API_PREFIX"/v2/status"       # Base path for alive check
+POLICY_AGENT_COMPOSE_DIR="policy_agent"                  # Dir in simulator_group for docker-compose
+POLICY_AGENT_CONFIG_MOUNT_PATH="/opt/app/policy-agent/config" # Path in container for config file
+POLICY_AGENT_DATA_MOUNT_PATH="/opt/app/policy-agent/data" # Path in container for data file
+POLICY_AGENT_CONFIG_FILE="application.yaml"              # Container config file name
+POLICY_AGENT_DATA_FILE="application_configuration.json"  # Container data file name
+
+ECS_APP_NAME="enrichmentservice"                         # Name for ECS container
+ECS_DISPLAY_NAME="Enrichment Coordinator Service"        # Display name for ECS container
+ECS_EXTERNAL_PORT=8083                                   # ECS container external port (host -> container)
+ECS_INTERNAL_PORT=8083                                   # ECS container internal port (container -> container)
+ECS_EXTERNAL_SECURE_PORT=8434                            # ECS container external secure port (host -> container)
+ECS_INTERNAL_SECURE_PORT=8434                            # ECS container internal secure port (container -> container)
 
-export POLICY_AGENT_EXTERNAL_PORT=8081                          # Policy Agent container external port (host -> container)
-export POLICY_AGENT_INTERNAL_PORT=8081                          # Policy Agent container internal port (container -> container)
-export POLICY_AGENT_EXTERNAL_SECURE_PORT=8433                   # Policy Agent container external secure port (host -> container)
-export POLICY_AGENT_INTERNAL_SECURE_PORT=8433                   # Policy Agent container internal secure port (container -> container)
-export POLICY_AGENT_APIS="V1 V2"                                # Supported northbound api versions
-export PMS_VERSION="V2"                                         # Tested version of northbound API
-
-export POLICY_AGENT_APP_NAME="policy-agent"                     # Name for Policy Agent container
-POLICY_AGENT_LOGPATH="/var/log/policy-agent/application.log"    # Path the application log in the Policy Agent container
-export POLICY_AGENT_APP_NAME_ALIAS="policy-agent-container"     # Alias name, name used by the control panel
-
-export ECS_EXTERNAL_PORT=8083                                   # ECS container external port (host -> container)
-export ECS_INTERNAL_PORT=8083                                   # ECS container internal port (container -> container)
-export ECS_EXTERNAL_SECURE_PORT=8434                            # ECS container external secure port (host -> container)
-export ECS_INTERNAL_SECURE_PORT=8434                            # ECS container internal secure port (container -> container)
-
-export ECS_APP_NAME="ecs"                                       # Name for ECS container
 ECS_LOGPATH="/var/log/enrichment-coordinator-service/application.log" # Path the application log in the ECS container
-export ECS_APP_NAME_ALIAS="enrichment-service-container"        # Alias name, name used by the control panel
-export ECS_HOST_MNT_DIR="./mnt"                                 # Mounted dir, relative to compose file, on the host
-export ECS_CONTAINER_MNT_DIR="/var/enrichment-coordinator-service" # Mounted dir in the container
-
-export MR_EXTERNAL_PORT=3905                                    # MR stub container external port (host -> container)
-export MR_INTERNAL_PORT=3905                                    # MR stub container internal port (container -> container)
-export MR_EXTERNAL_SECURE_PORT=3906                             # MR stub container external secure port (host -> container)
-export MR_INTERNAL_SECURE_PORT=3906                             # MR stub container internal secure port (container -> container)
-export MR_APP_NAME="message-router"                             # Name for the MR
-export MR_READ_URL="/events/A1-POLICY-AGENT-READ/users/policy-agent?timeout=15000&limit=100" # Path to read messages from MR
-export MR_WRITE_URL="/events/A1-POLICY-AGENT-WRITE"             # Path write messages to MR
-
-export CR_EXTERNAL_PORT=8090                                    # Callback receiver container external port (host -> container)
-export CR_INTERNAL_PORT=8090                                    # Callback receiver container internal port (container -> container)
-export CR_EXTERNAL_SECURE_PORT=8091                             # Callback receiver container external secure port (host -> container)
-export CR_INTERNAL_SECURE_PORT=8091                             # Callback receiver container internal secure port (container -> container)
-export CR_APP_NAME="callback-receiver"                          # Name for the Callback receiver
-export CR_APP_CALLBACK="/callbacks"                             # Url for callbacks
-
-export PROD_STUB_EXTERNAL_PORT=8092                             # Producer stub container external port (host -> container)
-export PROD_STUB_INTERNAL_PORT=8092                             # Producer stub container internal port (container -> container)
-export PROD_STUB_EXTERNAL_SECURE_PORT=8093                      # Producer stub container external secure port (host -> container)
-export PROD_STUB_INTERNAL_SECURE_PORT=8093                      # Producer stub container internal secure port (container -> container)
-export PROD_STUB_APP_NAME="producer-stub"                       # Name for the Producer stub
-
-export CONSUL_HOST="consul-server"                              # Host name of consul
-export CONSUL_EXTERNAL_PORT=8500                                # Consul container external port (host -> container)
-export CONSUL_INTERNAL_PORT=8500                                # Consul container internal port (container -> container)
-export CONSUL_APP_NAME="polman-consul"                          # Name for consul container
-
-export CBS_APP_NAME="polman-cbs"                                # Name for CBS container
-export CBS_EXTERNAL_PORT=10000                                  # CBS container external port (host -> container)
-export CBS_INTERNAL_PORT=10000                                  # CBS container internal port (container -> container)
-export CONFIG_BINDING_SERVICE="config-binding-service"          # Host name of CBS
-
-export RIC_SIM_BASE="g"                                         # Base name of the RIC Simulator container, shall be the group code
-                                                                # Note, a prefix is added to each container name by the .env file in the 'ric' dir
-RIC_SIM_PREFIX="ricsim"                                         # Prefix added to ric container name, added in the .env file in the 'ric' dir
-                                                                # This prefix can be changed from the command line
-export RIC_SIM_INTERNAL_PORT=8085                               # RIC Simulator container internal port (container -> container).
-                                                                # (external ports allocated by docker)
-export RIC_SIM_INTERNAL_SECURE_PORT=8185                        # RIC Simulator container internal secure port (container -> container).
-                                                                # (external ports allocated by docker)
-
-export SDNC_APP_NAME="a1-controller"                            # Name of the SNDC A1 Controller container
-export SDNC_EXTERNAL_PORT=8282                                  # SNDC A1 Controller container external port (host -> container)
-export SDNC_INTERNAL_PORT=8181                                  # SNDC A1 Controller container internal port (container -> container)
-export SDNC_EXTERNAL_SECURE_PORT=8443                           # SNDC A1 Controller container external securee port (host -> container)
-export SDNC_INTERNAL_SECURE_PORT=8443                           # SNDC A1 Controller container internal secure port (container -> container)
-export SDNC_DB_APP_NAME="sdnc-db"                               # Name of the SDNC DB container
-export SDNC_A1_TRUSTSTORE_PASSWORD=""                           # SDNC truststore password
-SDNC_USER="admin"                                               # SDNC username
-SDNC_PWD="Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U"          # SNDC PWD
-SDNC_API_URL="/restconf/operations/A1-ADAPTER-API:"             # Base url path for SNDC API
-SDNC_ALIVE_URL="/apidoc/explorer/"                              # Base url path for SNDC API docs (for alive check)
-SDNC_KARAF_LOG="/opt/opendaylight/data/log/karaf.log"           # Path to karaf log
-
-export RAPP_CAT_APP_NAME="rapp-catalogue"                      # Name for the RAPP Catalogue
-export RAPP_CAT_EXTERNAL_PORT=8680                             # RAPP Catalogue container external port (host -> container)
-export RAPP_CAT_INTERNAL_PORT=8080                             # RAPP Catalogue container internal port (container -> container)
-export RAPP_CAT_EXTERNAL_SECURE_PORT=8633                      # RAPP Catalogue container external secure port (host -> container)
-export RAPP_CAT_INTERNAL_SECURE_PORT=8433                      # RAPP Catalogue container internal secure port (container -> container)
-
-
-export CONTROL_PANEL_APP_NAME="control-panel"                   # Name of the Control Panel container
-export CONTROL_PANEL_EXTERNAL_PORT=8080                         # Control Panel container external port (host -> container)
-export CONTROL_PANEL_INTERNAL_PORT=8080                         # Control Panel container external port (host -> container)
-CONTROL_PANEL_LOGPATH="/logs/nonrtric-controlpanel.log"         # Path the application log in the Control Panel container
-
+ECS_APP_NAME_ALIAS="enrichment-service-container"        # Alias name, name used by the control panel
+ECS_HOST_MNT_DIR="./mnt/db"                              # Mounted dir, relative to compose file, on the host
+ECS_CONTAINER_MNT_DIR="/var/enrichment-coordinator-service" # Mounted dir in the container
+ECS_ACTUATOR="/actuator/loggers/org.oransc.enrichment"   # Url for trace/debug
+ECS_CERT_MOUNT_DIR="./cert"
+ECS_ALIVE_URL="/status"                                  # Base path for alive check
+ECS_COMPOSE_DIR="ecs"                                    # Dir in simulator_group for docker-compose
+ECS_CONFIG_MOUNT_PATH=/opt/app/enrichment-coordinator-service/config # Internal container path for configuration
+ECS_CONFIG_FILE=application.yaml                         # Config file name
+
+
+MR_DMAAP_APP_NAME="dmaap-mr"                             # Name for the Dmaap MR
+MR_STUB_APP_NAME="mr-stub"                               # Name of the MR stub
+MR_DMAAP_DISPLAY_NAME="DMAAP Message Router"
+MR_STUB_DISPLAY_NAME="Message Router stub"
+MR_STUB_CERT_MOUNT_DIR="./cert"
+MR_EXTERNAL_PORT=3904                                    # MR dmaap/stub container external port
+MR_INTERNAL_PORT=3904                                    # MR dmaap/stub container internal port
+MR_EXTERNAL_SECURE_PORT=3905                             # MR dmaap/stub container external secure port
+MR_INTERNAL_SECURE_PORT=3905                             # MR dmaap/stub container internal secure port
+MR_DMAAP_LOCALHOST_PORT=3904                             # MR stub container external port (host -> container)
+MR_STUB_LOCALHOST_PORT=3908                              # MR stub container external port (host -> container)
+MR_DMAAP_LOCALHOST_SECURE_PORT=3905                      # MR stub container internal port (container -> container)
+MR_STUB_LOCALHOST_SECURE_PORT=3909                       # MR stub container external secure port (host -> container)
+MR_READ_URL="/events/A1-POLICY-AGENT-READ/users/policy-agent?timeout=15000&limit=100" # Path to read messages from MR
+MR_WRITE_URL="/events/A1-POLICY-AGENT-WRITE"             # Path write messages to MR
+MR_READ_TOPIC="A1-POLICY-AGENT-READ"                     # Read topic
+MR_WRITE_TOPIC="A1-POLICY-AGENT-WRITE"                   # Write topic
+MR_STUB_ALIVE_URL="/"                                    # Base path for mr stub alive check
+MR_DMAAP_ALIVE_URL="/topics"                             # Base path for dmaap-mr alive check
+MR_DMAAP_COMPOSE_DIR="dmaapmr"                           # Dir in simulator_group for dmaap mr for - docker-compose
+MR_STUB_COMPOSE_DIR="mrstub"                             # Dir in simulator_group for mr stub for - docker-compose
+MR_KAFKA_APP_NAME="kafka"                                # Kafka app name
+MR_ZOOKEEPER_APP_NAME="zookeeper"                        # Zookeeper app name
+
+
+CR_APP_NAME="callback-receiver"                          # Name for the Callback receiver
+CR_DISPLAY_NAME="Callback Reciever"
+CR_EXTERNAL_PORT=8090                                    # Callback receiver container external port (host -> container)
+CR_INTERNAL_PORT=8090                                    # Callback receiver container internal port (container -> container)
+CR_EXTERNAL_SECURE_PORT=8091                             # Callback receiver container external secure port (host -> container)
+CR_INTERNAL_SECURE_PORT=8091                             # Callback receiver container internal secure port (container -> container)
+CR_APP_CALLBACK="/callbacks"                             # Url for callbacks
+CR_ALIVE_URL="/"                                         # Base path for alive check
+CR_COMPOSE_DIR="cr"                                      # Dir in simulator_group for docker-compose
+
+PROD_STUB_APP_NAME="producer-stub"                       # Name for the Producer stub
+PROD_STUB_DISPLAY_NAME="Producer Stub"
+PROD_STUB_EXTERNAL_PORT=8092                             # Producer stub container external port (host -> container)
+PROD_STUB_INTERNAL_PORT=8092                             # Producer stub container internal port (container -> container)
+PROD_STUB_EXTERNAL_SECURE_PORT=8093                      # Producer stub container external secure port (host -> container)
+PROD_STUB_INTERNAL_SECURE_PORT=8093                      # Producer stub container internal secure port (container -> container)
+PROD_STUB_JOB_CALLBACK="/callbacks/job"                  # Callback path for job create/update/delete
+PROD_STUB_SUPERVISION_CALLBACK="/callbacks/supervision"  # Callback path for producre supervision
+PROD_STUB_ALIVE_URL="/"                                  # Base path for alive check
+PROD_STUB_COMPOSE_DIR="prodstub"                         # Dir in simulator_group for docker-compose
+
+CONSUL_HOST="consul-server"                              # Host name of consul
+CONSUL_DISPLAY_NAME="Consul"
+CONSUL_EXTERNAL_PORT=8500                                # Consul container external port (host -> container)
+CONSUL_INTERNAL_PORT=8500                                # Consul container internal port (container -> container)
+CONSUL_APP_NAME="polman-consul"                          # Name for consul container
+CONSUL_ALIVE_URL="/ui/dc1/kv"                            # Base path for alive check
+CONSUL_CBS_COMPOSE_DIR="consul_cbs"                      # Dir in simulator group for docker compose
+
+CBS_APP_NAME="polman-cbs"                                # Name for CBS container
+CBS_DISPLAY_NAME="Config Binding Service"
+CBS_EXTERNAL_PORT=10000                                  # CBS container external port (host -> container)
+CBS_INTERNAL_PORT=10000                                  # CBS container internal port (container -> container)
+CONFIG_BINDING_SERVICE="config-binding-service"          # Host name of CBS
+CBS_ALIVE_URL="/healthcheck"                             # Base path for alive check
+
+RIC_SIM_DISPLAY_NAME="Near-RT RIC A1 Simulator"
+RIC_SIM_BASE="g"                                         # Base name of the RIC Simulator container, shall be the group code
+                                                         # Note, a prefix is added to each container name by the .env file in the 'ric' dir
+RIC_SIM_PREFIX="ricsim"                                  # Prefix added to ric container name, added in the .env file in the 'ric' dir
+                                                         # This prefix can be changed from the command line
+RIC_SIM_INTERNAL_PORT=8085                               # RIC Simulator container internal port (container -> container).
+                                                         # (external ports allocated by docker)
+RIC_SIM_INTERNAL_SECURE_PORT=8185                        # RIC Simulator container internal secure port (container -> container).
+                                                         # (external ports allocated by docker)
+RIC_SIM_CERT_MOUNT_DIR="./cert"
+
+RIC_SIM_COMPOSE_DIR="ric"                                # Dir in simulator group for docker compose
+RIC_SIM_ALIVE_URL="/"                                    # Base path for alive check
+
+SDNC_APP_NAME="a1controller"                             # Name of the SNDC A1 Controller container
+SDNC_DISPLAY_NAME="SDNC A1 Controller"
+SDNC_EXTERNAL_PORT=8282                                  # SNDC A1 Controller container external port (host -> container)
+SDNC_INTERNAL_PORT=8181                                  # SNDC A1 Controller container internal port (container -> container)
+SDNC_EXTERNAL_SECURE_PORT=8443                           # SNDC A1 Controller container external securee port (host -> container)
+SDNC_INTERNAL_SECURE_PORT=8443                           # SNDC A1 Controller container internal secure port (container -> container)
+SDNC_DB_APP_NAME="sdncdb"                                # Name of the SDNC DB container
+SDNC_A1_TRUSTSTORE_PASSWORD=""                           # SDNC truststore password
+SDNC_USER="admin"                                        # SDNC username
+SDNC_PWD="Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U"   # SNDC PWD
+SDNC_API_URL="/restconf/operations/A1-ADAPTER-API:"      # Base url path for SNDC API
+SDNC_ALIVE_URL="/apidoc/explorer/"                       # Base url path for SNDC API docs (for alive check)
+SDNC_COMPOSE_DIR="sdnc"                                  # Dir in simulator_group for docker-compose
+SDNC_KARAF_LOG="/opt/opendaylight/data/log/karaf.log"    # Path to karaf log
+
+RAPP_CAT_APP_NAME="rappcatalogueservice"                 # Name for the RAPP Catalogue
+RAPP_CAT_DISPLAY_NAME="RAPP Catalogue Service"
+RAPP_CAT_EXTERNAL_PORT=8680                              # RAPP Catalogue container external port (host -> container)
+RAPP_CAT_INTERNAL_PORT=8080                              # RAPP Catalogue container internal port (container -> container)
+RAPP_CAT_EXTERNAL_SECURE_PORT=8633                       # RAPP Catalogue container external secure port (host -> container)
+RAPP_CAT_INTERNAL_SECURE_PORT=8433                       # RAPP Catalogue container internal secure port (container -> container)
+RAPP_CAT_ALIVE_URL="/services"                           # Base path for alive check
+RAPP_CAT_COMPOSE_DIR="rapp_catalogue"                    # Dir in simulator_group for docker-compose
+
+CONTROL_PANEL_APP_NAME="controlpanel"                    # Name of the Control Panel container
+CONTROL_PANEL_DISPLAY_NAME="Non-RT RIC Control Panel"
+CONTROL_PANEL_EXTERNAL_PORT=8080                         # Control Panel container external port (host -> container)
+CONTROL_PANEL_INTERNAL_PORT=8080                         # Control Panel container internal port (container -> container)
+CONTROL_PANEL_EXTERNAL_SECURE_PORT=8880                  # Control Panel container external port (host -> container)
+CONTROL_PANEL_INTERNAL_SECURE_PORT=8082                  # Control Panel container internal port (container -> container)
+CONTROL_PANEL_LOGPATH="/logs/nonrtric-controlpanel.log"  # Path the application log in the Control Panel container
+CONTROL_PANEL_ALIVE_URL="/"                              # Base path for alive check
+CONTROL_PANEL_COMPOSE_DIR="control_panel"                # Dir in simulator_group for docker-compose
+CONTROL_PANEL_CONFIG_MOUNT_PATH=/maven                   # Container internal path for config
+CONTROL_PANEL_CONFIG_FILE=application.properties         # Config file name
+
+HTTP_PROXY_APP_NAME="httpproxy"                          # Name of the Http Proxy container
+HTTP_PROXY_DISPLAY_NAME="Http Proxy"
+HTTP_PROXY_EXTERNAL_PORT=8780                            # Http Proxy container external port (host -> container)
+HTTP_PROXY_INTERNAL_PORT=8080                            # Http Proxy container internal port (container -> container)
+HTTP_PROXY_WEB_EXTERNAL_PORT=8781                        # Http Proxy container external port (host -> container)
+HTTP_PROXY_WEB_INTERNAL_PORT=8081                        # Http Proxy container internal port (container -> container)
+HTTP_PROXY_CONFIG_PORT=0                                 # Port number for proxy config, will be set if proxy is started
+HTTP_PROXY_CONFIG_HOST_NAME=""                           # Proxy host, will be set if proxy is started
+HTTP_PROXY_ALIVE_URL="/"                                 # Base path for alive check
+HTTP_PROXY_COMPOSE_DIR="httpproxy"                       # Dir in simulator_group for docker-compose
 
 ########################################
 # Setting for common curl-base function
 ########################################
 
-UUID=""                                                         # UUID used as prefix to the policy id to simulate a real UUID
-                                                                # Testscript need to set the UUID otherwise this empty prefix is used
-
-RESTBASE="http://localhost:"$POLICY_AGENT_EXTERNAL_PORT         # Base url to the Agent NB REST interface
-RESTBASE_SECURE="https://localhost:"$POLICY_AGENT_EXTERNAL_SECURE_PORT # Base url to the secure Agent NB REST interface
-DMAAPBASE="http://localhost:"$MR_EXTERNAL_PORT                  # Base url to the Dmaap adapter, http
-DMAAPBASE_SECURE="https://localhost:"$MR_EXTERNAL_SECURE_PORT   # Base url to the Dmaap adapter, https
-ADAPTER=$RESTBASE                                               # Adapter holds the address the agent R-APP interface (REST OR DMAAP)
-                                                                # The values of this var is swiched between the four base url when needed
-
-ECS_RESTBASE="http://localhost:"$ECS_EXTERNAL_PORT              # Base url to the ECS NB REST interface
-ECS_RESTBASE_SECURE="https://localhost:"$ECS_EXTERNAL_SECURE_PORT # Base url to the secure ECS NB REST interface
-ECS_DMAAPBASE="http://localhost:"$MR_EXTERNAL_PORT              # Base url to the Dmaap adapter, http
-ECS_DMAAPBASE_SECURE="https://localhost:"$MR_EXTERNAL_SECURE_PORT   # Base url to the Dmaap adapter, https
-ECS_ADAPTER=$ECS_RESTBASE                                       # Adapter holds the address the ECS R-APP interface (REST OR DMAAP)
-                                                                # The values of this var is swiched between the four base url when needed
-
-CR_RESTBASE="http://localhost:"$CR_EXTERNAL_PORT                # Base url to the Callback receiver REST interface
-CR_RESTBASE_SECURE="https://localhost:"$CR_EXTERNAL_SECURE_PORT # Base url to the secure Callback receiver REST interface
-CR_ADAPTER=$CR_RESTBASE                                         # Adapter holds the address the CR admin interface (REST only)
-                                                                # The values of this var is swiched between the two base url when needed
-
-RC_RESTBASE="http://localhost:"$RAPP_CAT_EXTERNAL_PORT          # Base url to the RAPP Catalogue REST interface
-RC_RESTBASE_SECURE="https://localhost:"$RAPP_CAT_EXTERNAL_SECURE_PORT # Base url to the secure RAPP Catalogue REST interface
-RC_ADAPTER=$RC_RESTBASE                                         # Adapter holds the address the RAPP Catalogue interface
\ No newline at end of file
+UUID=""                                                   # UUID used as prefix to the policy id to simulate a real UUID
+                                                          # Testscript need to set the UUID otherwise this empty prefix is used
index 637e5c1..bd75908 100755 (executable)
@@ -18,6 +18,7 @@
 #
 #Profile for ORAN Cherry
 TEST_ENV_PROFILE="ORAN-DAWN"
+FLAVOUR="ORAN"
 
 ########################################
 ## Nexus repo settings
@@ -80,12 +81,19 @@ CONTROL_PANEL_IMAGE_TAG_REMOTE="2.2.0"
 CONTROL_PANEL_IMAGE_TAG_REMOTE_RELEASE="2.2.0"
 
 
-# SDNC A1 Controller image and tags
+# SDNC A1 Controller image and tags - still using cherry version, no new version for dawn
 SDNC_A1_CONTROLLER_IMAGE_BASE="o-ran-sc/nonrtric-a1-controller"
-SDNC_A1_CONTROLLER_IMAGE_TAG_LOCAL="2.1.0-SNAPSHOT"
-SDNC_A1_CONTROLLER_IMAGE_TAG_REMOTE_SNAPSHOT="2.1.0-SNAPSHOT"
-SDNC_A1_CONTROLLER_IMAGE_TAG_REMOTE="2.1.0"
-SDNC_A1_CONTROLLER_IMAGE_TAG_REMOTE_RELEASE="2.1.0"
+SDNC_A1_CONTROLLER_IMAGE_TAG_LOCAL="2.0.1-SNAPSHOT"
+SDNC_A1_CONTROLLER_IMAGE_TAG_REMOTE_SNAPSHOT="2.0.1-SNAPSHOT"
+SDNC_A1_CONTROLLER_IMAGE_TAG_REMOTE="2.0.1"
+SDNC_A1_CONTROLLER_IMAGE_TAG_REMOTE_RELEASE="2.0.1"
+
+# SDNC A1 Controller image and tags - intended versions for dawn - not yet present
+# SDNC_A1_CONTROLLER_IMAGE_BASE="o-ran-sc/nonrtric-a1-controller"
+# SDNC_A1_CONTROLLER_IMAGE_TAG_LOCAL="2.1.0-SNAPSHOT"
+# SDNC_A1_CONTROLLER_IMAGE_TAG_REMOTE_SNAPSHOT="2.1.0-SNAPSHOT"
+# SDNC_A1_CONTROLLER_IMAGE_TAG_REMOTE="2.1.0"
+# SDNC_A1_CONTROLLER_IMAGE_TAG_REMOTE_RELEASE="2.1.0"
 
 
 #SDNC DB remote image and tag
@@ -102,7 +110,7 @@ RAPP_CAT_IMAGE_TAG_REMOTE="1.1.0"
 RAPP_CAT_IMAGE_TAG_REMOTE_RELEASE="1.1.0"
 
 
-# Near RT RIC Simulator image and tags
+# Near RT RIC Simulator image and tags - same version as cherry
 RIC_SIM_IMAGE_BASE="o-ran-sc/a1-simulator"
 RIC_SIM_IMAGE_TAG_LOCAL="latest"
 RIC_SIM_IMAGE_TAG_REMOTE_SNAPSHOT="2.1.0-SNAPSHOT"
@@ -139,6 +147,25 @@ PROD_STUB_IMAGE_BASE="producer-stub"
 PROD_STUB_IMAGE_TAG_LOCAL="latest"
 #No remote image for producer stub, local image always used
 
+#Http proxy remote image and tag
+HTTP_PROXY_IMAGE_BASE="mitmproxy/mitmproxy"
+HTTP_PROXY_IMAGE_TAG_REMOTE_PROXY="6.0.2"
+#No local image for SSDNC DB, remote image always used
+
+#ONAP Zookeeper remote image and tag
+ONAP_ZOOKEEPER_IMAGE_BASE="onap/dmaap/zookeeper"
+ONAP_ZOOKEEPER_IMAGE_TAG_REMOTE_RELEASE_ONAP="6.0.3"
+#No local image for ONAP Zookeeper, remote image always used
+
+#ONAP Kafka remote image and tag
+ONAP_KAFKA_IMAGE_BASE="onap/dmaap/kafka111"
+ONAP_KAFKA_IMAGE_TAG_REMOTE_RELEASE_ONAP="1.0.4"
+#No local image for ONAP Kafka, remote image always used
+
+#ONAP DMAAP-MR remote image and tag
+ONAP_DMAAPMR_IMAGE_BASE="onap/dmaap/dmaap-mr"
+ONAP_DMAAPMR_IMAGE_TAG_REMOTE_RELEASE_ONAP="1.1.18"
+#No local image for ONAP DMAAP-MR, remote image always used
 
 # List of app short names produced by the project
 PROJECT_IMAGES_APP_NAMES="PA ECS CP SDNC RC RICSIM"
@@ -147,130 +174,186 @@ PROJECT_IMAGES_APP_NAMES="PA ECS CP SDNC RC RICSIM"
 ORAN_IMAGES_APP_NAMES=""  # Not used
 
 # List of app short names which images pulled from ONAP
-ONAP_IMAGES_APP_NAMES="CBS"
+ONAP_IMAGES_APP_NAMES="CBS DMAAPMR"
 
 
 ########################################
 # Detailed settings per app
 ########################################
 
-# Common env var for auto-test. Vars used by docker-compose need to be exported
-export DOCKER_SIM_NWNAME="nonrtric-docker-net"                  # Name of docker private network
+DOCKER_SIM_NWNAME="nonrtric-docker-net"                  # Name of docker private network
+
+KUBE_NONRTRIC_NAMESPACE="nonrtric"                       # Namespace for all nonrtric components
+KUBE_SIM_NAMESPACE="nonrtric-ft"                         # Namespace for simulators (except MR and RICSIM)
+KUBE_ONAP_NAMESPACE="onap"                               # Namespace for onap (only message router)
+
+POLICY_AGENT_EXTERNAL_PORT=8081                          # Policy Agent container external port (host -> container)
+POLICY_AGENT_INTERNAL_PORT=8081                          # Policy Agent container internal port (container -> container)
+POLICY_AGENT_EXTERNAL_SECURE_PORT=8433                   # Policy Agent container external secure port (host -> container)
+POLICY_AGENT_INTERNAL_SECURE_PORT=8433                   # Policy Agent container internal secure port (container -> container)
+POLICY_AGENT_APIS="V1 V2"                                # Supported northbound api versions
+PMS_VERSION="V2"                                         # Tested version of northbound API
+PMS_API_PREFIX=""                                        # api url prefix, only for V2
+
+POLICY_AGENT_APP_NAME="policymanagementservice"          # Name for Policy Agent container
+POLICY_AGENT_DISPLAY_NAME="Policy Management Service"
+POLICY_AGENT_HOST_MNT_DIR="./mnt"                        # Mounted dir, relative to compose file, on the host
+POLICY_AGENT_LOGPATH="/var/log/policy-agent/application.log" # Path the application log in the Policy Agent container
+POLICY_AGENT_APP_NAME_ALIAS="policy-agent-container"     # Alias name, name used by the control panel
+POLICY_AGENT_CONFIG_KEY="policy-agent"                   # Key for consul config
+POLICY_AGENT_PKG_NAME="org.oransc.policyagent"           # Java base package name
+POLICY_AGENT_ACTUATOR="/actuator/loggers/$POLICY_AGENT_PKG_NAME" # Url for trace/debug
+POLICY_AGENT_ALIVE_URL=$PMS_API_PREFIX"/v2/status"       # Base path for alive check
+POLICY_AGENT_COMPOSE_DIR="policy_agent"                  # Dir in simulator_group for docker-compose
+POLICY_AGENT_CONFIG_MOUNT_PATH="/opt/app/policy-agent/config" # Path in container for config file
+POLICY_AGENT_DATA_MOUNT_PATH="/opt/app/policy-agent/data" # Path in container for data file
+POLICY_AGENT_CONFIG_FILE="application.yaml"              # Container config file name
+POLICY_AGENT_DATA_FILE="application_configuration.json"  # Container data file name
+
+ECS_APP_NAME="enrichmentservice"                         # Name for ECS container
+ECS_DISPLAY_NAME="Enrichment Coordinator Service"        # Display name for ECS container
+ECS_EXTERNAL_PORT=8083                                   # ECS container external port (host -> container)
+ECS_INTERNAL_PORT=8083                                   # ECS container internal port (container -> container)
+ECS_EXTERNAL_SECURE_PORT=8434                            # ECS container external secure port (host -> container)
+ECS_INTERNAL_SECURE_PORT=8434                            # ECS container internal secure port (container -> container)
 
-export POLICY_AGENT_EXTERNAL_PORT=8081                          # Policy Agent container external port (host -> container)
-export POLICY_AGENT_INTERNAL_PORT=8081                          # Policy Agent container internal port (container -> container)
-export POLICY_AGENT_EXTERNAL_SECURE_PORT=8433                   # Policy Agent container external secure port (host -> container)
-export POLICY_AGENT_INTERNAL_SECURE_PORT=8433                   # Policy Agent container internal secure port (container -> container)
-export POLICY_AGENT_APIS="V1 V2"                                # Supported northbound api versions
-export PMS_VERSION="V2"                                         # Tested version of northbound API
-
-export POLICY_AGENT_APP_NAME="policy-agent"                     # Name for Policy Agent container
-POLICY_AGENT_LOGPATH="/var/log/policy-agent/application.log"    # Path the application log in the Policy Agent container
-export POLICY_AGENT_APP_NAME_ALIAS="policy-agent-container"     # Alias name, name used by the control panel
-
-export ECS_EXTERNAL_PORT=8083                                   # ECS container external port (host -> container)
-export ECS_INTERNAL_PORT=8083                                   # ECS container internal port (container -> container)
-export ECS_EXTERNAL_SECURE_PORT=8434                            # ECS container external secure port (host -> container)
-export ECS_INTERNAL_SECURE_PORT=8434                            # ECS container internal secure port (container -> container)
-
-export ECS_APP_NAME="ecs"                                       # Name for ECS container
 ECS_LOGPATH="/var/log/enrichment-coordinator-service/application.log" # Path the application log in the ECS container
-export ECS_APP_NAME_ALIAS="enrichment-service-container"        # Alias name, name used by the control panel
-export ECS_HOST_MNT_DIR="./mnt"                                 # Mounted dir, relative to compose file, on the host
-export ECS_CONTAINER_MNT_DIR="/var/enrichment-coordinator-service" # Mounted dir in the container
-
-export MR_EXTERNAL_PORT=3905                                    # MR stub container external port (host -> container)
-export MR_INTERNAL_PORT=3905                                    # MR stub container internal port (container -> container)
-export MR_EXTERNAL_SECURE_PORT=3906                             # MR stub container external secure port (host -> container)
-export MR_INTERNAL_SECURE_PORT=3906                             # MR stub container internal secure port (container -> container)
-export MR_APP_NAME="message-router"                             # Name for the MR
-export MR_READ_URL="/events/A1-POLICY-AGENT-READ/users/policy-agent?timeout=15000&limit=100" # Path to read messages from MR
-export MR_WRITE_URL="/events/A1-POLICY-AGENT-WRITE"             # Path write messages to MR
-
-export CR_EXTERNAL_PORT=8090                                    # Callback receiver container external port (host -> container)
-export CR_INTERNAL_PORT=8090                                    # Callback receiver container internal port (container -> container)
-export CR_EXTERNAL_SECURE_PORT=8091                             # Callback receiver container external secure port (host -> container)
-export CR_INTERNAL_SECURE_PORT=8091                             # Callback receiver container internal secure port (container -> container)
-export CR_APP_NAME="callback-receiver"                          # Name for the Callback receiver
-export CR_APP_CALLBACK="/callbacks"                             # Url for callbacks
-
-export PROD_STUB_EXTERNAL_PORT=8092                             # Producer stub container external port (host -> container)
-export PROD_STUB_INTERNAL_PORT=8092                             # Producer stub container internal port (container -> container)
-export PROD_STUB_EXTERNAL_SECURE_PORT=8093                      # Producer stub container external secure port (host -> container)
-export PROD_STUB_INTERNAL_SECURE_PORT=8093                      # Producer stub container internal secure port (container -> container)
-export PROD_STUB_APP_NAME="producer-stub"                       # Name for the Producer stub
-
-export CONSUL_HOST="consul-server"                              # Host name of consul
-export CONSUL_EXTERNAL_PORT=8500                                # Consul container external port (host -> container)
-export CONSUL_INTERNAL_PORT=8500                                # Consul container internal port (container -> container)
-export CONSUL_APP_NAME="polman-consul"                          # Name for consul container
-
-export CBS_APP_NAME="polman-cbs"                                # Name for CBS container
-export CBS_EXTERNAL_PORT=10000                                  # CBS container external port (host -> container)
-export CBS_INTERNAL_PORT=10000                                  # CBS container internal port (container -> container)
-export CONFIG_BINDING_SERVICE="config-binding-service"          # Host name of CBS
-
-export RIC_SIM_BASE="g"                                         # Base name of the RIC Simulator container, shall be the group code
-                                                                # Note, a prefix is added to each container name by the .env file in the 'ric' dir
-RIC_SIM_PREFIX="ricsim"                                         # Prefix added to ric container name, added in the .env file in the 'ric' dir
-                                                                # This prefix can be changed from the command line
-export RIC_SIM_INTERNAL_PORT=8085                               # RIC Simulator container internal port (container -> container).
-                                                                # (external ports allocated by docker)
-export RIC_SIM_INTERNAL_SECURE_PORT=8185                        # RIC Simulator container internal secure port (container -> container).
-                                                                # (external ports allocated by docker)
-
-export SDNC_APP_NAME="a1-controller"                            # Name of the SNDC A1 Controller container
-export SDNC_EXTERNAL_PORT=8282                                  # SNDC A1 Controller container external port (host -> container)
-export SDNC_INTERNAL_PORT=8181                                  # SNDC A1 Controller container internal port (container -> container)
-export SDNC_EXTERNAL_SECURE_PORT=8443                           # SNDC A1 Controller container external securee port (host -> container)
-export SDNC_INTERNAL_SECURE_PORT=8443                           # SNDC A1 Controller container internal secure port (container -> container)
-export SDNC_DB_APP_NAME="sdnc-db"                               # Name of the SDNC DB container
-export SDNC_A1_TRUSTSTORE_PASSWORD=""                           # SDNC truststore password
-SDNC_USER="admin"                                               # SDNC username
-SDNC_PWD="Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U"          # SNDC PWD
-SDNC_API_URL="/restconf/operations/A1-ADAPTER-API:"             # Base url path for SNDC API
-SDNC_ALIVE_URL="/apidoc/explorer/"                              # Base url path for SNDC API docs (for alive check)
-SDNC_KARAF_LOG="/opt/opendaylight/data/log/karaf.log"           # Path to karaf log
-
-export RAPP_CAT_EXTERNAL_PORT=8680                             # RAPP Catalogue container external port (host -> container)
-export RAPP_CAT_INTERNAL_PORT=8080                             # RAPP Catalogue container internal port (container -> container)
-export RAPP_CAT_EXTERNAL_SECURE_PORT=8633                      # RAPP Catalogue container external secure port (host -> container)
-export RAPP_CAT_INTERNAL_SECURE_PORT=8433                      # RAPP Catalogue container internal secure port (container -> container)
-export RAPP_CAT_APP_NAME="rapp-catalogue"                      # Name for the RAPP Catalogue
-
-
-export CONTROL_PANEL_APP_NAME="control-panel"                   # Name of the Control Panel container
-export CONTROL_PANEL_EXTERNAL_PORT=8080                         # Control Panel container external port (host -> container)
-export CONTROL_PANEL_INTERNAL_PORT=8080                         # Control Panel container external port (host -> container)
-CONTROL_PANEL_LOGPATH="/logs/nonrtric-controlpanel.log"         # Path the application log in the Control Panel container
-
+ECS_APP_NAME_ALIAS="enrichment-service-container"        # Alias name, name used by the control panel
+ECS_HOST_MNT_DIR="./mnt/db"                              # Mounted dir, relative to compose file, on the host
+ECS_CONTAINER_MNT_DIR="/var/enrichment-coordinator-service" # Mounted dir in the container
+ECS_ACTUATOR="/actuator/loggers/org.oransc.enrichment"   # Url for trace/debug
+ECS_CERT_MOUNT_DIR="./cert"
+ECS_ALIVE_URL="/status"                                  # Base path for alive check
+ECS_COMPOSE_DIR="ecs"                                    # Dir in simulator_group for docker-compose
+ECS_CONFIG_MOUNT_PATH=/opt/app/enrichment-coordinator-service/config # Internal container path for configuration
+ECS_CONFIG_FILE=application.yaml                         # Config file name
+
+
+MR_DMAAP_APP_NAME="dmaap-mr"                             # Name for the Dmaap MR
+MR_STUB_APP_NAME="mr-stub"                               # Name of the MR stub
+MR_DMAAP_DISPLAY_NAME="DMAAP Message Router"
+MR_STUB_DISPLAY_NAME="Message Router stub"
+MR_STUB_CERT_MOUNT_DIR="./cert"
+MR_EXTERNAL_PORT=3904                                    # MR dmaap/stub container external port
+MR_INTERNAL_PORT=3904                                    # MR dmaap/stub container internal port
+MR_EXTERNAL_SECURE_PORT=3905                             # MR dmaap/stub container external secure port
+MR_INTERNAL_SECURE_PORT=3905                             # MR dmaap/stub container internal secure port
+MR_DMAAP_LOCALHOST_PORT=3904                             # MR stub container external port (host -> container)
+MR_STUB_LOCALHOST_PORT=3908                              # MR stub container external port (host -> container)
+MR_DMAAP_LOCALHOST_SECURE_PORT=3905                      # MR stub container internal port (container -> container)
+MR_STUB_LOCALHOST_SECURE_PORT=3909                       # MR stub container external secure port (host -> container)
+MR_READ_URL="/events/A1-POLICY-AGENT-READ/users/policy-agent?timeout=15000&limit=100" # Path to read messages from MR
+MR_WRITE_URL="/events/A1-POLICY-AGENT-WRITE"             # Path write messages to MR
+MR_READ_TOPIC="A1-POLICY-AGENT-READ"                     # Read topic
+MR_WRITE_TOPIC="A1-POLICY-AGENT-WRITE"                   # Write topic
+MR_STUB_ALIVE_URL="/"                                    # Base path for mr stub alive check
+MR_DMAAP_ALIVE_URL="/topics"                             # Base path for dmaap-mr alive check
+MR_DMAAP_COMPOSE_DIR="dmaapmr"                           # Dir in simulator_group for dmaap mr for - docker-compose
+MR_STUB_COMPOSE_DIR="mrstub"                             # Dir in simulator_group for mr stub for - docker-compose
+MR_KAFKA_APP_NAME="kafka"                                # Kafka app name
+MR_ZOOKEEPER_APP_NAME="zookeeper"                        # Zookeeper app name
+
+
+CR_APP_NAME="callback-receiver"                          # Name for the Callback receiver
+CR_DISPLAY_NAME="RAPP Catalogue"
+CR_EXTERNAL_PORT=8090                                    # Callback receiver container external port (host -> container)
+CR_INTERNAL_PORT=8090                                    # Callback receiver container internal port (container -> container)
+CR_EXTERNAL_SECURE_PORT=8091                             # Callback receiver container external secure port (host -> container)
+CR_INTERNAL_SECURE_PORT=8091                             # Callback receiver container internal secure port (container -> container)
+CR_APP_CALLBACK="/callbacks"                             # Url for callbacks
+CR_ALIVE_URL="/"                                         # Base path for alive check
+CR_COMPOSE_DIR="cr"                                      # Dir in simulator_group for docker-compose
+
+PROD_STUB_APP_NAME="producer-stub"                       # Name for the Producer stub
+PROD_STUB_DISPLAY_NAME="Producer Stub"
+PROD_STUB_EXTERNAL_PORT=8092                             # Producer stub container external port (host -> container)
+PROD_STUB_INTERNAL_PORT=8092                             # Producer stub container internal port (container -> container)
+PROD_STUB_EXTERNAL_SECURE_PORT=8093                      # Producer stub container external secure port (host -> container)
+PROD_STUB_INTERNAL_SECURE_PORT=8093                      # Producer stub container internal secure port (container -> container)
+PROD_STUB_JOB_CALLBACK="/callbacks/job"                  # Callback path for job create/update/delete
+PROD_STUB_SUPERVISION_CALLBACK="/callbacks/supervision"  # Callback path for producre supervision
+PROD_STUB_ALIVE_URL="/"                                  # Base path for alive check
+PROD_STUB_COMPOSE_DIR="prodstub"                         # Dir in simulator_group for docker-compose
+
+CONSUL_HOST="consul-server"                              # Host name of consul
+CONSUL_DISPLAY_NAME="Consul"
+CONSUL_EXTERNAL_PORT=8500                                # Consul container external port (host -> container)
+CONSUL_INTERNAL_PORT=8500                                # Consul container internal port (container -> container)
+CONSUL_APP_NAME="polman-consul"                          # Name for consul container
+CONSUL_ALIVE_URL="/ui/dc1/kv"                            # Base path for alive check
+CONSUL_CBS_COMPOSE_DIR="consul_cbs"                      # Dir in simulator group for docker compose
+
+CBS_APP_NAME="polman-cbs"                                # Name for CBS container
+CBS_DISPLAY_NAME="Config Binding Service"
+CBS_EXTERNAL_PORT=10000                                  # CBS container external port (host -> container)
+CBS_INTERNAL_PORT=10000                                  # CBS container internal port (container -> container)
+CONFIG_BINDING_SERVICE="config-binding-service"          # Host name of CBS
+CBS_ALIVE_URL="/healthcheck"                             # Base path for alive check
+
+RIC_SIM_DISPLAY_NAME="Near-RT RIC A1 Simulator"
+RIC_SIM_BASE="g"                                         # Base name of the RIC Simulator container, shall be the group code
+                                                         # Note, a prefix is added to each container name by the .env file in the 'ric' dir
+RIC_SIM_PREFIX="ricsim"                                  # Prefix added to ric container name, added in the .env file in the 'ric' dir
+                                                         # This prefix can be changed from the command line
+RIC_SIM_INTERNAL_PORT=8085                               # RIC Simulator container internal port (container -> container).
+                                                         # (external ports allocated by docker)
+RIC_SIM_INTERNAL_SECURE_PORT=8185                        # RIC Simulator container internal secure port (container -> container).
+                                                         # (external ports allocated by docker)
+RIC_SIM_CERT_MOUNT_DIR="./cert"
+
+RIC_SIM_COMPOSE_DIR="ric"                                # Dir in simulator group for docker compose
+RIC_SIM_ALIVE_URL="/"                                    # Base path for alive check
+
+SDNC_APP_NAME="a1controller"                             # Name of the SNDC A1 Controller container
+SDNC_DISPLAY_NAME="SDNC A1 Controller"
+SDNC_EXTERNAL_PORT=8282                                  # SNDC A1 Controller container external port (host -> container)
+SDNC_INTERNAL_PORT=8181                                  # SNDC A1 Controller container internal port (container -> container)
+SDNC_EXTERNAL_SECURE_PORT=8443                           # SNDC A1 Controller container external securee port (host -> container)
+SDNC_INTERNAL_SECURE_PORT=8443                           # SNDC A1 Controller container internal secure port (container -> container)
+SDNC_DB_APP_NAME="sdncdb"                                # Name of the SDNC DB container
+SDNC_A1_TRUSTSTORE_PASSWORD=""                           # SDNC truststore password
+SDNC_USER="admin"                                        # SDNC username
+SDNC_PWD="Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U"   # SNDC PWD
+SDNC_API_URL="/restconf/operations/A1-ADAPTER-API:"      # Base url path for SNDC API
+SDNC_ALIVE_URL="/apidoc/explorer/"                       # Base url path for SNDC API docs (for alive check)
+SDNC_COMPOSE_DIR="sdnc"                                  # Dir in simulator_group for docker-compose
+SDNC_KARAF_LOG="/opt/opendaylight/data/log/karaf.log"    # Path to karaf log
+
+RAPP_CAT_APP_NAME="rappcatalogueservice"                 # Name for the RAPP Catalogue
+RAPP_CAT_DISPLAY_NAME="RAPP Catalogue"
+RAPP_CAT_EXTERNAL_PORT=8680                              # RAPP Catalogue container external port (host -> container)
+RAPP_CAT_INTERNAL_PORT=8080                              # RAPP Catalogue container internal port (container -> container)
+RAPP_CAT_EXTERNAL_SECURE_PORT=8633                       # RAPP Catalogue container external secure port (host -> container)
+RAPP_CAT_INTERNAL_SECURE_PORT=8433                       # RAPP Catalogue container internal secure port (container -> container)
+RAPP_CAT_ALIVE_URL="/services"                           # Base path for alive check
+RAPP_CAT_COMPOSE_DIR="rapp_catalogue"                    # Dir in simulator_group for docker-compose
+
+CONTROL_PANEL_APP_NAME="controlpanel"                    # Name of the Control Panel container
+CONTROL_PANEL_DISPLAY_NAME="Control Panel"
+CONTROL_PANEL_EXTERNAL_PORT=8080                         # Control Panel container external port (host -> container)
+CONTROL_PANEL_INTERNAL_PORT=8080                         # Control Panel container internal port (container -> container)
+CONTROL_PANEL_EXTERNAL_SECURE_PORT=8880                  # Control Panel container external port (host -> container)
+CONTROL_PANEL_INTERNAL_SECURE_PORT=8082                  # Control Panel container internal port (container -> container)
+CONTROL_PANEL_LOGPATH="/logs/nonrtric-controlpanel.log"  # Path the application log in the Control Panel container
+CONTROL_PANEL_ALIVE_URL="/"                              # Base path for alive check
+CONTROL_PANEL_COMPOSE_DIR="control_panel"                # Dir in simulator_group for docker-compose
+CONTROL_PANEL_CONFIG_MOUNT_PATH=/maven                   # Container internal path for config
+CONTROL_PANEL_CONFIG_FILE=application.properties         # Config file name
+
+HTTP_PROXY_APP_NAME="httpproxy"                          # Name of the Http Proxy container
+HTTP_PROXY_DISPLAY_NAME="Http Proxy"
+HTTP_PROXY_EXTERNAL_PORT=8780                            # Http Proxy container external port (host -> container)
+HTTP_PROXY_INTERNAL_PORT=8080                            # Http Proxy container internal port (container -> container)
+HTTP_PROXY_WEB_EXTERNAL_PORT=8781                        # Http Proxy container external port (host -> container)
+HTTP_PROXY_WEB_INTERNAL_PORT=8081                        # Http Proxy container internal port (container -> container)
+HTTP_PROXY_CONFIG_PORT=0                                 # Port number for proxy config, will be set if proxy is started
+HTTP_PROXY_CONFIG_HOST_NAME=""                           # Proxy host, will be set if proxy is started
+HTTP_PROXY_ALIVE_URL="/"                                 # Base path for alive check
+HTTP_PROXY_COMPOSE_DIR="httpproxy"                       # Dir in simulator_group for docker-compose
 
 ########################################
 # Setting for common curl-base function
 ########################################
 
-UUID=""                                                         # UUID used as prefix to the policy id to simulate a real UUID
-                                                                # Testscript need to set the UUID otherwise this empty prefix is used
-
-RESTBASE="http://localhost:"$POLICY_AGENT_EXTERNAL_PORT         # Base url to the Agent NB REST interface
-RESTBASE_SECURE="https://localhost:"$POLICY_AGENT_EXTERNAL_SECURE_PORT # Base url to the secure Agent NB REST interface
-DMAAPBASE="http://localhost:"$MR_EXTERNAL_PORT                  # Base url to the Dmaap adapter, http
-DMAAPBASE_SECURE="https://localhost:"$MR_EXTERNAL_SECURE_PORT   # Base url to the Dmaap adapter, https
-ADAPTER=$RESTBASE                                               # Adapter holds the address the agent R-APP interface (REST OR DMAAP)
-                                                                # The values of this var is swiched between the four base url when needed
-
-ECS_RESTBASE="http://localhost:"$ECS_EXTERNAL_PORT              # Base url to the ECS NB REST interface
-ECS_RESTBASE_SECURE="https://localhost:"$ECS_EXTERNAL_SECURE_PORT # Base url to the secure ECS NB REST interface
-ECS_DMAAPBASE="http://localhost:"$MR_EXTERNAL_PORT              # Base url to the Dmaap adapter, http
-ECS_DMAAPBASE_SECURE="https://localhost:"$MR_EXTERNAL_SECURE_PORT   # Base url to the Dmaap adapter, https
-ECS_ADAPTER=$ECS_RESTBASE                                       # Adapter holds the address the ECS R-APP interface (REST OR DMAAP)
-                                                                # The values of this var is swiched between the four base url when needed
-
-CR_RESTBASE="http://localhost:"$CR_EXTERNAL_PORT                # Base url to the Callback receiver REST interface
-CR_RESTBASE_SECURE="https://localhost:"$CR_EXTERNAL_SECURE_PORT # Base url to the secure Callback receiver REST interface
-CR_ADAPTER=$CR_RESTBASE                                         # Adapter holds the address the CR admin interface (REST only)
-                                                                # The values of this var is swiched between the two base url when needed
-
-RC_RESTBASE="http://localhost:"$RAPP_CAT_EXTERNAL_PORT          # Base url to the RAPP Catalogue REST interface
-RC_RESTBASE_SECURE="https://localhost:"$RAPP_CAT_EXTERNAL_SECURE_PORT # Base url to the secure RAPP Catalogue REST interface
-RC_ADAPTER=$RC_RESTBASE                                         # Adapter holds the address the RAPP Catalogue interface
\ No newline at end of file
+UUID=""                                                   # UUID used as prefix to the policy id to simulate a real UUID
+                                                          # Testscript need to set the UUID otherwise this empty prefix is used
diff --git a/test/common/test_env.sh b/test/common/test_env.sh
deleted file mode 100644 (file)
index a8e618f..0000000
+++ /dev/null
@@ -1,189 +0,0 @@
-#!/bin/bash
-
-#  ============LICENSE_START===============================================
-#  Copyright (C) 2020 Nordix Foundation. All rights reserved.
-#  ========================================================================
-#  Licensed under the Apache License, Version 2.0 (the "License");
-#  you may not use this file except in compliance with the License.
-#  You may obtain a copy of the License at
-#
-#       http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-#  distributed under the License is distributed on an "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#  See the License for the specific language governing permissions and
-#  limitations under the License.
-#  ============LICENSE_END=================================================
-#
-
-# Set up the image and tags for the test. Do not add the image tag to the image names.
-
-# NOTE: A env var for each container is created by the test script.
-# This var will point to the local or remote var depending on how
-# the test script is started. The name format is <container-name>_IMAGE, ie with 'LOCAL' or 'REMOTE'.
-
-# Local Policy Agent image and tag
-POLICY_AGENT_LOCAL_IMAGE="o-ran-sc/nonrtric-policy-agent"
-POLICY_AGENT_LOCAL_IMAGE_TAG="2.2.0-SNAPSHOT"
-# Remote Policy Agent image and tag
-POLICY_AGENT_REMOTE_IMAGE="nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-policy-agent"
-POLICY_AGENT_REMOTE_IMAGE_TAG="2.2.0"
-
-# Local ECS image and tag
-ECS_LOCAL_IMAGE="o-ran-sc/nonrtric-enrichment-coordinator-service"
-ECS_LOCAL_IMAGE_TAG="1.1.0-SNAPSHOT"
-# Remote ECS image and tag
-ECS_REMOTE_IMAGE="nexus3.o-ran-sc.org:10003/o-ran-sc/nonrtric-enrichment-coordinator-service"
-ECS_REMOTE_IMAGE_TAG="1.1.0-SNAPSHOT"
-
-# Control Panel local image and tag
-CONTROL_PANEL_LOCAL_IMAGE="o-ran-sc/nonrtric-controlpanel"
-CONTROL_PANEL_LOCAL_IMAGE_TAG="2.2.0-SNAPSHOT"
-# Control Panel remote image and tag
-CONTROL_PANEL_REMOTE_IMAGE="nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-controlpanel"
-CONTROL_PANEL_REMOTE_IMAGE_TAG="2.2.0"
-
-
-# SDNC A1 Controller local image and tag
-SDNC_A1_CONTROLLER_LOCAL_IMAGE="o-ran-sc/nonrtric-a1-controller"
-SDNC_A1_CONTROLLER_LOCAL_IMAGE_TAG="2.1.0-SNAPSHOT"
-# SDNC A1 Controller remote image and tag
-SDNC_A1_CONTROLLER_REMOTE_IMAGE="nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-a1-controller"
-SDNC_A1_CONTROLLER_REMOTE_IMAGE_TAG="2.1.0"
-
-
-#SDNC DB remote image and tag
-SDNC_DB_REMOTE_IMAGE="mysql/mysql-server"
-SDNC_DB_REMOTE_IMAGE_TAG="5.6"
-#No local image for DB, remote image always used
-
-
-# Near RT RIC Simulator local image and tag
-RIC_SIM_LOCAL_IMAGE="nexus3.o-ran-sc.org:10004/o-ran-sc/a1-simulator"
-RIC_SIM_LOCAL_IMAGE_TAG="latest"
-# Near RT RIC Simulator remote image and tag
-RIC_SIM_REMOTE_IMAGE="nexus3.o-ran-sc.org:10004/o-ran-sc/a1-simulator"
-RIC_SIM_REMOTE_IMAGE_TAG="2.0.0"
-
-
-#Consul remote image and tag
-CONSUL_REMOTE_IMAGE="consul"
-CONSUL_REMOTE_IMAGE_TAG="1.7.2"
-#No local image for Consul, remote image always used
-
-
-#CBS remote image and tag
-CBS_REMOTE_IMAGE="nexus3.onap.org:10001/onap/org.onap.dcaegen2.platform.configbinding.app-app"
-CBS_REMOTE_IMAGE_TAG="2.3.0"
-#No local image for CBS, remote image always used
-
-
-#MR stub image and tag
-MRSTUB_LOCAL_IMAGE="mrstub"
-MRSTUB_LOCAL_IMAGE_TAG="latest"
-#No remote image for MR stub, local image always used
-
-#Callback receiver image and tag
-CR_LOCAL_IMAGE="callback-receiver"
-CR_LOCAL_IMAGE_TAG="latest"
-#No remote image for CR, local image always used
-
-#Producer stub image and tag
-PROD_STUB_LOCAL_IMAGE="producer-stub"
-PROD_STUB_LOCAL_IMAGE_TAG="latest"
-#No remote image for producer stub, local image always used
-
-# Common env var for auto-test. Vars used by docker-compose need to be exported
-export DOCKER_SIM_NWNAME="nonrtric-docker-net"                  # Name of docker private network
-
-export POLICY_AGENT_EXTERNAL_PORT=8081                          # Policy Agent container external port (host -> container)
-export POLICY_AGENT_INTERNAL_PORT=8081                          # Policy Agent container internal port (container -> container)
-export POLICY_AGENT_EXTERNAL_SECURE_PORT=8433                   # Policy Agent container external secure port (host -> container)
-export POLICY_AGENT_INTERNAL_SECURE_PORT=8433                   # Policy Agent container internal secure port (container -> container)
-
-export POLICY_AGENT_APP_NAME="policy-agent"                     # Name for Policy Agent container
-POLICY_AGENT_LOGPATH="/var/log/policy-agent/application.log"    # Path the application log in the Policy Agent container
-export POLICY_AGENT_APP_NAME_ALIAS="policy-agent-container"     # Alias name, name used by the control panel
-
-export ECS_EXTERNAL_PORT=8083                                   # ECS container external port (host -> container)
-export ECS_INTERNAL_PORT=8083                                   # ECS container internal port (container -> container)
-export ECS_EXTERNAL_SECURE_PORT=8434                            # ECS container external secure port (host -> container)
-export ECS_INTERNAL_SECURE_PORT=8434                            # ECS container internal secure port (container -> container)
-
-export ECS_APP_NAME="ecs"                                       # Name for ECS container
-ECS_LOGPATH="/var/log/enrichment-coordinator-service/application.log" # Path the application log in the ECS container
-export ECS_APP_NAME_ALIAS="enrichment-service-container"        # Alias name, name used by the control panel
-
-export MR_EXTERNAL_PORT=3905                                    # MR stub container external port (host -> container)
-export MR_INTERNAL_PORT=3905                                    # MR stub container internal port (container -> container)
-export MR_EXTERNAL_SECURE_PORT=3906                             # MR stub container external secure port (host -> container)
-export MR_INTERNAL_SECURE_PORT=3906                             # MR stub container internal secure port (container -> container)
-export MR_APP_NAME="message-router"                             # Name for the MR
-export MR_READ_URL="/events/A1-POLICY-AGENT-READ/users/policy-agent?timeout=15000&limit=100" # Path to read messages from MR
-export MR_WRITE_URL="/events/A1-POLICY-AGENT-WRITE"             # Path write messages to MR
-
-export CR_EXTERNAL_PORT=8090                                    # Callback receiver container external port (host -> container)
-export CR_INTERNAL_PORT=8090                                    # Callback receiver container internal port (container -> container)
-export CR_EXTERNAL_SECURE_PORT=8091                             # Callback receiver container external secure port (host -> container)
-export CR_INTERNAL_SECURE_PORT=8091                             # Callback receiver container internal secure port (container -> container)
-export CR_APP_NAME="callback-receiver"                          # Name for the Callback receiver
-
-export PROD_STUB_EXTERNAL_PORT=8092                             # Producer stub container external port (host -> container)
-export PROD_STUB_INTERNAL_PORT=8092                             # Producer stub container internal port (container -> container)
-export PROD_STUB_EXTERNAL_SECURE_PORT=8093                      # Producer stub container external secure port (host -> container)
-export PROD_STUB_INTERNAL_SECURE_PORT=8093                      # Producer stub container internal secure port (container -> container)
-export PROD_STUB_APP_NAME="producer-stub"                       # Name for the Producer stub
-
-export CONSUL_HOST="consul-server"                              # Host name of consul
-export CONSUL_EXTERNAL_PORT=8500                                # Consul container external port (host -> container)
-export CONSUL_INTERNAL_PORT=8500                                # Consul container internal port (container -> container)
-export CONSUL_APP_NAME="polman-consul"                          # Name for consul container
-
-export CBS_APP_NAME="polman-cbs"                                # Name for CBS container
-export CBS_EXTERNAL_PORT=10000                                  # CBS container external port (host -> container)
-export CBS_INTERNAL_PORT=10000                                  # CBS container internal port (container -> container)
-export CONFIG_BINDING_SERVICE="config-binding-service"          # Host name of CBS
-
-export RIC_SIM_BASE="g"                                         # Base name of the RIC Simulator container, shall be the group code
-                                                                # Note, a prefix is added to each container name by the .env file in the 'ric' dir
-RIC_SIM_PREFIX="ricsim"                                         # Prefix added to ric container name, added in the .env file in the 'ric' dir
-                                                                # This prefix can be changed from the command line
-export RIC_SIM_INTERNAL_PORT=8085                               # RIC Simulator container internal port (container -> container).
-                                                                # (external ports allocated by docker)
-export RIC_SIM_INTERNAL_SECURE_PORT=8185                        # RIC Simulator container internal secure port (container -> container).
-                                                                # (external ports allocated by docker)
-
-export SDNC_APP_NAME="a1-controller"                            # Name of the SNDC A1 Controller container
-export SDNC_EXTERNAL_PORT=8282                                  # SNDC A1 Controller container external port (host -> container)
-export SDNC_INTERNAL_PORT=8181                                  # SNDC A1 Controller container internal port (container -> container)
-export SDNC_EXTERNAL_SECURE_PORT=8443                           # SNDC A1 Controller container external securee port (host -> container)
-export SDNC_INTERNAL_SECURE_PORT=8443                           # SNDC A1 Controller container internal secure port (container -> container)
-export SDNC_DB_APP_NAME="sdnc-db"                               # Name of the SDNC DB container
-export SDNC_A1_TRUSTSTORE_PASSWORD=""                           # SDNC truststore password
-SDNC_USER="admin"                                               # SDNC username
-SDNC_PWD="Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U"          # SNDC PWD
-SDNC_API_URL="/restconf/operations/A1-ADAPTER-API:"             # Base url path for SNDC API
-SDNC_ALIVE_URL="/apidoc/explorer/"                              # Base url path for SNDC API docs (for alive check)
-SDNC_KARAF_LOG="/opt/opendaylight/data/log/karaf.log"           # Path to karaf log
-
-export CONTROL_PANEL_APP_NAME="control-panel"                   # Name of the Control Panel container
-export CONTROL_PANEL_EXTERNAL_PORT=8080                         # Control Panel container external port (host -> container)
-export CONTROL_PANEL_INTERNAL_PORT=8080                         # Control Panel container external port (host -> container)
-CONTROL_PANEL_LOGPATH="/logs/nonrtric-controlpanel.log"         # Path the application log in the Control Panel container
-
-UUID=""                                                         # UUID used as prefix to the policy id to simulate a real UUID
-                                                                # Testscript need to set the UUID otherwise this empty prefix is used
-
-RESTBASE="http://localhost:"$POLICY_AGENT_EXTERNAL_PORT         # Base url to the Agent NB REST interface
-RESTBASE_SECURE="https://localhost:"$POLICY_AGENT_EXTERNAL_SECURE_PORT # Base url to the secure Agent NB REST interface
-DMAAPBASE="http://localhost:"$MR_EXTERNAL_PORT                  # Base url to the Dmaap adapter, http
-DMAAPBASE_SECURE="https://localhost:"$MR_EXTERNAL_SECURE_PORT   # Base url to the Dmaap adapter, https
-ADAPTER=$RESTBASE                                               # Adapter holds the address the agent R-APP interface (REST OR DMAAP)
-                                                                # The values of this var is swiched between the four base url when needed
-ECS_RESTBASE="http://localhost:"$ECS_EXTERNAL_PORT              # Base url to the ECS NB REST interface
-ECS_RESTBASE_SECURE="https://localhost:"$ECS_EXTERNAL_SECURE_PORT # Base url to the secure ECS NB REST interface
-ECS_DMAAPBASE="http://localhost:"$MR_EXTERNAL_PORT              # Base url to the Dmaap adapter, http
-ECS_DMAAPBASE_SECURE="https://localhost:"$MR_EXTERNAL_SECURE_PORT   # Base url to the Dmaap adapter, https
-ECS_ADAPTER=$ECS_RESTBASE                                       # Adapter holds the address the ECS R-APP interface (REST OR DMAAP)
-                                                                # The values of this var is swiched between the four base url when needed
index cef8188..aee3af5 100755 (executable)
 # This is a script that contains all the common functions needed for auto test.
 # Specific test function are defined in scripts  XXXX_functions.sh
 
+. ../common/api_curl.sh
 
 # List of short names for all supported apps, including simulators etc
-APP_SHORT_NAMES="PA RICSIM SDNC CP ECS RC CBS CONSUL RC MRSTUB CR PRODSTUB"
+APP_SHORT_NAMES="PA RICSIM SDNC CP ECS RC CBS CONSUL RC MR DMAAPMR CR PRODSTUB"
 
 __print_args() {
-       echo "Args: remote|remote-remove --env-file <environment-filename> [release] [auto-clean] [--stop-at-error] "
+       echo "Args: remote|remote-remove docker|kube --env-file <environment-filename> [release] [auto-clean] [--stop-at-error] "
        echo "      [--ricsim-prefix <prefix> ] [--use-local-image <app-nam>+]  [--use-snapshot-image <app-nam>+]"
        echo "      [--use-staging-image <app-nam>+] [--use-release-image <app-nam>+]"
 }
@@ -41,6 +42,8 @@ if [ $# -eq 1 ] && [ "$1" == "help" ]; then
        echo ""
        echo "remote                -  Use images from remote repositories. Can be overridden for individual images using the '--use_xxx' flags"
        echo "remote-remove         -  Same as 'remote' but will also try to pull fresh images from remote repositories"
+       echo "docker                -  Test executed in docker environment"
+       echo "kube                  -  Test executed in kubernetes environment - requires an already started kubernetes environment"
        echo "--env-file            -  The script will use the supplied file to read environment variables from"
        echo "release               -  If this flag is given the script will use release version of the images"
        echo "auto-clean            -  If the function 'auto_clean_containers' is present in the end of the test script then all containers will be stopped and removed. If 'auto-clean' is not given then the function has no effect."
@@ -55,8 +58,6 @@ if [ $# -eq 1 ] && [ "$1" == "help" ]; then
        exit 0
 fi
 
-
-
 # Create a test case id, ATC (Auto Test Case), from the name of the test case script.
 # FTC1.sh -> ATC == FTC1
 ATC=$(basename "${BASH_SOURCE[$i+1]}" .sh)
@@ -76,23 +77,6 @@ YELLOW="\033[33m\033[1m"
 EYELLOW="\033[0m"
 SAMELINE="\033[0K\r"
 
-tmp=$(which python3)
-if [ $? -ne 0 ] || [ -z tmp ]; then
-       echo -e $RED"python3 is required to run the test environment, pls install"$ERED
-       exit 1
-fi
-tmp=$(which docker)
-if [ $? -ne 0 ] || [ -z tmp ]; then
-       echo -e $RED"docker is required to run the test environment, pls install"$ERED
-       exit 1
-fi
-
-tmp=$(which docker-compose)
-if [ $? -ne 0 ] || [ -z tmp ]; then
-       echo -e $RED"docker-compose is required to run the test environment, pls install"$ERED
-       exit 1
-fi
-
 # Just resetting any previous echo formatting...
 echo -ne $EBOLD
 
@@ -101,17 +85,10 @@ TEST_ENV_VAR_FILE=""
 
 echo "Test case started as: ${BASH_SOURCE[$i+1]} "$@
 
-#Localhost constant
-LOCALHOST="http://localhost:"
-
-# Make curl retries towards ECS for http response codes set in this env var, space separated list of codes
-ECS_RETRY_CODES=""
-
-# Make curl retries towards the agent for http response codes set in this env var, space separated list of codes
-AGENT_RETRY_CODES=""
-
-# Var to contol if the agent runs in a container (normal = 0) or as application on the local machine ( = 1)
-AGENT_STAND_ALONE=0
+#Localhost constants
+LOCALHOST_NAME="localhost"
+LOCALHOST_HTTP="http://localhost"
+LOCALHOST_HTTPS="https://localhost"
 
 # Var to hold 'auto' in case containers shall be stopped when test case ends
 AUTO_CLEAN=""
@@ -174,7 +151,6 @@ fi
 HTTPLOG=$PWD"/.httplog_"$ATC".txt"
 echo "" > $HTTPLOG
 
-
 # Create a log dir for the test case
 mkdir -p $TESTLOGS/$ATC
 
@@ -209,7 +185,6 @@ RES_DEVIATION=0
 DEVIATION_FILE=".tmp_deviations"
 rm $DEVIATION_FILE &> /dev/null
 
-
 # Trap "command not found" and make the script fail
 trap_fnc() {
 
@@ -329,6 +304,24 @@ if [ $paramerror -eq 0 ]; then
                shift;
        fi
 fi
+if [ $paramerror -eq 0 ]; then
+       if [ "$1" != "docker" ] && [ "$1" != "kube" ]; then
+               paramerror=1
+               if [ -z "$paramerror_str" ]; then
+                       paramerror_str="Second arg shall be 'docker' or 'kube'"
+               fi
+       else
+               if [ $1 == "docker" ]; then
+                       RUNMODE="DOCKER"
+                       echo "Setting RUNMODE=DOCKER"
+               fi
+               if [ $1 == "kube" ]; then
+                       RUNMODE="KUBE"
+                       echo "Setting RUNMODE=KUBE"
+               fi
+               shift;
+       fi
+fi
 foundparm=0
 while [ $paramerror -eq 0 ] && [ $foundparm -eq 0 ]; do
        foundparm=1
@@ -359,7 +352,7 @@ while [ $paramerror -eq 0 ] && [ $foundparm -eq 0 ]; do
        if [ $paramerror -eq 0 ]; then
                if [ "$1" == "--ricsim-prefix" ]; then
                        shift;
-                       RIC_SIM_PREFIX=$1
+                       TMP_RIC_SIM_PREFIX=$1  #RIC_SIM_PREFIX need to be updated after sourcing of the env file
                        if [ -z "$1" ]; then
                                paramerror=1
                                if [ -z "$paramerror_str" ]; then
@@ -513,9 +506,14 @@ if [ -f "$TEST_ENV_VAR_FILE" ]; then
        if [ -z "$TEST_ENV_PROFILE" ] || [ -z "$SUPPORTED_PROFILES" ]; then
                echo -e $YELLOW"This test case may not work with selected test env file. TEST_ENV_PROFILE is missing in test_env file or SUPPORTED_PROFILES is missing in test case file"$EYELLOW
        else
-               if [[ "$SUPPORTED_PROFILES" == *"$TEST_ENV_PROFILE"* ]]; then
-                       echo -e $GREEN"Test case support the selected test env file"$EGREEN
-               else
+               found_profile=0
+               for prof in $SUPPORTED_PROFILES; do
+                       if [ "$TEST_ENV_PROFILE" == "$prof" ]; then
+                               echo -e $GREEN"Test case supports the selected test env file"$EGREEN
+                               found_profile=1
+                       fi
+               done
+               if [ $found_profile -ne 1 ]; then
                        echo -e $RED"Test case does not support the selected test env file"$ERED
                        echo "Profile: "$TEST_ENV_PROFILE"     Supported profiles: "$SUPPORTED_PROFILES
                        echo -e $RED"Exiting...."$ERED
@@ -530,51 +528,56 @@ else
        exit 1
 fi
 
+#This var need be preserved from the command line option, if set, when env var is sourced.
+if [ ! -z "$TMP_RIC_SIM_PREFIX" ]; then
+       RIC_SIM_PREFIX=$TMP_RIC_SIM_PREFIX
+fi
+
 if [ -z "$PROJECT_IMAGES_APP_NAMES" ]; then
-       echo -e $RED"Var PROJECT_IMAGES_APP_NAMES must be defined in: "$TEST_ENV_VAR_FILE$ERED$ERED
+       echo -e $RED"Var PROJECT_IMAGES_APP_NAMES must be defined in: "$TEST_ENV_VAR_FILE $ERED
+       exit 1
+fi
+
+if [[ $SUPPORTED_RUNMODES != *"$RUNMODE"* ]]; then
+       echo -e $RED"This test script does not support RUNMODE $RUNMODE"$ERED
+       echo "Supported RUNMODEs: "$SUPPORTED_RUNMODES
+       exit 1
+fi
+
+# Choose list of included apps depending on run-mode
+if [ $RUNMODE == "KUBE" ]; then
+       INCLUDED_IMAGES=$KUBE_INCLUDED_IMAGES
+else
+       INCLUDED_IMAGES=$DOCKER_INCLUDED_IMAGES
+fi
+
+# Check needed installed sw
+tmp=$(which python3)
+if [ $? -ne 0 ] || [ -z tmp ]; then
+       echo -e $RED"python3 is required to run the test environment, pls install"$ERED
+       exit 1
+fi
+tmp=$(which docker)
+if [ $? -ne 0 ] || [ -z tmp ]; then
+       echo -e $RED"docker is required to run the test environment, pls install"$ERED
        exit 1
 fi
 
+tmp=$(which docker-compose)
+if [ $? -ne 0 ] || [ -z tmp ]; then
+       if [ $RUNMODE == "DOCKER" ]; then
+               echo -e $RED"docker-compose is required to run the test environment, pls install"$ERED
+               exit 1
+       fi
+fi
 
-#Vars for A1 interface version and container count
-G1_A1_VERSION=""
-G2_A1_VERSION=""
-G3_A1_VERSION=""
-G4_A1_VERSION=""
-G5_A1_VERSION=""
-G1_COUNT=0
-G2_COUNT=0
-G3_COUNT=0
-G4_COUNT=0
-G5_COUNT=0
-
-# Vars to switch between http and https. Extra curl flag needed for https
-export RIC_SIM_HTTPX="http"
-export RIC_SIM_LOCALHOST=$RIC_SIM_HTTPX"://localhost:"
-export RIC_SIM_PORT=$RIC_SIM_INTERNAL_PORT
-export RIC_SIM_CERT_MOUNT_DIR="./cert"
-
-export MR_HTTPX="http"
-export MR_PORT=$MR_INTERNAL_PORT
-export MR_LOCAL_PORT=$MR_EXTERNAL_PORT #When agent is running outside the docker net
-
-export CR_HTTPX="http"
-export CR_PORT=$CR_INTERNAL_PORT
-export CR_LOCAL_PORT=$CR_EXTERNAL_PORT #When CR is running outside the docker net
-export CR_PATH="$CR_HTTPX://$CR_APP_NAME:$CR_PORT$CR_APP_CALLBACK"
-
-export PROD_STUB_HTTPX="http"
-export PROD_STUB_PORT=$PROD_STUB_INTERNAL_PORT
-export PROD_STUB_LOCAL_PORT=$PROD_STUB_EXTERNAL_PORT #When Prodstub is running outside the docker net
-export PROD_STUB_LOCALHOST=$PROD_STUB_HTTPX"://localhost:"$PROD_STUB_LOCAL_PORT
-
-export SDNC_HTTPX="http"
-export SDNC_PORT=$SDNC_INTERNAL_PORT
-export SDNC_LOCAL_PORT=$SDNC_EXTERNAL_PORT #When agent is running outside the docker net
-
-export RAPP_CAT_HTTPX="http"
-export RAPP_CAT_PORT=$RAPP_CAT_INTERNAL_PORT
-export RAPP_CAT_LOCAL_PORT=$RAPP_CAT_EXTERNAL_PORT #When Rapp catalogue is running outside the docker net
+tmp=$(which kubectl)
+if [ $? -ne 0 ] || [ -z tmp ]; then
+       if [ $RUNMODE == "KUBE" ]; then
+               echo -e $RED"kubectl is required to run the test environment in kubernetes mode, pls install"$ERED
+               exit 1
+       fi
+fi
 
 echo -e $BOLD"Checking configured image setting for this test case"$EBOLD
 
@@ -648,7 +651,6 @@ __check_and_create_image_var() {
 
 # Check if app uses image included in this test run
 # Returns 0 if image is included, 1 if not
-# Possible IDs for image inclusion: CBS, CONSUL, CP, CR, ECS, MR, PA, PRODSTUB, RICSIM, SDNC
 __check_included_image() {
        for im in $INCLUDED_IMAGES; do
                if [ "$1" == "$im" ]; then
@@ -658,6 +660,18 @@ __check_included_image() {
        return 1
 }
 
+# Check if app is included in the prestarted set of apps
+# Returns 0 if image is included, 1 if not
+__check_prestarted_image() {
+       for im in $KUBE_PRESTARTED_IMAGES; do
+               if [ "$1" == "$im" ]; then
+                       return 0
+               fi
+       done
+       return 1
+}
+
+# Check if an app shall use a local image, based on the cmd parameters
 __check_image_local_override() {
        for im in $USE_LOCAL_IMAGES; do
                if [ "$1" == "$im" ]; then
@@ -740,60 +754,106 @@ __check_image_override() {
 echo ""
 
 #Agent image
-IMAGE_SUFFIX=$(__check_image_override 'PA')
-if [ $? -ne 0 ]; then
-       echo -e $RED"Image setting from cmd line not consistent for PA."$ERED
-       ((IMAGE_ERR++))
+__check_included_image 'PA'
+       if [ $? -eq 0 ]; then
+       IMAGE_SUFFIX=$(__check_image_override 'PA')
+       if [ $? -ne 0 ]; then
+               echo -e $RED"Image setting from cmd line not consistent for PA."$ERED
+               ((IMAGE_ERR++))
+       fi
+       __check_and_create_image_var " Policy Agent" "POLICY_AGENT_IMAGE" "POLICY_AGENT_IMAGE_BASE" "POLICY_AGENT_IMAGE_TAG" $IMAGE_SUFFIX PA
 fi
-__check_and_create_image_var " Policy Agent" "POLICY_AGENT_IMAGE" "POLICY_AGENT_IMAGE_BASE" "POLICY_AGENT_IMAGE_TAG" $IMAGE_SUFFIX PA
 
 #Remote Control Panel image
-IMAGE_SUFFIX=$(__check_image_override 'CP')
-if [ $? -ne 0 ]; then
-       echo -e $RED"Image setting from cmd line not consistent for CP."$ERED
-       ((IMAGE_ERR++))
+__check_included_image 'CP'
+if [ $? -eq 0 ]; then
+       IMAGE_SUFFIX=$(__check_image_override 'CP')
+       if [ $? -ne 0 ]; then
+               echo -e $RED"Image setting from cmd line not consistent for CP."$ERED
+               ((IMAGE_ERR++))
+       fi
+       __check_and_create_image_var " Control Panel" "CONTROL_PANEL_IMAGE" "CONTROL_PANEL_IMAGE_BASE" "CONTROL_PANEL_IMAGE_TAG" $IMAGE_SUFFIX CP
 fi
-__check_and_create_image_var " Control Panel" "CONTROL_PANEL_IMAGE" "CONTROL_PANEL_IMAGE_BASE" "CONTROL_PANEL_IMAGE_TAG" $IMAGE_SUFFIX CP
 
 #Remote SDNC image
-IMAGE_SUFFIX=$(__check_image_override 'SDNC')
-if [ $? -ne 0 ]; then
-       echo -e $RED"Image setting from cmd line not consistent for SDNC."$ERED
-       ((IMAGE_ERR++))
+__check_included_image 'SDNC'
+if [ $? -eq 0 ]; then
+       IMAGE_SUFFIX=$(__check_image_override 'SDNC')
+       if [ $? -ne 0 ]; then
+               echo -e $RED"Image setting from cmd line not consistent for SDNC."$ERED
+               ((IMAGE_ERR++))
+       fi
+       __check_and_create_image_var " SDNC A1 Controller" "SDNC_A1_CONTROLLER_IMAGE" "SDNC_A1_CONTROLLER_IMAGE_BASE" "SDNC_A1_CONTROLLER_IMAGE_TAG" $IMAGE_SUFFIX SDNC
 fi
-__check_and_create_image_var " SDNC A1 Controller" "SDNC_A1_CONTROLLER_IMAGE" "SDNC_A1_CONTROLLER_IMAGE_BASE" "SDNC_A1_CONTROLLER_IMAGE_TAG" $IMAGE_SUFFIX SDNC
 
 #Remote ric sim image
-IMAGE_SUFFIX=$(__check_image_override 'RICSIM')
-if [ $? -ne 0 ]; then
-       echo -e $RED"Image setting from cmd line not consistent for RICSIM."$ERED
-       ((IMAGE_ERR++))
+__check_included_image 'RICSIM'
+if [ $? -eq 0 ]; then
+       IMAGE_SUFFIX=$(__check_image_override 'RICSIM')
+       if [ $? -ne 0 ]; then
+               echo -e $RED"Image setting from cmd line not consistent for RICSIM."$ERED
+               ((IMAGE_ERR++))
+       fi
+       __check_and_create_image_var " RIC Simulator" "RIC_SIM_IMAGE" "RIC_SIM_IMAGE_BASE" "RIC_SIM_IMAGE_TAG" $IMAGE_SUFFIX RICSIM
 fi
-__check_and_create_image_var " RIC Simulator" "RIC_SIM_IMAGE" "RIC_SIM_IMAGE_BASE" "RIC_SIM_IMAGE_TAG" $IMAGE_SUFFIX RICSIM
 
 #Remote ecs image
-IMAGE_SUFFIX=$(__check_image_override 'ECS')
-if [ $? -ne 0 ]; then
-       echo -e $RED"Image setting from cmd line not consistent for ECS."$EREDs
-       ((IMAGE_ERR++))
+__check_included_image 'ECS'
+if [ $? -eq 0 ]; then
+       IMAGE_SUFFIX=$(__check_image_override 'ECS')
+       if [ $? -ne 0 ]; then
+               echo -e $RED"Image setting from cmd line not consistent for ECS."$EREDs
+               ((IMAGE_ERR++))
+       fi
+       __check_and_create_image_var " ECS" "ECS_IMAGE" "ECS_IMAGE_BASE" "ECS_IMAGE_TAG" $IMAGE_SUFFIX ECS
 fi
-__check_and_create_image_var " ECS" "ECS_IMAGE" "ECS_IMAGE_BASE" "ECS_IMAGE_TAG" $IMAGE_SUFFIX ECS
 
 #Remote rc image
-IMAGE_SUFFIX=$(__check_image_override 'RC')
-if [ $? -ne 0 ]; then
-       echo -e $RED"Image setting from cmd line not consistent for RC."$ERED
-       ((IMAGE_ERR++))
+__check_included_image 'RC'
+if [ $? -eq 0 ]; then
+       IMAGE_SUFFIX=$(__check_image_override 'RC')
+       if [ $? -ne 0 ]; then
+               echo -e $RED"Image setting from cmd line not consistent for RC."$ERED
+               ((IMAGE_ERR++))
+       fi
+       __check_and_create_image_var " RC" "RAPP_CAT_IMAGE" "RAPP_CAT_IMAGE_BASE" "RAPP_CAT_IMAGE_TAG" $IMAGE_SUFFIX RC
 fi
-__check_and_create_image_var " RC" "RAPP_CAT_IMAGE" "RAPP_CAT_IMAGE_BASE" "RAPP_CAT_IMAGE_TAG" $IMAGE_SUFFIX RC
 
 # These images are not built as part of this project official images, just check that env vars are set correctly
-__check_and_create_image_var " Message Router"    "MRSTUB_IMAGE"    "MRSTUB_IMAGE_BASE"    "MRSTUB_IMAGE_TAG"    LOCAL               MR
-__check_and_create_image_var " Callback Receiver" "CR_IMAGE"        "CR_IMAGE_BASE"        "CR_IMAGE_TAG"        LOCAL               CR
-__check_and_create_image_var " Producer stub"     "PROD_STUB_IMAGE" "PROD_STUB_IMAGE_BASE" "PROD_STUB_IMAGE_TAG" LOCAL               PRODSTUB
-__check_and_create_image_var " Consul"            "CONSUL_IMAGE"    "CONSUL_IMAGE_BASE"    "CONSUL_IMAGE_TAG"    REMOTE_PROXY        CONSUL
-__check_and_create_image_var " CBS"               "CBS_IMAGE"       "CBS_IMAGE_BASE"       "CBS_IMAGE_TAG"       REMOTE_RELEASE_ONAP CBS
-__check_and_create_image_var " SDNC DB"           "SDNC_DB_IMAGE"   "SDNC_DB_IMAGE_BASE"   "SDNC_DB_IMAGE_TAG"   REMOTE_PROXY        SDNC #Uses sdnc app name
+__check_included_image 'MR'
+if [ $? -eq 0 ]; then
+       __check_and_create_image_var " Message Router stub"    "MRSTUB_IMAGE"    "MRSTUB_IMAGE_BASE"    "MRSTUB_IMAGE_TAG"    LOCAL               MR
+fi
+__check_included_image 'DMAAPMR'
+if [ $? -eq 0 ]; then
+       __check_and_create_image_var " DMAAP Message Router"    "ONAP_DMAAPMR_IMAGE"   "ONAP_DMAAPMR_IMAGE_BASE"    "ONAP_DMAAPMR_IMAGE_TAG"    REMOTE_RELEASE_ONAP               DMAAPMR
+       __check_and_create_image_var " ZooKeeper"   "ONAP_ZOOKEEPER_IMAGE" "ONAP_ZOOKEEPER_IMAGE_BASE"  "ONAP_ZOOKEEPER_IMAGE_TAG"  REMOTE_RELEASE_ONAP               DMAAPMR
+       __check_and_create_image_var " Kafka"       "ONAP_KAFKA_IMAGE"     "ONAP_KAFKA_IMAGE_BASE"      "ONAP_KAFKA_IMAGE_TAG"      REMOTE_RELEASE_ONAP               DMAAPMR
+fi
+__check_included_image 'CR'
+if [ $? -eq 0 ]; then
+       __check_and_create_image_var " Callback Receiver" "CR_IMAGE"        "CR_IMAGE_BASE"        "CR_IMAGE_TAG"        LOCAL               CR
+fi
+__check_included_image 'PRODSTUB'
+if [ $? -eq 0 ]; then
+       __check_and_create_image_var " Producer stub"     "PROD_STUB_IMAGE" "PROD_STUB_IMAGE_BASE" "PROD_STUB_IMAGE_TAG" LOCAL               PRODSTUB
+fi
+__check_included_image 'CONSUL'
+if [ $? -eq 0 ]; then
+       __check_and_create_image_var " Consul"            "CONSUL_IMAGE"    "CONSUL_IMAGE_BASE"    "CONSUL_IMAGE_TAG"    REMOTE_PROXY        CONSUL
+fi
+__check_included_image 'CBS'
+if [ $? -eq 0 ]; then
+       __check_and_create_image_var " CBS"               "CBS_IMAGE"       "CBS_IMAGE_BASE"       "CBS_IMAGE_TAG"       REMOTE_RELEASE_ONAP CBS
+fi
+__check_included_image 'SDNC'
+if [ $? -eq 0 ]; then
+       __check_and_create_image_var " SDNC DB"           "SDNC_DB_IMAGE"   "SDNC_DB_IMAGE_BASE"   "SDNC_DB_IMAGE_TAG"   REMOTE_PROXY        SDNC #Uses sdnc app name
+fi
+__check_included_image 'HTTPPROXY'
+if [ $? -eq 0 ]; then
+       __check_and_create_image_var " Http Proxy"        "HTTP_PROXY_IMAGE" "HTTP_PROXY_IMAGE_BASE" "HTTP_PROXY_IMAGE_TAG" REMOTE_PROXY HTTPPROXY
+fi
 
 #Errors in image setting - exit
 if [ $IMAGE_ERR -ne 0 ]; then
@@ -848,60 +908,39 @@ __check_and_pull_image() {
                fi
        elif [ $1 == "remote" ] || [ $1 == "remote-remove" ]; then
                if [ $1 == "remote-remove" ]; then
-                       echo -ne "  Attempt to stop and remove container(s), if running - ${SAMELINE}"
-                       tmp="$(docker ps -aq --filter name=${3})"
-                       if [ $? -eq 0 ] && [ ! -z "$tmp" ]; then
-                               docker stop $tmp &> ./tmp/.dockererr
-                               if [ $? -ne 0 ]; then
-                                       ((IMAGE_ERR++))
-                                       echo ""
-                                       echo -e $RED"  Container(s) could not be stopped - try manual stopping the container(s)"$ERED
-                                       cat ./tmp/.dockererr
-                                       return 1
+                       if [ $RUNMODE == "DOCKER" ]; then
+                               echo -ne "  Attempt to stop and remove container(s), if running - ${SAMELINE}"
+                               tmp="$(docker ps -aq --filter name=${3})"
+                               if [ $? -eq 0 ] && [ ! -z "$tmp" ]; then
+                                       docker stop $tmp &> ./tmp/.dockererr
+                                       if [ $? -ne 0 ]; then
+                                               ((IMAGE_ERR++))
+                                               echo ""
+                                               echo -e $RED"  Container(s) could not be stopped - try manual stopping the container(s)"$ERED
+                                               cat ./tmp/.dockererr
+                                               return 1
+                                       fi
                                fi
-                       fi
-                       echo -ne "  Attempt to stop and remove container(s), if running - "$GREEN"stopped"$EGREEN"${SAMELINE}"
-                       tmp="$(docker ps -aq --filter name=${3})" &> /dev/null
-                       if [ $? -eq 0 ] && [ ! -z "$tmp" ]; then
-                               docker rm $tmp &> ./tmp/.dockererr
-                               if [ $? -ne 0 ]; then
-                                       ((IMAGE_ERR++))
-                                       echo ""
-                                       echo -e $RED"  Container(s) could not be removed - try manual removal of the container(s)"$ERED
-                                       cat ./tmp/.dockererr
-                                       return 1
+                               echo -ne "  Attempt to stop and remove container(s), if running - "$GREEN"stopped"$EGREEN"${SAMELINE}"
+                               tmp="$(docker ps -aq --filter name=${3})" &> /dev/null
+                               if [ $? -eq 0 ] && [ ! -z "$tmp" ]; then
+                                       docker rm $tmp &> ./tmp/.dockererr
+                                       if [ $? -ne 0 ]; then
+                                               ((IMAGE_ERR++))
+                                               echo ""
+                                               echo -e $RED"  Container(s) could not be removed - try manual removal of the container(s)"$ERED
+                                               cat ./tmp/.dockererr
+                                               return 1
+                                       fi
                                fi
+                               echo -e "  Attempt to stop and remove container(s), if running - "$GREEN"stopped removed"$EGREEN
+                               tmp_im=""
+                       else
+                               tmp_im=""
                        fi
-                       echo -e "  Attempt to stop and remove container(s), if running - "$GREEN"stopped removed"$EGREEN
-                       # echo -ne "  Removing image - ${SAMELINE}"
-                       # tmp="$(docker images -q ${4})" &> /dev/null
-                       # if [ $? -eq 0 ] && [ ! -z "$tmp" ]; then
-                       #       docker rmi --force $4 &> ./tmp/.dockererr
-                       #       if [ $? -ne 0 ]; then
-                       #               ((IMAGE_ERR++))
-                       #               echo ""
-                       #               echo -e $RED"  Image could not be removed - try manual removal of the image"$ERED
-                       #               cat ./tmp/.dockererr
-                       #               return 1
-                       #       fi
-                       #       echo -e "  Removing image - "$GREEN"removed"$EGREEN
-                       # else
-                       #       echo -e "  Removing image - "$GREEN"image not in repository"$EGREEN
-                       # fi
-                       tmp_im=""
                fi
                if [ -z "$tmp_im" ]; then
                        echo -ne "  Pulling image${SAMELINE}"
-                       # docker pull $4        &> ./tmp/.dockererr
-                       # tmp_im=$(docker images ${4} | grep -v REPOSITORY)
-                       # if [ -z "$tmp_im" ]; then
-                       #       echo ""
-                       #       echo -e "  Pulling image -$RED could not be pulled"$ERED
-                       #       ((IMAGE_ERR++))
-                       #       cat ./tmp/.dockererr
-                       #       return 1
-                       # fi
-                       # echo -e "  Pulling image -$GREEN Pulled $EGREEN"
                        out=$(docker pull $4)
                        if [ $? -ne 0 ]; then
                                echo ""
@@ -1017,6 +1056,22 @@ else
        echo -e $YELLOW" Excluding SDNC image and related DB image from image check/pull"$EYELLOW
 fi
 
+__check_included_image 'HTTPPROXY'
+if [ $? -eq 0 ]; then
+       app="HTTPPROXY";                __check_and_pull_image $START_ARG "$app" $HTTP_PROXY_APP_NAME $HTTP_PROXY_IMAGE
+else
+       echo -e $YELLOW" Excluding Http Proxy image from image check/pull"$EYELLOW
+fi
+
+__check_included_image 'DMAAPMR'
+if [ $? -eq 0 ]; then
+       app="DMAAP Message Router";      __check_and_pull_image $START_ARG "$app" $MR_DMAAP_APP_NAME $ONAP_DMAAPMR_IMAGE
+       app="ZooKeeper";                 __check_and_pull_image $START_ARG "$app" $MR_ZOOKEEPER_APP_NAME $ONAP_ZOOKEEPER_IMAGE
+       app="Kafka";                     __check_and_pull_image $START_ARG "$app" $MR_KAFKA_APP_NAME $ONAP_KAFKA_IMAGE
+else
+       echo -e $YELLOW" Excluding DMAAP MR image and images (zookeeper, kafka) from image check/pull"$EYELLOW
+fi
+
 #Errors in image setting - exit
 if [ $IMAGE_ERR -ne 0 ]; then
        echo ""
@@ -1041,7 +1096,7 @@ __check_included_image 'MR'
 if [ $? -eq 0 ]; then
        cd $curdir
        cd ../mrstub
-       echo " Building mrstub image: $MRSTUB_IMAGE:$MRSTUB_IMAGE_TAG_LOCAL"
+       echo " Building mrstub image: $MRSTUB_IMAGE"
        docker build  --build-arg NEXUS_PROXY_REPO=$NEXUS_PROXY_REPO -t $MRSTUB_IMAGE . &> .dockererr
        if [ $? -eq 0 ]; then
                echo -e  $GREEN" Build Ok"$EGREEN
@@ -1060,7 +1115,7 @@ fi
 __check_included_image 'CR'
 if [ $? -eq 0 ]; then
        cd ../cr
-       echo " Building Callback Receiver image: $CR_IMAGE:$CR_IMAGE_TAG_LOCAL"
+       echo " Building Callback Receiver image: $CR_IMAGE"
        docker build  --build-arg NEXUS_PROXY_REPO=$NEXUS_PROXY_REPO -t $CR_IMAGE . &> .dockererr
        if [ $? -eq 0 ]; then
                echo -e  $GREEN" Build Ok"$EGREEN
@@ -1079,7 +1134,7 @@ fi
 __check_included_image 'PRODSTUB'
 if [ $? -eq 0 ]; then
        cd ../prodstub
-       echo " Building Producer stub image: $PROD_STUB_IMAGE:$PROD_STUB_IMAGE_TAG_LOCAL"
+       echo " Building Producer stub image: $PROD_STUB_IMAGE"
        docker build  --build-arg NEXUS_PROXY_REPO=$NEXUS_PROXY_REPO -t $PROD_STUB_IMAGE . &> .dockererr
        if [ $? -eq 0 ]; then
                echo -e  $GREEN" Build Ok"$EGREEN
@@ -1103,10 +1158,12 @@ echo -e $BOLD"Local docker registry images used in the this test script"$EBOLD
 docker_tmp_file=./tmp/.docker-images-table
 format_string="{{.Repository}}\\t{{.Tag}}\\t{{.CreatedSince}}\\t{{.Size}}\\t{{.CreatedAt}}"
 echo -e " Application\tRepository\tTag\tCreated since\tSize\tCreated at" > $docker_tmp_file
+
 __check_included_image 'PA'
 if [ $? -eq 0 ]; then
        echo -e " Policy Agent\t$(docker images --format $format_string $POLICY_AGENT_IMAGE)" >>   $docker_tmp_file
 fi
+
 __check_included_image 'ECS'
 if [ $? -eq 0 ]; then
        echo -e " ECS\t$(docker images --format $format_string $ECS_IMAGE)" >>   $docker_tmp_file
@@ -1125,7 +1182,13 @@ if [ $? -eq 0 ]; then
 fi
 __check_included_image 'MR'
 if [ $? -eq 0 ]; then
-       echo -e " Message Router\t$(docker images --format $format_string $MRSTUB_IMAGE)" >>   $docker_tmp_file
+       echo -e " Message Router stub\t$(docker images --format $format_string $MRSTUB_IMAGE)" >>   $docker_tmp_file
+fi
+__check_included_image 'DMAAPMR'
+if [ $? -eq 0 ]; then
+       echo -e " DMAAP Message Router\t$(docker images --format $format_string $ONAP_DMAAPMR_IMAGE)" >>   $docker_tmp_file
+       echo -e " ZooKeeper\t$(docker images --format $format_string $ONAP_ZOOKEEPER_IMAGE)" >>   $docker_tmp_file
+       echo -e " Kafka\t$(docker images --format $format_string $ONAP_KAFKA_IMAGE)" >>   $docker_tmp_file
 fi
 __check_included_image 'CR'
 if [ $? -eq 0 ]; then
@@ -1148,6 +1211,10 @@ if [ $? -eq 0 ]; then
        echo -e " SDNC A1 Controller\t$(docker images --format $format_string $SDNC_A1_CONTROLLER_IMAGE)" >>   $docker_tmp_file
        echo -e " SDNC DB\t$(docker images --format $format_string $SDNC_DB_IMAGE)" >>   $docker_tmp_file
 fi
+__check_included_image 'HTTPPROXY'
+if [ $? -eq 0 ]; then
+       echo -e " Http Proxy\t$(docker images --format $format_string $HTTP_PROXY_IMAGE)" >>   $docker_tmp_file
+fi
 
 column -t -s $'\t' $docker_tmp_file
 
@@ -1203,7 +1270,7 @@ print_result() {
                echo -e "\033[31m\033[1m\__ \ (__|   /| ||  _/ | |   | _/ _ \ | || |_| |_| |   / _| \033[0m"
                echo -e "\033[31m\033[1m|___/\___|_|_\___|_|   |_|   |_/_/ \_\___|____\___/|_|_\___|\033[0m"
        elif [ $RES_CONF_FAIL -ne 0 ]; then
-               echo -e "\033[1mOne or more configure regest has failed. Check the script log....\033[0m"
+               echo -e "\033[1mOne or more configurations has failed. Check the script log....\033[0m"
                echo -e "\033[31m\033[1m ___  ___ ___ ___ ___ _____   ___ _   ___ _   _   _ ___ ___ \033[0m"
                echo -e "\033[31m\033[1m/ __|/ __| _ \_ _| _ \_   _| | __/_\ |_ _| | | | | | _ \ __|\033[0m"
                echo -e "\033[31m\033[1m\__ \ (__|   /| ||  _/ | |   | _/ _ \ | || |_| |_| |   / _| \033[0m"
@@ -1351,8 +1418,8 @@ __check_app_name() {
 
 # Stop and remove all containers
 # args: -
-# (Function for test scripts)
-clean_containers() {
+# (Not for test scripts)
+__clean_containers() {
 
        echo -e $BOLD"Stopping and removing all running containers, by container name"$EBOLD
 
@@ -1360,14 +1427,18 @@ clean_containers() {
                                          "ECS                    " $(__check_app_name $ECS_APP_NAME)\
                                          "RAPP Catalogue         " $(__check_app_name $RAPP_CAT_APP_NAME)\
                                          "Non-RT RIC Simulator(s)" $(__check_app_name $RIC_SIM_PREFIX)\
-                                         "Message Router         " $(__check_app_name $MR_APP_NAME)\
+                                         "Message Router stub    " $(__check_app_name $MR_STUB_APP_NAME)\
+                                         "DMAAP Message Router   " $(__check_app_name $MR_DMAAP_APP_NAME)\
+                                         "Zookeeper              " $(__check_app_name $MR_ZOOKEEPER_APP_NAME)\
+                                         "Kafka                  " $(__check_app_name $MR_KAFKA_APP_NAME)\
                                          "Callback Receiver      " $(__check_app_name $CR_APP_NAME)\
                                          "Producer stub          " $(__check_app_name $PROD_STUB_APP_NAME)\
                                          "Control Panel          " $(__check_app_name $CONTROL_PANEL_APP_NAME)\
                                          "SDNC A1 Controller     " $(__check_app_name $SDNC_APP_NAME)\
                                          "SDNC DB                " $(__check_app_name $SDNC_DB_APP_NAME)\
                                          "CBS                    " $(__check_app_name $CBS_APP_NAME)\
-                                         "Consul                 " $(__check_app_name $CONSUL_APP_NAME))
+                                         "Consul                 " $(__check_app_name $CONSUL_APP_NAME)\
+                                         "Http Proxy             " $(__check_app_name $HTTP_PROXY_APP_NAME))
 
        nw=0 # Calc max width of container name, to make a nice table
        for (( i=1; i<${#CONTAINTER_NAMES[@]} ; i+=2 )) ; do
@@ -1428,996 +1499,879 @@ clean_containers() {
        fi
 }
 
-# Function stop and remove all container in the end of the test script, if the arg 'auto-clean' is given at test script start
-# args: -
-# (Function for test scripts)
-auto_clean_containers() {
-       echo
-       if [ "$AUTO_CLEAN" == "auto" ]; then
-               echo -e $BOLD"Initiating automatic cleaning of started containers"$EBOLD
-               clean_containers
-       fi
-}
-
-# Function to sleep a test case for a numner of seconds. Prints the optional text args as info
-# args: <sleep-time-in-sec> [any-text-in-quotes-to-be-printed]
-# (Function for test scripts)
-sleep_wait() {
+###################################
+### Functions for kube management
+###################################
 
-       echo -e $BOLD"INFO(${BASH_LINENO[0]}): "${FUNCNAME[0]}"," $@ $EBOLD
-       if [ $# -lt 1 ]; then
+# Scale a kube resource to a specific count
+# args: <resource-type> <resource-name> <namespace> <target-count>
+# (Not for test scripts)
+__kube_scale() {
+       echo -ne "  Setting $1 $2 replicas=$4 in namespace $3"$SAMELINE
+       kubectl scale  $1 $2  -n $3 --replicas=$4 1> /dev/null 2> ./tmp/kubeerr
+       if [ $? -ne 0 ]; then
+               echo -e "  Setting $1 $2 replicas=$4 in namespace $3 $RED Failed $ERED"
                ((RES_CONF_FAIL++))
-               __print_err "need at least one arg, <sleep-time-in-sec> [any-text-to-printed]" $@
-               exit 1
+               echo "  Message: $(<./tmp/kubeerr)"
+               return 1
+       else
+               echo -e "  Setting $1 $2 replicas=$4 in namespace $3 $GREEN OK $EGREEN"
        fi
-       #echo "---- Sleep for " $1 " seconds ---- "$2
-       start=$SECONDS
-       duration=$((SECONDS-start))
-       while [ $duration -lt $1 ]; do
-               echo -ne "  Slept for ${duration} seconds${SAMELINE}"
-               sleep 1
-               duration=$((SECONDS-start))
+
+       TSTART=$SECONDS
+
+       for i in {1..500}; do
+               count=$(kubectl get $1/$2  -n $3 -o jsonpath='{.status.replicas}' 2> /dev/null)
+               retcode=$?
+               if [ -z "$count" ]; then
+                       #No value is sometimes returned for some reason, in case the resource has replica 0
+                       count=0
+               fi
+               if [ $retcode -ne 0 ]; then
+                       echo -e "$RED  Cannot fetch current replica count for $1 $2 in namespace $3 $ERED"
+                       ((RES_CONF_FAIL++))
+                       return 1
+               fi
+               #echo ""
+               if [ $count -ne $4 ]; then
+                       echo -ne "  Waiting for $1 $2 replicas=$4 in namespace $3. Replicas=$count after $(($SECONDS-$TSTART)) seconds $SAMELINE"
+                       sleep $i
+               else
+                       echo -e "  Waiting for $1 $2 replicas=$4 in namespace $3. Replicas=$count after $(($SECONDS-$TSTART)) seconds"
+                       echo -e "  Replicas=$4 after $(($SECONDS-$TSTART)) seconds $GREEN OK $EGREEN"
+                       echo ""
+                       return 0
+               fi
        done
-       echo -ne "  Slept for ${duration} seconds${SAMELINE}"
        echo ""
+       echo -e "$RED  Replica count did not reach target replicas=$4. Failed with replicas=$count $ERED"
+       ((RES_CONF_FAIL++))
+       return 0
 }
 
-# Print error info for the call in the parent script (test case). Arg: <error-message-to-print>
-# Not to be called from the test script itself.
-__print_err() {
-    echo -e $RED ${FUNCNAME[1]} " "$1" " ${BASH_SOURCE[2]} " line" ${BASH_LINENO[1]} $ERED
-       if [ $# -gt 1 ]; then
-               echo -e $RED" Got: "${FUNCNAME[1]} ${@:2} $ERED
-       fi
-       ((RES_CONF_FAIL++))
+# Scale all kube resource sets to 0 in a namespace for resources having a certain lable and label-id
+# This function does not wait for the resource to reach 0
+# args: <namespace> <label-name> <label-id>
+# (Not for test scripts)
+__kube_scale_all_resources() {
+       namespace=$1
+       labelname=$2
+       labelid=$3
+       resources="deployment replicaset statefulset"
+       for restype in $resources; do
+               result=$(kubectl get $restype -n $namespace -o jsonpath='{.items[?(@.metadata.labels.'$labelname'=="'$labelid'")].metadata.name}')
+               if [ $? -eq 0 ] && [ ! -z "$result" ]; then
+                       deleted_resourcetypes=$deleted_resourcetypes" "$restype
+                       for resid in $result; do
+                               echo -ne "  Ordered caling $restype $resid from namespace $namespace with label $labelname=$labelid to 0"$SAMELINE
+                               kubectl scale  $restype $resid  -n $namespace --replicas=0 1> /dev/null 2> ./tmp/kubeerr
+                               echo -e "  Ordered scaling $restype $resid from namespace $namespace with label $labelname=$labelid to 0 $GREEN OK $EGREEN"
+                       done
+               fi
+       done
 }
 
+# Scale all kube resource sets to 0 in a namespace for resources having a certain lable and label-id
+# This function do wait for the resource to reach 0
+# args: <namespace> <label-name> <label-id>
+# (Not for test scripts)
+__kube_scale_and_wait_all_resources() {
+       namespace=$1
+       labelname=$2
+       labelid=$3
+       resources="deployment replicaset statefulset"
+       scaled_all=1
+       while [ $scaled_all -ne 0 ]; do
+               scaled_all=0
+               for restype in $resources; do
+                       result=$(kubectl get $restype -n $namespace -o jsonpath='{.items[?(@.metadata.labels.'$labelname'=="'$labelid'")].metadata.name}')
+                       if [ $? -eq 0 ] && [ ! -z "$result" ]; then
+                               for resid in $result; do
+                                       echo -e "  Ordered scaling $restype $resid from namespace $namespace with label $labelname=$labelid to 0"
+                                       kubectl scale  $restype $resid  -n $namespace --replicas=0 1> /dev/null 2> ./tmp/kubeerr
+                                       count=1
+                                       T_START=$SECONDS
+                                       while [ $count -ne 0 ]; do
+                                               count=$(kubectl get $restype $resid  -n $namespace -o jsonpath='{.status.replicas}' 2> /dev/null)
+                                               echo -ne "  Scaling $restype $resid from namespace $namespace with label $labelname=$labelid to 0,count=$count"$SAMELINE
+                                               if [ $? -eq 0 ] && [ ! -z "$count" ]; then
+                                                       sleep 0.5
+                                               else
+                                                       count=0
+                                               fi
+                                               duration=$(($SECONDS-$T_START))
+                                               if [ $duration -gt 100 ]; then
+                                                       #Forcring count 0, to avoid hanging for failed scaling
+                                                       scaled_all=1
+                                                       count=0
+                                               fi
+                                       done
+                                       echo -e "  Scaled $restype $resid from namespace $namespace with label $labelname=$labelid to 0,count=$count $GREEN OK $EGREEN"
+                               done
+                       fi
+               done
+       done
+}
 
-# Helper function to get a the port of a specific ric simulatpor
-# args: <ric-id>
+# Remove all kube resources in a namespace for resources having a certain label and label-id
+# This function wait until the resources are gone. Scaling to 0 must have been ordered previously
+# args: <namespace> <label-name> <label-id>
 # (Not for test scripts)
-__find_sim_port() {
-    name=$1" " #Space appended to prevent matching 10 if 1 is desired....
-    cmdstr="docker inspect --format='{{(index (index .NetworkSettings.Ports \"$RIC_SIM_PORT/tcp\") 0).HostPort}}' ${name}"
-    res=$(eval $cmdstr)
-       if [[ "$res" =~ ^[0-9]+$ ]]; then
-               echo $res
-       else
-               echo "0"
-    fi
+__kube_delete_all_resources() {
+       namespace=$1
+       labelname=$2
+       labelid=$3
+       resources="deployments replicaset statefulset services pods configmaps pvc"
+       deleted_resourcetypes=""
+       for restype in $resources; do
+               result=$(kubectl get $restype -n $namespace -o jsonpath='{.items[?(@.metadata.labels.'$labelname'=="'$labelid'")].metadata.name}')
+               if [ $? -eq 0 ] && [ ! -z "$result" ]; then
+                       deleted_resourcetypes=$deleted_resourcetypes" "$restype
+                       for resid in $result; do
+                               if [ $restype == "replicaset" ] || [ $restype == "statefulset" ]; then
+                                       count=1
+                                       while [ $count -ne 0 ]; do
+                                               count=$(kubectl get $restype $resid  -n $namespace -o jsonpath='{.status.replicas}' 2> /dev/null)
+                                               echo -ne "  Scaling $restype $resid from namespace $namespace with label $labelname=$labelid to 0,count=$count"$SAMELINE
+                                               if [ $? -eq 0 ] && [ ! -z "$count" ]; then
+                                                       sleep 0.5
+                                               else
+                                                       count=0
+                                               fi
+                                       done
+                                       echo -e "  Scaled $restype $resid from namespace $namespace with label $labelname=$labelid to 0,count=$count $GREEN OK $EGREEN"
+                               fi
+                               echo -ne "  Deleting $restype $resid from namespace $namespace with label $labelname=$labelid "$SAMELINE
+                               kubectl delete $restype $resid -n $namespace 1> /dev/null 2> ./tmp/kubeerr
+                               if [ $? -eq 0 ]; then
+                                       echo -e "  Deleted $restype $resid from namespace $namespace with label $labelname=$labelid $GREEN OK $EGREEN"
+                               else
+                                       echo -e "  Deleted $restype $resid from namespace $namespace with label $labelname=$labelid $GREEN Does not exist - OK $EGREEN"
+                               fi
+                               #fi
+                       done
+               fi
+       done
+       if [ ! -z "$deleted_resourcetypes" ]; then
+               for restype in $deleted_resources; do
+                       echo -ne "  Waiting for $restype in namespace $namespace with label $labelname=$labelid to be deleted..."$SAMELINE
+                       T_START=$SECONDS
+                       result="dummy"
+                       while [ ! -z "$result" ]; do
+                               sleep 0.5
+                               result=$(kubectl get $restype -n $namespace -o jsonpath='{.items[?(@.metadata.labels.'$labelname'=="'$labelid'")].metadata.name}')
+                               echo -ne "  Waiting for $restype in namespace $namespace with label $labelname=$labelid to be deleted...$(($SECONDS-$T_START)) seconds "$SAMELINE
+                               if [ -z "$result" ]; then
+                                       echo -e " Waiting for $restype in namespace $namespace with label $labelname=$labelid to be deleted...$(($SECONDS-$T_START)) seconds $GREEN OK $EGREEN"
+                               elif [ $(($SECONDS-$T_START)) -gt 300 ]; then
+                                       echo -e " Waiting for $restype in namespace $namespace with label $labelname=$labelid to be deleted...$(($SECONDS-$T_START)) seconds $RED Failed $ERED"
+                                       result=""
+                               fi
+                       done
+               done
+       fi
 }
 
-# Function to create the docker network for the test
-# Not to be called from the test script itself.
-__create_docker_network() {
-       tmp=$(docker network ls --format={{.Name}} --filter name=$DOCKER_SIM_NWNAME)
+# Creates a namespace if it does not exists
+# args: <namespace>
+# (Not for test scripts)
+__kube_create_namespace() {
+
+       #Check if test namespace exists, if not create it
+       kubectl get namespace $1 1> /dev/null 2> ./tmp/kubeerr
        if [ $? -ne 0 ]; then
-               echo -e $RED" Could not check if docker network $DOCKER_SIM_NWNAME exists"$ERED
-               return 1
-       fi
-       if [ "$tmp" != $DOCKER_SIM_NWNAME ]; then
-               echo -e " Creating docker network:$BOLD $DOCKER_SIM_NWNAME $EBOLD"
-               docker network create $DOCKER_SIM_NWNAME | indent2
+               echo -ne " Creating namespace "$1 $SAMELINE
+               kubectl create namespace $1 1> /dev/null 2> ./tmp/kubeerr
                if [ $? -ne 0 ]; then
-                       echo -e $RED" Could not create docker network $DOCKER_SIM_NWNAME"$ERED
+                       echo -e " Creating namespace $1 $RED$BOLD FAILED $EBOLD$ERED"
+                       ((RES_CONF_FAIL++))
+                       echo "  Message: $(<./tmp/kubeerr)"
                        return 1
                else
-                       echo -e "$GREEN  Done$EGREEN"
+                       echo -e " Creating namespace $1 $GREEN$BOLD OK $EBOLD$EGREEN"
                fi
        else
-               echo -e " Docker network $DOCKER_SIM_NWNAME already exists$GREEN OK $EGREEN"
+               echo -e " Creating namespace $1 $GREEN$BOLD Already exists, OK $EBOLD$EGREEN"
        fi
+       return 0
 }
 
-# Check if container is started by calling url on localhost using a port, expects response code 2XX
-# args: <container-name> <port> <url> https|https
-# Not to be called from the test script itself.
-__check_container_start() {
-       paramError=0
-       if [ $# -ne 4 ]; then
-               paramError=1
-       elif [ $4 != "http" ] && [ $4 != "https" ]; then
-               paramError=1
-       fi
-       if [ $paramError -ne 0 ]; then
+# Find the host ip of an app (using the service resource)
+# args: <app-name> <namespace>
+# (Not for test scripts)
+__kube_get_service_host() {
+       if [ $# -ne 2 ]; then
                ((RES_CONF_FAIL++))
-               __print_err "need 3 args, <container-name> <port> <url> https|https" $@
-               return 1
+       __print_err "need 2 args, <app-name> <namespace>" $@
+               exit 1
        fi
-       echo -ne " Container $BOLD$1$EBOLD starting${SAMELINE}"
-       appname=$1
-       localport=$2
-       url=$3
-       if [[ $appname != "STANDALONE_"* ]]     ; then
-               app_started=0
-               for i in {1..10}; do
-                       if [ "$(docker inspect --format '{{ .State.Running }}' $appname)" == "true" ]; then
-                                       echo -e " Container $BOLD$1$EBOLD$GREEN running$EGREEN on$BOLD image $(docker inspect --format '{{ .Config.Image }}' ${appname}) $EBOLD"
-                                       app_started=1
-                                       break
-                               else
-                                       sleep $i
+       for timeout in {1..60}; do
+               host=$(kubectl get svc $1  -n $2 -o jsonpath='{.spec.clusterIP}')
+               if [ $? -eq 0 ]; then
+                       if [ ! -z "$host" ]; then
+                               echo $host
+                               return 0
                        fi
-               done
-               if [ $app_started -eq 0 ]; then
-                       ((RES_CONF_FAIL++))
-                       echo ""
-                       echo -e $RED" Container $BOLD${appname}$EBOLD could not be started"$ERED
-                       echo -e $RED" Stopping script..."$ERED
-                       exit 1
                fi
-               if [ $localport -eq 0 ]; then
-                       while [ $localport -eq 0 ]; do
-                               echo -ne " Waiting for container ${appname} to publish its ports...${SAMELINE}"
-                               localport=$(__find_sim_port $appname)
-                               sleep 1
-                               echo -ne " Waiting for container ${appname} to publish its ports...retrying....${SAMELINE}"
-                       done
-                       echo -ne " Waiting for container ${appname} to publish its ports...retrying....$GREEN OK $EGREEN"
-                       echo ""
-               fi
-       fi
-
-       pa_st=false
-       echo -ne " Waiting for container ${appname} service status...${SAMELINE}"
-       TSTART=$SECONDS
-       for i in {1..50}; do
-               if [ $4 == "https" ]; then
-                       result="$(__do_curl "-k https://localhost:"${localport}${url})"
-               else
-                       result="$(__do_curl $LOCALHOST${localport}${url})"
-               fi
-               if [ $? -eq 0 ]; then
-                       if [ ${#result} -gt 15 ]; then
-                               #If response is too long, truncate
-                               result="...response text too long, omitted"
-                       fi
-                       echo -ne " Waiting for container $BOLD${appname}$EBOLD service status, result: $result${SAMELINE}"
-                       echo -ne " Container $BOLD${appname}$EBOLD$GREEN is alive$EGREEN, responds to service status:$GREEN $result $EGREEN after $(($SECONDS-$TSTART)) seconds"
-                       pa_st=true
-                       break
-               else
-                       TS_TMP=$SECONDS
-                       while [ $(($TS_TMP+$i)) -gt $SECONDS ]; do
-                               echo -ne " Waiting for container ${appname} service status...$(($SECONDS-$TSTART)) seconds, retrying in $(($TS_TMP+$i-$SECONDS)) seconds   ${SAMELINE}"
-                               sleep 1
-                       done
-               fi
+               sleep 0.5
        done
-
-       if [ "$pa_st" = "false"  ]; then
-               ((RES_CONF_FAIL++))
-               echo -e $RED" Container ${appname} did not respond to service status in $(($SECONDS-$TSTART)) seconds"$ERED
-               return 0
-       fi
-
-       echo ""
-       return 0
+       ((RES_CONF_FAIL++))
+       echo "host-not-found-fatal-error"
+       return 1
 }
 
+# Translate ric name to kube host name
+# args: <ric-name>
+# For test scripts
+get_kube_sim_host() {
+       name=$(echo "$1" | tr '_' '-')  #kube does not accept underscore in names
+       #example gnb_1_2 -> gnb-1-2
+       set_name=$(echo $name | rev | cut -d- -f2- | rev) # Cut index part of ric name to get the name of statefulset
+       # example gnb-g1-2 -> gnb-g1 where gnb-g1-2 is the ric name and gnb-g1 is the set name
+       echo $name"."$set_name"."$KUBE_NONRTRIC_NAMESPACE
 
-# Function to start a container and wait until it responds on the given port and url.
-#args: <docker-compose-dir> NODOCKERARGS|<docker-compose-arg> <app-name> <port-number> <alive-url> [<app-name> <port-number> <alive-url>]*
-__start_container() {
+}
 
-       variableArgCount=$(($#-2))
-       if [ $# -lt 6 ] && [ [ $(($variableArgCount%4)) -ne 0 ]; then
+# Find the named port to an app (using the service resource)
+# args: <app-name> <namespace> <port-name>
+# (Not for test scripts)
+__kube_get_service_port() {
+       if [ $# -ne 3 ]; then
                ((RES_CONF_FAIL++))
-       __print_err "need 6 or more args,  <docker-compose-dir> NODOCKERARGS|<docker-compose-arg> <app-name> <port-number> <alive-url> http|https [<app-name> <port-number> <alive-url> http|https ]*" $@
+       __print_err "need 3 args, <app-name> <namespace> <port-name>" $@
                exit 1
        fi
 
-       __create_docker_network
-
-       curdir=$PWD
-       cd $SIM_GROUP
-       cd $1
-
-       if [ "$2" == "NODOCKERARGS" ]; then
-               docker-compose up -d &> .dockererr
-               if [ $? -ne 0 ]; then
-                       echo -e $RED"Problem to launch container(s) with docker-compose"$ERED
-                       cat .dockererr
-                       echo -e $RED"Stopping script...."$ERED
-                       exit 1
-               fi
-       elif [ "$2" == "STANDALONE" ]; then
-               echo "Skipping docker-compose"
-       else
-               docker-compose up -d $2 &> .dockererr
-               if [ $? -ne 0 ]; then
-                       echo -e $RED"Problem to launch container(s) with docker-compose"$ERED
-                       cat .dockererr
-                       echo -e $RED"Stopping script...."$ERED
-                       exit 1
+       for timeout in {1..60}; do
+               port=$(kubectl get svc $1  -n $2 -o jsonpath='{...ports[?(@.name=="'$3'")].port}')
+               if [ $? -eq 0 ]; then
+                       if [ ! -z "$port" ]; then
+                               echo $port
+                               return 0
+                       fi
                fi
-       fi
-       app_prefix=""
-       if [ "$2" == "STANDALONE" ]; then
-               app_prefix="STANDALONE_"
-       fi
-       shift; shift;
-       cntr=0
-       while [ $cntr -lt $variableArgCount ]; do
-               app=$app_prefix$1; shift;
-               port=$1; shift;
-               url=$1; shift;
-               httpx=$1; shift;
-               let cntr=cntr+4
-
-               __check_container_start "$app" "$port" "$url" $httpx
+               sleep 0.5
        done
-
-       cd $curdir
-       echo ""
-       return 0
+       ((RES_CONF_FAIL++))
+       echo "0"
+       return 1
 }
 
-# Generate a UUID to use as prefix for policy ids
-generate_uuid() {
-       UUID=$(python3 -c 'import sys,uuid; sys.stdout.write(uuid.uuid4().hex)')
-       #Reduce length to make space for serial id, us 'a' as marker where the serial id is added
-       UUID=${UUID:0:${#UUID}-4}"a"
+# Create a kube resource from a yaml template
+# args: <resource-type> <resource-name> <template-yaml> <output-yaml>
+# (Not for test scripts)
+__kube_create_instance() {
+       echo -ne " Creating $1 $2"$SAMELINE
+       envsubst < $3 > $4
+       kubectl apply -f $4 1> /dev/null 2> ./tmp/kubeerr
+       if [ $? -ne 0 ]; then
+               ((RES_CONF_FAIL++))
+               echo -e " Creating $1 $2 $RED Failed $ERED"
+               echo "  Message: $(<./tmp/kubeerr)"
+               return 1
+       else
+               echo -e " Creating $1 $2 $GREEN OK $EGREEN"
+       fi
 }
 
-####################
-### Consul functions
-####################
-
-# Function to load config from a file into consul for the Policy Agent
-# arg: <json-config-file>
-# (Function for test scripts)
-consul_config_app() {
-
-       echo -e $BOLD"Configuring Consul"$EBOLD
-
-       if [ $# -ne 1 ]; then
+# Function to create a configmap in kubernetes
+# args: <configmap-name> <namespace> <labelname> <labelid> <path-to-data-file> <path-to-output-yaml>
+# (Not for test scripts)
+__kube_create_configmap() {
+       echo -ne " Creating configmap $1 "$SAMELINE
+       envsubst < $5 > $5"_tmp"
+       cp $5"_tmp" $5  #Need to copy back to orig file name since create configmap neeed the original file name
+       kubectl create configmap $1  -n $2 --from-file=$5 --dry-run=client -o yaml > $6
+       if [ $? -ne 0 ]; then
+               echo -e " Creating configmap $1 $RED Failed $ERED"
                ((RES_CONF_FAIL++))
-       __print_err "need one arg,  <json-config-file>" $@
-               exit 1
+               return 1
        fi
 
-       echo " Loading config for "$POLICY_AGENT_APP_NAME" from "$1
-
-       curlString="$LOCALHOST${CONSUL_EXTERNAL_PORT}/v1/kv/${POLICY_AGENT_APP_NAME}?dc=dc1 -X PUT -H Accept:application/json -H Content-Type:application/json -H X-Requested-With:XMLHttpRequest --data-binary @"$1
-       result=$(__do_curl "$curlString")
+       kubectl apply -f $6 1> /dev/null 2> ./tmp/kubeerr
        if [ $? -ne 0 ]; then
-               echo -e $RED" FAIL - json config could not be loaded to consul" $ERED
+               echo -e " Creating configmap $1 $RED Apply failed $ERED"
+               echo "  Message: $(<./tmp/kubeerr)"
                ((RES_CONF_FAIL++))
                return 1
        fi
-       body="$(__do_curl $LOCALHOST$CBS_EXTERNAL_PORT/service_component_all/$POLICY_AGENT_APP_NAME)"
-       echo $body > "./tmp/.output"$1
-
+       kubectl label configmap $1 -n $2 $3"="$4 --overwrite 1> /dev/null 2> ./tmp/kubeerr
        if [ $? -ne 0 ]; then
-               echo -e $RED" FAIL - json config could not be loaded from consul/cbs, contents cannot be checked." $ERED
+               echo -e " Creating configmap $1 $RED Labeling failed $ERED"
+               echo "  Message: $(<./tmp/kubeerr)"
                ((RES_CONF_FAIL++))
                return 1
-       else
-               targetJson=$(< $1)
-               targetJson="{\"config\":"$targetJson"}"
-               echo "TARGET JSON: $targetJson" >> $HTTPLOG
-               res=$(python3 ../common/compare_json.py "$targetJson" "$body")
-               if [ $res -ne 0 ]; then
-                       echo -e $RED" FAIL - policy json config read from consul/cbs is not equal to the intended json config...." $ERED
-                       ((RES_CONF_FAIL++))
-                       return 1
-               else
-                       echo -e $GREEN" Config loaded ok to consul"$EGREEN
-               fi
        fi
+       # Log the resulting map
+       kubectl get configmap $1 -n $2 -o yaml > $6
 
-       echo ""
-
+       echo -e " Creating configmap $1 $GREEN OK $EGREEN"
+       return 0
 }
 
-# Function to perpare the consul configuration according to the current simulator configuration
-# args: SDNC|NOSDNC <output-file>
-# (Function for test scripts)
-prepare_consul_config() {
-       echo -e $BOLD"Prepare Consul config"$EBOLD
-
-       echo " Writing consul config for "$POLICY_AGENT_APP_NAME" to file: "$2
+# This function scales or deletes all resources for app selected by the testcase.
+# args: -
+# (Not for test scripts)
+__clean_kube() {
+       echo -e $BOLD"Initialize kube services//pods/statefulsets/replicaset to initial state"$EBOLD
 
-       if [ $# != 2 ];  then
-               ((RES_CONF_FAIL++))
-       __print_err "need two args,  SDNC|NOSDNC <output-file>" $@
-               exit 1
+       # Scale prestarted or managed apps
+       __check_prestarted_image 'RICSIM'
+       if [ $? -eq 0 ]; then
+               echo -e " Scaling all kube resources for app $BOLD RICSIM $EBOLD to 0"
+               __kube_scale_and_wait_all_resources $KUBE_NONRTRIC_NAMESPACE app nonrtric-a1simulator
+       else
+               echo -e " Scaling all kube resources for app $BOLD RICSIM $EBOLD to 0"
+               __kube_scale_all_resources $KUBE_NONRTRIC_NAMESPACE autotest RICSIM
        fi
 
-       if [ $1 == "SDNC" ]; then
-               echo -e " Config$BOLD including SDNC$EBOLD configuration"
-       elif [ $1 == "NOSDNC" ];  then
-               echo -e " Config$BOLD excluding SDNC$EBOLD configuration"
+       __check_prestarted_image 'PA'
+       if [ $? -eq 0 ]; then
+               echo -e " Scaling all kube resources for app $BOLD PA $EBOLD to 0"
+               __kube_scale_and_wait_all_resources $KUBE_NONRTRIC_NAMESPACE app nonrtric-policymanagementservice
        else
-               ((RES_CONF_FAIL++))
-       __print_err "need two args,  SDNC|NOSDNC <output-file>" $@
-               exit 1
+           echo -e " Scaling all kube resources for app $BOLD PA $EBOLD to 0"
+               __kube_scale_all_resources $KUBE_NONRTRIC_NAMESPACE autotest PA
        fi
 
-       config_json="\n            {"
-       if [ $1 == "SDNC" ]; then
-               config_json=$config_json"\n   \"controller\": ["
-               config_json=$config_json"\n                     {"
-               config_json=$config_json"\n                       \"name\": \"$SDNC_APP_NAME\","
-               if [ $AGENT_STAND_ALONE -eq 0 ]; then
-                       config_json=$config_json"\n                       \"baseUrl\": \"$SDNC_HTTPX://$SDNC_APP_NAME:$SDNC_PORT\","
-               else
-                       config_json=$config_json"\n                       \"baseUrl\": \"$SDNC_HTTPX://localhost:$SDNC_LOCAL_PORT\","
-               fi
-               config_json=$config_json"\n                       \"userName\": \"$SDNC_USER\","
-               config_json=$config_json"\n                       \"password\": \"$SDNC_PWD\""
-               config_json=$config_json"\n                     }"
-               config_json=$config_json"\n   ],"
+       __check_prestarted_image 'ECS'
+       if [ $? -eq 0 ]; then
+               echo -e " Scaling all kube resources for app $BOLD ECS $EBOLD to 0"
+               __kube_scale_and_wait_all_resources $KUBE_NONRTRIC_NAMESPACE app nonrtric-enrichmentservice
+       else
+               echo -e " Scaling all kube resources for app $BOLD ECS $EBOLD to 0"
+               __kube_scale_all_resources $KUBE_NONRTRIC_NAMESPACE autotest ECS
        fi
 
-       config_json=$config_json"\n   \"streams_publishes\": {"
-       config_json=$config_json"\n                            \"dmaap_publisher\": {"
-       config_json=$config_json"\n                              \"type\": \"$MR_APP_NAME\","
-       config_json=$config_json"\n                              \"dmaap_info\": {"
-       if [ $AGENT_STAND_ALONE -eq 0 ]; then
-               config_json=$config_json"\n                                \"topic_url\": \"$MR_HTTPX://$MR_APP_NAME:$MR_PORT$MR_WRITE_URL\""
-       else
-               config_json=$config_json"\n                                \"topic_url\": \"$MR_HTTPX://localhost:$MR_LOCAL_PORT$MR_WRITE_URL\""
-       fi
-       config_json=$config_json"\n                              }"
-       config_json=$config_json"\n                            }"
-       config_json=$config_json"\n   },"
-       config_json=$config_json"\n   \"streams_subscribes\": {"
-       config_json=$config_json"\n                             \"dmaap_subscriber\": {"
-       config_json=$config_json"\n                               \"type\": \"$MR_APP_NAME\","
-       config_json=$config_json"\n                               \"dmaap_info\": {"
-       if [ $AGENT_STAND_ALONE -eq 0 ]; then
-               config_json=$config_json"\n                                   \"topic_url\": \"$MR_HTTPX://$MR_APP_NAME:$MR_PORT$MR_READ_URL\""
+       __check_prestarted_image 'RC'
+       if [ $? -eq 0 ]; then
+               echo -e " Scaling all kube resources for app $BOLD RC $EBOLD to 0"
+               __kube_scale_and_wait_all_resources $KUBE_NONRTRIC_NAMESPACE app nonrtric-rappcatalogueservice
        else
-               config_json=$config_json"\n                                   \"topic_url\": \"$MR_HTTPX://localhost:$MR_LOCAL_PORT$MR_READ_URL\""
+               echo -e " Scaling all kube resources for app $BOLD RC $EBOLD to 0"
+               __kube_scale_all_resources $KUBE_NONRTRIC_NAMESPACE autotest RC
        fi
-       config_json=$config_json"\n                                 }"
-       config_json=$config_json"\n                               }"
-       config_json=$config_json"\n   },"
 
-       config_json=$config_json"\n   \"ric\": ["
-
-       rics=$(docker ps | grep $RIC_SIM_PREFIX | awk '{print $NF}')
+       __check_prestarted_image 'CP'
+       if [ $? -eq 0 ]; then
+               echo -e " CP replicas kept as is"
+       else
+               echo -e " Scaling all kube resources for app $BOLD CP $EBOLD to 0"
+               __kube_scale_all_resources $KUBE_NONRTRIC_NAMESPACE autotest CP
+       fi
 
-       if [ $? -ne 0 ] || [ -z "$rics" ]; then
-               echo -e $RED" FAIL - the names of the running RIC Simulator cannot be retrieved." $ERED
-               ((RES_CONF_FAIL++))
-               return 1
+       __check_prestarted_image 'SDNC'
+       if [ $? -eq 0 ]; then
+               echo -e " SDNC replicas kept as is"
+       else
+               echo -e " Scaling all kube resources for app $BOLD SDNC $EBOLD to 0"
+               __kube_scale_all_resources $KUBE_NONRTRIC_NAMESPACE autotest SDNC
        fi
 
-       cntr=0
-       for ric in $rics; do
-               if [ $cntr -gt 0 ]; then
-                       config_json=$config_json"\n          ,"
-               fi
-               config_json=$config_json"\n          {"
-               config_json=$config_json"\n            \"name\": \"$ric\","
-               if [ $AGENT_STAND_ALONE -eq 0 ]; then
-                       config_json=$config_json"\n            \"baseUrl\": \"$RIC_SIM_HTTPX://$ric:$RIC_SIM_PORT\","
-               else
-                       config_json=$config_json"\n            \"baseUrl\": \"$RIC_SIM_HTTPX://localhost:$(__find_sim_port $ric)\","
-               fi
-               if [ $1 == "SDNC" ]; then
-                       config_json=$config_json"\n            \"controller\": \"$SDNC_APP_NAME\","
-               fi
-               config_json=$config_json"\n            \"managedElementIds\": ["
-               config_json=$config_json"\n              \"me1_$ric\","
-               config_json=$config_json"\n              \"me2_$ric\""
-               config_json=$config_json"\n            ]"
-               config_json=$config_json"\n          }"
-               let cntr=cntr+1
-       done
+       __check_prestarted_image 'MR'
+       if [ $? -eq 0 ]; then
+               echo -e " MR replicas kept as is"
+       else
+               echo -e " Scaling all kube resources for app $BOLD MR $EBOLD to 0"
+               __kube_scale_all_resources $KUBE_ONAP_NAMESPACE autotest MR
+       fi
 
-       config_json=$config_json"\n           ]"
-       config_json=$config_json"\n}"
+       __check_prestarted_image 'DMAAPMR'
+       if [ $? -eq 0 ]; then
+               echo -e " DMAAP replicas kept as is"
+       else
+               echo -e " Scaling all kube resources for app $BOLD DMAAPMR $EBOLD to 0"
+               __kube_scale_all_resources $KUBE_ONAP_NAMESPACE autotest DMAAPMR
+       fi
 
+       echo -e " Scaling all kube resources for app $BOLD CR $EBOLD to 0"
+       __kube_scale_all_resources $KUBE_SIM_NAMESPACE autotest CR
 
-       printf "$config_json">$2
+       echo -e " Scaling all kube resources for app $BOLD PRODSTUB $EBOLD to 0"
+       __kube_scale_all_resources $KUBE_SIM_NAMESPACE autotest PRODSTUB
 
-       echo ""
-}
+       echo -e " Scaling all kube resources for app $BOLD HTTPPROXY $EBOLD to 0"
+       __kube_scale_all_resources $KUBE_SIM_NAMESPACE autotest HTTPPROXY
 
 
-# Start Consul and CBS
-# args: -
-# (Function for test scripts)
-start_consul_cbs() {
+       ## Clean all managed apps
 
-       echo -e $BOLD"Starting Consul and CBS"$EBOLD
-       __check_included_image 'CONSUL'
+       __check_prestarted_image 'RICSIM'
        if [ $? -eq 1 ]; then
-               echo -e $RED"The Consul image has not been checked for this test run due to arg to the test script"$ERED
-               echo -e $RED"Consul will not be started"$ERED
-               exit
+               echo -e " Deleting all kube resources for app $BOLD RICSIM $EBOLD"
+               __kube_delete_all_resources $KUBE_NONRTRIC_NAMESPACE autotest RICSIM
        fi
-       __start_container consul_cbs NODOCKERARGS  "$CONSUL_APP_NAME" "$CONSUL_EXTERNAL_PORT" "/ui/dc1/kv" "http" \
-                                                    "$CBS_APP_NAME" "$CBS_EXTERNAL_PORT" "/healthcheck" "http"
-}
-
-###########################
-### RIC Simulator functions
-###########################
 
-use_simulator_http() {
-       echo -e $BOLD"RICSIM protocol setting"$EBOLD
-       echo -e " Using $BOLD http $EBOLD towards the simulators"
-       export RIC_SIM_HTTPX="http"
-       export RIC_SIM_LOCALHOST=$RIC_SIM_HTTPX"://localhost:"
-       export RIC_SIM_PORT=$RIC_SIM_INTERNAL_PORT
-       echo ""
-}
-
-use_simulator_https() {
-       echo -e $BOLD"RICSIM protocol setting"$EBOLD
-       echo -e " Using $BOLD https $EBOLD towards the simulators"
-       export RIC_SIM_HTTPX="https"
-       export RIC_SIM_LOCALHOST=$RIC_SIM_HTTPX"://localhost:"
-       export RIC_SIM_PORT=$RIC_SIM_INTERNAL_SECURE_PORT
-       echo ""
-}
-
-# Start one group (ricsim_g1, ricsim_g2 .. ricsim_g5) with a number of RIC Simulators using a given A interface
-# 'ricsim' may be set on command line to other prefix
-# args:  ricsim_g1|ricsim_g2|ricsim_g3|ricsim_g4|ricsim_g5 <count> <interface-id>
-# (Function for test scripts)
-start_ric_simulators() {
-
-       echo -e $BOLD"Starting RIC Simulators"$EBOLD
-
-       __check_included_image 'RICSIM'
+       __check_prestarted_image 'PA'
        if [ $? -eq 1 ]; then
-               echo -e $RED"The Near-RT RIC Simulator image has not been checked for this test run due to arg to the test script"$ERED
-               echo -e $RED"The Near-RT RIC Simulartor(s) will not be started"$ERED
-               exit
+           echo -e " Deleting all kube resources for app $BOLD PA $EBOLD"
+               __kube_delete_all_resources $KUBE_NONRTRIC_NAMESPACE autotest PA
        fi
 
-       RIC1=$RIC_SIM_PREFIX"_g1"
-       RIC2=$RIC_SIM_PREFIX"_g2"
-       RIC3=$RIC_SIM_PREFIX"_g3"
-       RIC4=$RIC_SIM_PREFIX"_g4"
-       RIC5=$RIC_SIM_PREFIX"_g5"
-
-       if [ $# != 3 ]; then
-               ((RES_CONF_FAIL++))
-       __print_err "need three args,  $RIC1|$RIC2|$RIC3|$RIC4|$RIC5 <count> <interface-id>" $@
-               exit 1
-       fi
-       echo " $2 simulators using basename: $1 on interface: $3"
-       #Set env var for simulator count and A1 interface vesion for the given group
-       if [ $1 == "$RIC1" ]; then
-               G1_COUNT=$2
-               G1_A1_VERSION=$3
-       elif [ $1 == "$RIC2" ]; then
-               G2_COUNT=$2
-               G2_A1_VERSION=$3
-       elif [ $1 == "$RIC3" ]; then
-               G3_COUNT=$2
-               G3_A1_VERSION=$3
-       elif [ $1 == "$RIC4" ]; then
-               G4_COUNT=$2
-               G4_A1_VERSION=$3
-       elif [ $1 == "$RIC5" ]; then
-               G5_COUNT=$2
-               G5_A1_VERSION=$3
-       else
-               ((RES_CONF_FAIL++))
-       __print_err "need three args, $RIC1|$RIC2|$RIC3|$RIC4|$RIC5 <count> <interface-id>" $@
-               exit 1
+       __check_prestarted_image 'ECS'
+       if [ $? -eq 1 ]; then
+               echo -e " Deleting all kube resources for app $BOLD ECS $EBOLD"
+               __kube_delete_all_resources $KUBE_NONRTRIC_NAMESPACE autotest ECS
        fi
 
-       # Create .env file to compose project, all ric container will get this prefix
-       echo "COMPOSE_PROJECT_NAME="$RIC_SIM_PREFIX > $SIM_GROUP/ric/.env
-
-       export G1_A1_VERSION
-       export G2_A1_VERSION
-       export G3_A1_VERSION
-       export G4_A1_VERSION
-       export G5_A1_VERSION
-
-       docker_args="--scale g1=$G1_COUNT --scale g2=$G2_COUNT --scale g3=$G3_COUNT --scale g4=$G4_COUNT --scale g5=$G5_COUNT"
-       app_data=""
-       cntr=1
-       while [ $cntr -le $2 ]; do
-               app=$1"_"$cntr
-               port=0
-               app_data="$app_data $app $port / "$RIC_SIM_HTTPX
-               let cntr=cntr+1
-       done
-       __start_container ric "$docker_args" $app_data
-
-}
-
-###########################
-### Control Panel functions
-###########################
-
-# Start the Control Panel container
-# args: -
-# (Function for test scripts)
-start_control_panel() {
-
-       echo -e $BOLD"Starting Control Panel"$EBOLD
-       __check_included_image 'CP'
+       __check_prestarted_image 'RC'
        if [ $? -eq 1 ]; then
-               echo -e $RED"The Control Panel image has not been checked for this test run due to arg to the test script"$ERED
-               echo -e $RED"The Control Panel will not be started"$ERED
-               exit
+               echo -e " Deleting all kube resources for app $BOLD RC $EBOLD"
+               __kube_delete_all_resources $KUBE_NONRTRIC_NAMESPACE autotest RC
        fi
-       __start_container control_panel NODOCKERARGS $CONTROL_PANEL_APP_NAME $CONTROL_PANEL_EXTERNAL_PORT "/" "http"
-
-}
 
-###########################
-### RAPP Catalogue
-###########################
-
-# Start the RAPP Catalogue container
-# args: -
-# (Function for test scripts)
-start_rapp_catalogue() {
-
-       echo -e $BOLD"Starting RAPP Catalogue"$EBOLD
-
-       __check_included_image 'RC'
+       __check_prestarted_image 'CP'
        if [ $? -eq 1 ]; then
-               echo -e $RED"The RAPP Catalogue image has not been checked for this test run due to arg to the test script"$ERED
-               echo -e $RED"The RAPP Catalogue will not be started"$ERED
-               exit
+               echo -e " Deleting all kube resources for app $BOLD CP $EBOLD"
+               __kube_delete_all_resources $KUBE_NONRTRIC_NAMESPACE autotest CP
        fi
-       __start_container rapp_catalogue NODOCKERARGS $RAPP_CAT_APP_NAME $RAPP_CAT_EXTERNAL_PORT "/services" "http"
-}
-
-use_rapp_catalogue_http() {
-       echo -e $BOLD"RAPP Catalogue protocol setting"$EBOLD
-       echo -e " Using $BOLD http $EBOLD towards the RAPP Catalogue"
-       export RAPP_CAT_HTTPX="http"
-       export RAPP_CAT_PORT=$RAPP_CAT_INTERNAL_PORT
-       export RAPP_CAT_LOCAL_PORT=$RAPP_CAT_EXTERNAL_PORT
-       echo ""
-}
-
-use_rapp_catalogue_https() {
-       echo -e $BOLD"RAPP Catalogue protocol setting"$EBOLD
-       echo -e " Using $BOLD https $EBOLD towards the RAPP Catalogue"
-       export RAPP_CAT_HTTPX="https"
-       export RAPP_CAT_PORT=$RAPP_CAT_INTERNAL_PORT
-       export RAPP_CAT_LOCAL_PORT=$RAPP_CAT_EXTERNAL_PORT
-       echo ""
-}
-
-##################
-### SDNC functions
-##################
-
-# Start the SDNC A1 Controller
-# args: -
-# (Function for test scripts)
-start_sdnc() {
-
-       echo -e $BOLD"Starting SDNC A1 Controller"$EBOLD
 
-       __check_included_image 'SDNC'
+       __check_prestarted_image 'SDNC'
        if [ $? -eq 1 ]; then
-               echo -e $RED"The image for SDNC and the related DB has not been checked for this test run due to arg to the test script"$ERED
-               echo -e $RED"SDNC will not be started"$ERED
-               exit
+               echo -e " Deleting all kube resources for app $BOLD SDNC $EBOLD"
+               __kube_delete_all_resources $KUBE_NONRTRIC_NAMESPACE autotest SDNC
        fi
 
-       __start_container sdnc NODOCKERARGS $SDNC_APP_NAME $SDNC_EXTERNAL_PORT $SDNC_ALIVE_URL "http"
-
-}
-
-use_sdnc_http() {
-       echo -e $BOLD"SDNC protocol setting"$EBOLD
-       echo -e " Using $BOLD http $EBOLD towards SDNC"
-       export SDNC_HTTPX="http"
-       export SDNC_PORT=$SDNC_INTERNAL_PORT
-       export SDNC_LOCAL_PORT=$SDNC_EXTERNAL_PORT
-       echo ""
-}
-
-use_sdnc_https() {
-       echo -e $BOLD"SDNC protocol setting"$EBOLD
-       echo -e " Using $BOLD https $EBOLD towards SDNC"
-       export SDNC_HTTPX="https"
-       export SDNC_PORT=$SDNC_INTERNAL_SECURE_PORT
-       export SDNC_LOCAL_PORT=$SDNC_EXTERNAL_SECURE_PORT
-       echo ""
-}
-
-#####################
-### MR stub functions
-#####################
-
-# Start the Message Router stub interface in the simulator group
-# args: -
-# (Function for test scripts)
-start_mr() {
-
-       echo -e $BOLD"Starting Message Router 'mrstub'"$EBOLD
-       __check_included_image 'MR'
+       __check_prestarted_image 'MR'
        if [ $? -eq 1 ]; then
-               echo -e $RED"The Message Router image has not been checked for this test run due to arg to the test script"$ERED
-               echo -e $RED"The Message Router will not be started"$ERED
-               exit
+               echo -e " Deleting all kube resources for app $BOLD MR $EBOLD"
+               __kube_delete_all_resources $KUBE_ONAP_NAMESPACE autotest MR
        fi
-       export MR_CERT_MOUNT_DIR="./cert"
-       __start_container mr NODOCKERARGS $MR_APP_NAME $MR_EXTERNAL_PORT "/" "http"
-}
-
-use_mr_http() {
-       echo -e $BOLD"MR protocol setting"$EBOLD
-       echo -e " Using $BOLD http $EBOLD towards MR"
-       export MR_HTTPX="http"
-       export MR_PORT=$MR_INTERNAL_PORT
-       export MR_LOCAL_PORT=$MR_EXTERNAL_PORT
-       echo ""
-}
 
-use_mr_https() {
-       echo -e $BOLD"MR protocol setting"$EBOLD
-       echo -e " Using $BOLD https $EBOLD towards MR"
-       export MR_HTTPX="https"
-       export MR_PORT=$MR_INTERNAL_SECURE_PORT
-       export MR_LOCAL_PORT=$MR_EXTERNAL_SECURE_PORT
-       echo ""
-}
-
-
-################
-### CR functions
-################
-
-# Start the Callback reciver in the simulator group
-# args: -
-# (Function for test scripts)
-start_cr() {
-
-       echo -e $BOLD"Starting Callback Receiver"$EBOLD
-       __check_included_image 'CR'
+       __check_prestarted_image 'DMAAPMR'
        if [ $? -eq 1 ]; then
-               echo -e $RED"The Callback Receiver image has not been checked for this test run due to arg to the test script"$ERED
-               echo -e $RED"The Callback Receiver will not be started"$ERED
-               exit
+               echo -e " Deleting all kube resources for app $BOLD DMAAPMR $EBOLD"
+               __kube_delete_all_resources $KUBE_ONAP_NAMESPACE autotest DMAAPMR
        fi
-       __start_container cr NODOCKERARGS $CR_APP_NAME $CR_EXTERNAL_PORT "/" "http"
 
-}
+       echo -e " Deleting all kube resources for app $BOLD CR $EBOLD"
+       __kube_delete_all_resources $KUBE_SIM_NAMESPACE autotest CR
 
-use_cr_http() {
-       echo -e $BOLD"CR protocol setting"$EBOLD
-       echo -e " Using $BOLD http $EBOLD towards CR"
-       export CR_HTTPX="http"
-       export CR_PORT=$CR_INTERNAL_PORT
-       export CR_LOCAL_PORT=$CR_EXTERNAL_PORT
-       export CR_PATH="$CR_HTTPX://$CR_APP_NAME:$CR_PORT$CR_APP_CALLBACK"
-       echo ""
-}
+       echo -e " Deleting all kube resources for app $BOLD PRODSTUB $EBOLD"
+       __kube_delete_all_resources $KUBE_SIM_NAMESPACE autotest PRODSTUB
+
+       echo -e " Deleting all kube resources for app $BOLD HTTPPROXY $EBOLD"
+       __kube_delete_all_resources $KUBE_SIM_NAMESPACE autotest HTTPPROXY
 
-use_cr_https() {
-       echo -e $BOLD"CR protocol setting"$EBOLD
-       echo -e " Using $BOLD https $EBOLD towards CR"
-       export CR_HTTPX="https"
-       export CR_PORT=$CR_INTERNAL_SECURE_PORT
-       export CR_LOCAL_PORT=$CR_EXTERNAL_SECURE_PORT
-       export CR_PATH="$CR_HTTPX://$CR_APP_NAME:$CR_PORT$CR_APP_CALLBACK"
        echo ""
 }
 
-###########################
-### Producer stub functions
-###########################
-
-# Start the Producer stub in the simulator group
+# # This function scales or deletes all resources for app selected by the testcase.
+# # args: -
+# # (Not for test scripts)
+# __clean_kube() {
+#      echo -e $BOLD"Initialize kube services//pods/statefulsets/replicaset to initial state"$EBOLD
+
+#      # Clean prestarted apps
+#      __check_prestarted_image 'RICSIM'
+#      if [ $? -eq 0 ]; then
+#              echo -e " Scaling all kube resources for app $BOLD RICSIM $EBOLD to 0"
+#              __kube_scale_and_wait_all_resources $KUBE_NONRTRIC_NAMESPACE app nonrtric-a1simulator
+#      fi
+
+#      __check_prestarted_image 'PA'
+#      if [ $? -eq 0 ]; then
+#              echo -e " Scaling all kube resources for app $BOLD PA $EBOLD to 0"
+#              __kube_scale_and_wait_all_resources $KUBE_NONRTRIC_NAMESPACE app nonrtric-policymanagementservice
+#      fi
+
+#      __check_prestarted_image 'ECS'
+#      if [ $? -eq 0 ]; then
+#              echo -e " Scaling all kube resources for app $BOLD ECS $EBOLD to 0"
+#              __kube_scale_and_wait_all_resources $KUBE_NONRTRIC_NAMESPACE app nonrtric-enrichmentservice
+#      fi
+
+#      __check_prestarted_image 'RC'
+#      if [ $? -eq 0 ]; then
+#              echo -e " Scaling all kube resources for app $BOLD RC $EBOLD to 0"
+#              __kube_scale_and_wait_all_resources $KUBE_NONRTRIC_NAMESPACE app nonrtric-rappcatalogueservice
+#      fi
+
+#      __check_prestarted_image 'CP'
+#      if [ $? -eq 0 ]; then
+#              echo -e " CP replicas kept as is"
+#      fi
+
+#      __check_prestarted_image 'SDNC'
+#      if [ $? -eq 0 ]; then
+#              echo -e " SDNC replicas kept as is"
+#      fi
+
+#      __check_prestarted_image 'MR'
+#      if [ $? -eq 0 ]; then
+#              echo -e " MR replicas kept as is"
+#      fi
+
+
+#      # Clean included apps - apps fully managed by the script
+
+#      ## Scale all to zero
+#      __check_included_image 'RICSIM'
+#      if [ $? -eq 0 ]; then
+#              echo -e " Scaling all kube resources for app $BOLD RICSIM $EBOLD to 0"
+#              __kube_scale_all_resources $KUBE_NONRTRIC_NAMESPACE autotest RICSIM
+#      fi
+
+#      __check_included_image 'PA'
+#      if [ $? -eq 0 ]; then
+#          echo -e " Scaling all kube resources for app $BOLD PA $EBOLD to 0"
+#              __kube_scale_all_resources $KUBE_NONRTRIC_NAMESPACE autotest PA
+#      fi
+
+#      __check_included_image 'ECS'
+#      if [ $? -eq 0 ]; then
+#              echo -e " Scaling all kube resources for app $BOLD ECS $EBOLD to 0"
+#              __kube_scale_all_resources $KUBE_NONRTRIC_NAMESPACE autotest ECS
+#      fi
+
+#      __check_included_image 'RC'
+#      if [ $? -eq 0 ]; then
+#              echo -e " Scaling all kube resources for app $BOLD RC $EBOLD to 0"
+#              __kube_scale_all_resources $KUBE_NONRTRIC_NAMESPACE autotest RC
+#      fi
+
+#      __check_included_image 'CP'
+#      if [ $? -eq 0 ]; then
+#              echo -e " Scaling all kube resources for app $BOLD CP $EBOLD to 0"
+#              __kube_scale_all_resources $KUBE_NONRTRIC_NAMESPACE autotest CP
+#      fi
+
+#      __check_included_image 'SDNC'
+#      if [ $? -eq 0 ]; then
+#              echo -e " Scaling all kube resources for app $BOLD SDNC $EBOLD to 0"
+#              __kube_scale_all_resources $KUBE_NONRTRIC_NAMESPACE autotest SDNC
+#      fi
+
+#      __check_included_image 'CR'
+#      if [ $? -eq 0 ]; then
+#              echo -e " Scaling all kube resources for app $BOLD CR $EBOLD to 0"
+#              __kube_scale_all_resources $KUBE_SIM_NAMESPACE autotest CR
+#      fi
+
+#      __check_included_image 'MR'
+#      if [ $? -eq 0 ]; then
+#              echo -e " Scaling all kube resources for app $BOLD MR $EBOLD to 0"
+#              __kube_scale_all_resources $KUBE_ONAP_NAMESPACE autotest MR
+#      fi
+
+#      __check_included_image 'PRODSTUB'
+#      if [ $? -eq 0 ]; then
+#              echo -e " Scaling all kube resources for app $BOLD PRODSTUB $EBOLD to 0"
+#              __kube_scale_all_resources $KUBE_SIM_NAMESPACE autotest PRODSTUB
+#      fi
+
+
+#      ## Remove all resources
+
+#      __check_included_image 'RICSIM'
+#      if [ $? -eq 0 ]; then
+#              echo -e " Deleting all kube resources for app $BOLD RICSIM $EBOLD"
+#              __kube_delete_all_resources $KUBE_NONRTRIC_NAMESPACE autotest RICSIM
+#      fi
+
+#      __check_included_image 'PA'
+#      if [ $? -eq 0 ]; then
+#          echo -e " Deleting all kube resources for app $BOLD PA $EBOLD"
+#              __kube_delete_all_resources $KUBE_NONRTRIC_NAMESPACE autotest PA
+#      fi
+
+#      __check_included_image 'ECS'
+#      if [ $? -eq 0 ]; then
+#              echo -e " Deleting all kube resources for app $BOLD ECS $EBOLD"
+#              __kube_delete_all_resources $KUBE_NONRTRIC_NAMESPACE autotest ECS
+#      fi
+
+#      __check_included_image 'RC'
+#      if [ $? -eq 0 ]; then
+#              echo -e " Deleting all kube resources for app $BOLD RC $EBOLD"
+#              __kube_delete_all_resources $KUBE_NONRTRIC_NAMESPACE autotest RC
+#      fi
+
+#      __check_included_image 'CP'
+#      if [ $? -eq 0 ]; then
+#              echo -e " Deleting all kube resources for app $BOLD CP $EBOLD"
+#              __kube_delete_all_resources $KUBE_NONRTRIC_NAMESPACE autotest CP
+#      fi
+
+#      __check_included_image 'SDNC'
+#      if [ $? -eq 0 ]; then
+#              echo -e " Deleting all kube resources for app $BOLD SDNC $EBOLD"
+#              __kube_delete_all_resources $KUBE_NONRTRIC_NAMESPACE autotest SDNC
+#      fi
+
+#      __check_included_image 'CR'
+#      if [ $? -eq 0 ]; then
+#              echo -e " Deleting all kube resources for app $BOLD CR $EBOLD"
+#              __kube_delete_all_resources $KUBE_SIM_NAMESPACE autotest CR
+#      fi
+
+#      __check_included_image 'MR'
+#      if [ $? -eq 0 ]; then
+#              echo -e " Deleting all kube resources for app $BOLD MR $EBOLD"
+#              __kube_delete_all_resources $KUBE_ONAP_NAMESPACE autotest MR
+#      fi
+
+#      __check_included_image 'PRODSTUB'
+#      if [ $? -eq 0 ]; then
+#              echo -e " Deleting all kube resources for app $BOLD PRODSTUB $EBOLD"
+#              __kube_delete_all_resources $KUBE_SIM_NAMESPACE autotest PRODSTUB
+#      fi
+
+#      echo ""
+# }
+
+# Function stop and remove all containers (docker) and services/deployments etc(kube)
 # args: -
-# (Function for test scripts)
-start_prod_stub() {
-
-       echo -e $BOLD"Starting Producer stub"$EBOLD
-       __check_included_image 'PRODSTUB'
-       if [ $? -eq 1 ]; then
-               echo -e $RED"The Producer stub image has not been checked for this test run due to arg to the test script"$ERED
-               echo -e $RED"The Producer stub will not be started"$ERED
-               exit
+# Function for test script
+clean_environment() {
+       if [ $RUNMODE == "KUBE" ]; then
+               __clean_kube
+       else
+               __clean_containers
        fi
-       __start_container prodstub NODOCKERARGS $PROD_STUB_APP_NAME $PROD_STUB_EXTERNAL_PORT "/" "http"
 
 }
 
-use_prod_stub_http() {
-       echo -e $BOLD"Producer stub protocol setting"$EBOLD
-       echo -e " Using $BOLD http $EBOLD towards Producer stub"
-       export PROD_STUB_HTTPX="http"
-       export PROD_STUB_PORT=$PROD_STUB_INTERNAL_PORT
-       export PROD_STUB_LOCAL_PORT=$PROD_STUB_EXTERNAL_PORT
-       export PROD_STUB_LOCALHOST=$PROD_STUB_HTTPX"://localhost:"$PROD_STUB_LOCAL_PORT
-       echo ""
-}
-
-use_prod_stub_https() {
-       echo -e $BOLD"Producer stub protocol setting"$EBOLD
-       echo -e " Using $BOLD https $EBOLD towards Producer stub"
-       export PROD_STUB_HTTPX="https"
-       export PROD_STUB_PORT=$PROD_STUB_INTERNAL_SECURE_PORT
-       export PROD_STUB_LOCAL_PORT=$PROD_STUB_EXTERNAL_SECURE_PORT
-       export PROD_STUB_LOCALHOST=$PROD_STUB_HTTPX"://localhost:"$PROD_STUB_LOCAL_PORT
-       echo ""
-}
-
-###########################
-### Policy Agents functions
-###########################
-
-# Use an agent on the local machine instead of container
-use_agent_stand_alone() {
-       AGENT_STAND_ALONE=1
-}
-
-# Start the policy agent
+# Function stop and remove all containers (docker) and services/deployments etc(kube) in the end of the test script, if the arg 'auto-clean' is given at test script start
 # args: -
 # (Function for test scripts)
-start_policy_agent() {
-
-       echo -e $BOLD"Starting Policy Agent"$EBOLD
-
-       if [ $AGENT_STAND_ALONE -eq 0 ]; then
-               __check_included_image 'PA'
-               if [ $? -eq 1 ]; then
-                       echo -e $RED"The Policy Agent image has not been checked for this test run due to arg to the test script"$ERED
-                       echo -e $RED"The Policy Agent will not be started"$ERED
-                       exit
-               fi
-               __start_container policy_agent NODOCKERARGS $POLICY_AGENT_APP_NAME $POLICY_AGENT_EXTERNAL_PORT "/status" "http"
-       else
-               echo -e $RED"The consul config produced by this test script (filename '<fullpath-to-autotest-dir>.output<file-name>"$ERED
-               echo -e $RED"where the file name is the file in the consul_config_app command in this script) must be pointed out by the agent "$ERED
-               echo -e $RED"application.yaml"$ERED
-               echo -e $RED"The application jar may need to be built before continuing"$ERED
-               echo -e $RED"The agent shall now be running on port $POLICY_AGENT_EXTERNAL_PORT for http"$ERED
-
-               read -p "<press any key to continue>"
-               __start_container policy_agent "STANDALONE" $POLICY_AGENT_APP_NAME $POLICY_AGENT_EXTERNAL_PORT "/status" "http"
+auto_clean_environment() {
+       echo
+       if [ "$AUTO_CLEAN" == "auto" ]; then
+               echo -e $BOLD"Initiating automatic cleaning of environment"$EBOLD
+               clean_environment
        fi
-
 }
 
-# All calls to the agent will be directed to the agent REST interface from now on
-# args: -
+# Function to sleep a test case for a numner of seconds. Prints the optional text args as info
+# args: <sleep-time-in-sec> [any-text-in-quotes-to-be-printed]
 # (Function for test scripts)
-use_agent_rest_http() {
-       echo -e $BOLD"Agent protocol setting"$EBOLD
-       echo -e " Using $BOLD http $EBOLD and $BOLD REST $EBOLD towards the agent"
-       export ADAPTER=$RESTBASE
+sleep_wait() {
+
+       echo -e $BOLD"INFO(${BASH_LINENO[0]}): "${FUNCNAME[0]}"," $@ $EBOLD
+       if [ $# -lt 1 ]; then
+               ((RES_CONF_FAIL++))
+               __print_err "need at least one arg, <sleep-time-in-sec> [any-text-to-printed]" $@
+               exit 1
+       fi
+       #echo "---- Sleep for " $1 " seconds ---- "$2
+       start=$SECONDS
+       duration=$((SECONDS-start))
+       while [ $duration -lt $1 ]; do
+               echo -ne "  Slept for ${duration} seconds${SAMELINE}"
+               sleep 1
+               duration=$((SECONDS-start))
+       done
+       echo -ne "  Slept for ${duration} seconds${SAMELINE}"
        echo ""
 }
 
-# All calls to the agent will be directed to the agent REST interface from now on
-# args: -
-# (Function for test scripts)
-use_agent_rest_https() {
-       echo -e $BOLD"Agent protocol setting"$EBOLD
-       echo -e " Using $BOLD https $EBOLD and $BOLD REST $EBOLD towards the agent"
-       export ADAPTER=$RESTBASE_SECURE
-       echo ""
-       return 0
+# Print error info for the call in the parent script (test case). Arg: <error-message-to-print>
+# Not to be called from the test script itself.
+__print_err() {
+    echo -e $RED ${FUNCNAME[1]} " "$1" " ${BASH_SOURCE[2]} " line" ${BASH_LINENO[1]} $ERED
+       if [ $# -gt 1 ]; then
+               echo -e $RED" Got: "${FUNCNAME[1]} ${@:2} $ERED
+       fi
+       ((RES_CONF_FAIL++))
 }
 
-# All calls to the agent will be directed to the agent dmaap interface over http from now on
-# args: -
-# (Function for test scripts)
-use_agent_dmaap_http() {
-       echo -e $BOLD"Agent dmaap protocol setting"$EBOLD
-       echo -e " Using $BOLD http $EBOLD and $BOLD DMAAP $EBOLD towards the agent"
-       export ADAPTER=$DMAAPBASE
-       echo ""
-       return 0
-}
 
-# All calls to the agent will be directed to the agent dmaap interface over https from now on
-# args: -
-# (Function for test scripts)
-use_agent_dmaap_https() {
-       echo -e $BOLD"Agent dmaap protocol setting"$EBOLD
-       echo -e " Using $BOLD https $EBOLD and $BOLD DMAAP $EBOLD towards the agent"
-       export ADAPTER=$DMAAPBASE_SECURE
-       echo ""
-       return 0
+# Helper function to get a the port of a specific ric simulator
+# args: <ric-id>
+# (Not for test scripts)
+__find_sim_port() {
+    name=$1" " #Space appended to prevent matching 10 if 1 is desired....
+    cmdstr="docker inspect --format='{{(index (index .NetworkSettings.Ports \"$RIC_SIM_PORT/tcp\") 0).HostPort}}' ${name}"
+    res=$(eval $cmdstr)
+       if [[ "$res" =~ ^[0-9]+$ ]]; then
+               echo $res
+       else
+               echo "0"
+    fi
 }
 
-# Turn on debug level tracing in the agent
-# args: -
-# (Function for test scripts)
-set_agent_debug() {
-       echo -e $BOLD"Setting agent debug logging"$EBOLD
-       actuator="/actuator/loggers/org.oransc.policyagent"
-       if [[ $POLICY_AGENT_IMAGE = *"onap"* ]]; then
-               actuator="/actuator/loggers/org.onap.ccsdk.oran.a1policymanagementservice"
-       fi
-       curlString="$LOCALHOST$POLICY_AGENT_EXTERNAL_PORT$actuator -X POST  -H Content-Type:application/json -d {\"configuredLevel\":\"debug\"}"
-       result=$(__do_curl "$curlString")
-       if [ $? -ne 0 ]; then
-               __print_err "could not set debug mode" $@
-               ((RES_CONF_FAIL++))
-               return 1
+# Helper function to get a the port and host name of a specific ric simulator
+# args: <ric-id>
+# (Not for test scripts)
+__find_sim_host() {
+       if [ $RUNMODE == "KUBE" ]; then
+               ricname=$(echo "$1" | tr '_' '-')
+               for timeout in {1..60}; do
+                       host=$(kubectl get pod $ricname  -n $KUBE_NONRTRIC_NAMESPACE -o jsonpath='{.status.podIP}' 2> /dev/null)
+                       if [ ! -z "$host" ]; then
+                               echo $RIC_SIM_HTTPX"://"$host":"$RIC_SIM_PORT
+                               return 0
+                       fi
+                       sleep 0.5
+               done
+               echo "host-not-found-fatal-error"
+       else
+               name=$1" " #Space appended to prevent matching 10 if 1 is desired....
+               cmdstr="docker inspect --format='{{(index (index .NetworkSettings.Ports \"$RIC_SIM_PORT/tcp\") 0).HostPort}}' ${name}"
+               res=$(eval $cmdstr)
+               if [[ "$res" =~ ^[0-9]+$ ]]; then
+                       echo $RIC_SIM_HOST:$res
+                       return 0
+               else
+                       echo "0"
+               fi
        fi
-       echo ""
-       return 0
+       return 1
 }
 
-# Turn on trace level tracing in the agent
-# args: -
-# (Function for test scripts)
-set_agent_trace() {
-       echo -e $BOLD"Setting agent trace logging"$EBOLD
-       actuator="/actuator/loggers/org.oransc.policyagent"
-       if [[ $POLICY_AGENT_IMAGE = *"onap"* ]]; then
-               actuator="/actuator/loggers/org.onap.ccsdk.oran.a1policymanagementservice"
-       fi
-       curlString="$LOCALHOST$POLICY_AGENT_EXTERNAL_PORT$actuator -X POST  -H Content-Type:application/json -d {\"configuredLevel\":\"trace\"}"
-       result=$(__do_curl "$curlString")
+# Function to create the docker network for the test
+# Not to be called from the test script itself.
+__create_docker_network() {
+       tmp=$(docker network ls --format={{.Name}} --filter name=$DOCKER_SIM_NWNAME)
        if [ $? -ne 0 ]; then
-               __print_err "could not set trace mode" $@
-               ((RES_CONF_FAIL++))
+               echo -e $RED" Could not check if docker network $DOCKER_SIM_NWNAME exists"$ERED
                return 1
        fi
-       echo ""
-       return 0
-}
-
-# Perform curl retries when making direct call to the agent for the specified http response codes
-# Speace separated list of http response codes
-# args: [<response-code>]*
-use_agent_retries() {
-       echo -e $BOLD"Do curl retries to the agent REST inteface for these response codes:$@"$EBOLD
-       AGENT_RETRY_CODES=$@
-       echo ""
-       return
+       if [ "$tmp" != $DOCKER_SIM_NWNAME ]; then
+               echo -e " Creating docker network:$BOLD $DOCKER_SIM_NWNAME $EBOLD"
+               docker network create $DOCKER_SIM_NWNAME | indent2
+               if [ $? -ne 0 ]; then
+                       echo -e $RED" Could not create docker network $DOCKER_SIM_NWNAME"$ERED
+                       return 1
+               else
+                       echo -e "$GREEN  Done$EGREEN"
+               fi
+       else
+               echo -e " Docker network $DOCKER_SIM_NWNAME already exists$GREEN OK $EGREEN"
+       fi
 }
 
-###########################
-### ECS functions
-###########################
-
-# Start the ECS
-# args: -
-# (Function for test scripts)
-start_ecs() {
+# Function to start container with docker-compose and wait until all are in state running.
+#args: <docker-compose-dir> <docker-compose-arg>|NODOCKERARGS <count> <app-name>+
+# (Not for test scripts)
+__start_container() {
+       if [ $# -lt 4 ]; then
+               ((RES_CONF_FAIL++))
+       __print_err "need 4 or more args, <docker-compose-dir> <docker-compose-arg>|NODOCKERARGS <count> <app-name>+" $@
+               exit 1
+       fi
 
-       echo -e $BOLD"Starting ECS"$EBOLD
+       __create_docker_network
 
        curdir=$PWD
        cd $SIM_GROUP
-       cd ecs
-       cd $ECS_HOST_MNT_DIR
-       if [ -d database ]; then
-               if [ "$(ls -A $DIR)" ]; then
-                       echo -e $BOLD" Cleaning files in mounted dir: $PWD/database"$EBOLD
-                       rm -rf database/*  &> /dev/null
-                       if [ $? -ne 0 ]; then
-                               echo -e $RED" Cannot remove database files in: $PWD"$ERED
-                               exit 1
-                       fi
+       compose_dir=$1
+       cd $1
+       shift
+       compose_args=$1
+       shift
+       appcount=$1
+       shift
+
+       if [ "$compose_args" == "NODOCKERARGS" ]; then
+               docker-compose up -d &> .dockererr
+               if [ $? -ne 0 ]; then
+                       echo -e $RED"Problem to launch container(s) with docker-compose"$ERED
+                       cat .dockererr
+                       echo -e $RED"Stopping script...."$ERED
+                       exit 1
                fi
        else
-               echo " No files in mounted dir or dir does not exists"
-       fi
-       cd $curdir
-
-       __check_included_image 'ECS'
-       if [ $? -eq 1 ]; then
-               echo -e $RED"The ECS image has not been checked for this test run due to arg to the test script"$ERED
-               echo -e $RED"ECS will not be started"$ERED
-               exit
+               docker-compose up -d $compose_args &> .dockererr
+               if [ $? -ne 0 ]; then
+                       echo -e $RED"Problem to launch container(s) with docker-compose"$ERED
+                       cat .dockererr
+                       echo -e $RED"Stopping script...."$ERED
+                       exit 1
+               fi
        fi
-       export ECS_CERT_MOUNT_DIR="./cert"
-       __start_container ecs NODOCKERARGS $ECS_APP_NAME $ECS_EXTERNAL_PORT "/status" "http"
-}
 
-# Restart ECS
-# args: -
-# (Function for test scripts)
-restart_ecs() {
-       echo -e $BOLD"Re-starting ECS"$EBOLD
-       docker restart $ECS_APP_NAME &> ./tmp/.dockererr
-       if [ $? -ne 0 ]; then
-               __print_err "Could restart $ECS_APP_NAME" $@
-               cat ./tmp/.dockererr
-               ((RES_CONF_FAIL++))
-               return 1
-       fi
+       cd $curdir
 
-       __check_container_start $ECS_APP_NAME $ECS_EXTERNAL_PORT "/status" "http"
-       echo ""
+       appindex=0
+       while [ $appindex -lt $appcount ]; do
+               appname=$1
+               shift
+               app_started=0
+               for i in {1..10}; do
+                       if [ "$(docker inspect --format '{{ .State.Running }}' $appname)" == "true" ]; then
+                                       echo -e " Container $BOLD${appname}$EBOLD$GREEN running$EGREEN on$BOLD image $(docker inspect --format '{{ .Config.Image }}' ${appname}) $EBOLD"
+                                       app_started=1
+                                       break
+                               else
+                                       sleep $i
+                       fi
+               done
+               if [ $app_started -eq 0 ]; then
+                       ((RES_CONF_FAIL++))
+                       echo ""
+                       echo -e $RED" Container $BOLD${appname}$EBOLD could not be started"$ERED
+                       echo -e $RED" Stopping script..."$ERED
+                       exit 1
+               fi
+               let appindex=appindex+1
+       done
        return 0
 }
 
-# All calls to ECS will be directed to the ECS REST interface from now on
-# args: -
-# (Function for test scripts)
-use_ecs_rest_http() {
-       echo -e $BOLD"ECS protocol setting"$EBOLD
-       echo -e " Using $BOLD http $EBOLD and $BOLD REST $EBOLD towards ECS"
-       export ECS_ADAPTER=$ECS_RESTBASE
-       echo ""
-}
-
-# All calls to ECS will be directed to the ECS REST interface from now on
-# args: -
-# (Function for test scripts)
-use_ecs_rest_https() {
-       echo -e $BOLD"ECS protocol setting"$EBOLD
-       echo -e " Using $BOLD https $EBOLD and $BOLD REST $EBOLD towards ECS"
-       export ECS_ADAPTER=$ECS_RESTBASE_SECURE
-       echo ""
-       return 0
+# Generate a UUID to use as prefix for policy ids
+generate_uuid() {
+       UUID=$(python3 -c 'import sys,uuid; sys.stdout.write(uuid.uuid4().hex)')
+       #Reduce length to make space for serial id, uses 'a' as marker where the serial id is added
+       UUID=${UUID:0:${#UUID}-4}"a"
 }
 
-# All calls to ECS will be directed to the ECS dmaap interface over http from now on
-# args: -
-# (Function for test scripts)
-use_ecs_dmaap_http() {
-       echo -e $BOLD"ECS dmaap protocol setting"$EBOLD
-       echo -e $RED" - NOT SUPPORTED - "$ERED
-       echo -e " Using $BOLD http $EBOLD and $BOLD DMAAP $EBOLD towards ECS"
-       export ECS_ADAPTER=$ECS_DMAAPBASE
-       echo ""
-       return 0
-}
 
-# All calls to ECS will be directed to the ECS dmaap interface over https from now on
-# args: -
-# (Function for test scripts)
-use_ecs_dmaap_https() {
-       echo -e $BOLD"RICSIM protocol setting"$EBOLD
-       echo -e $RED" - NOT SUPPORTED - "$ERED
-       echo -e " Using $BOLD https $EBOLD and $BOLD REST $EBOLD towards ECS"
-       export ECS_ADAPTER=$ECS_DMAAPBASE_SECURE
-       echo ""
-       return 0
-}
+# Function to check if container/service is responding to http/https
+# args: <container-name>|<service-name> url
+# (Not for test scripts)
+__check_service_start() {
 
-# Turn on debug level tracing in ECS
-# args: -
-# (Function for test scripts)
-set_ecs_debug() {
-       echo -e $BOLD"Setting ecs debug logging"$EBOLD
-       curlString="$LOCALHOST$ECS_EXTERNAL_PORT/actuator/loggers/org.oransc.enrichment -X POST  -H Content-Type:application/json -d {\"configuredLevel\":\"debug\"}"
-       result=$(__do_curl "$curlString")
-       if [ $? -ne 0 ]; then
-               __print_err "Could not set debug mode" $@
+       if [ $# -ne 2 ]; then
                ((RES_CONF_FAIL++))
+               __print_err "need 2 args, <container-name>|<service-name> url" $@
                return 1
        fi
-       echo ""
-       return 0
-}
 
-# Turn on trace level tracing in ECS
-# args: -
-# (Function for test scripts)
-set_ecs_trace() {
-       echo -e $BOLD"Setting ecs trace logging"$EBOLD
-       curlString="$LOCALHOST$ECS_EXTERNAL_PORT/actuator/loggers/org.oransc.enrichment -X POST  -H Content-Type:application/json -d {\"configuredLevel\":\"trace\"}"
-       result=$(__do_curl "$curlString")
-       if [ $? -ne 0 ]; then
-               __print_err "Could not set trace mode" $@
+       if [ $RUNMODE == "KUBE" ]; then
+               ENTITY="service/set/deployment"
+       else
+               ENTITY="container"
+       fi
+       appname=$1
+       url=$2
+       echo -ne " Container $BOLD${appname}$EBOLD starting${SAMELINE}"
+
+
+       pa_st=false
+       echo -ne " Waiting for ${ENTITY} ${appname} service status...${SAMELINE}"
+       TSTART=$SECONDS
+       for i in {1..50}; do
+               result="$(__do_curl $url)"
+               if [ $? -eq 0 ]; then
+                       if [ ${#result} -gt 15 ]; then
+                               #If response is too long, truncate
+                               result="...response text too long, omitted"
+                       fi
+                       echo -ne " Waiting for {ENTITY} $BOLD${appname}$EBOLD service status on ${3}, result: $result${SAMELINE}"
+                       echo -ne " The ${ENTITY} $BOLD${appname}$EBOLD$GREEN is alive$EGREEN, responds to service status:$GREEN $result $EGREEN on ${url} after $(($SECONDS-$TSTART)) seconds"
+                       pa_st=true
+                       break
+               else
+                       TS_TMP=$SECONDS
+                       while [ $(($TS_TMP+$i)) -gt $SECONDS ]; do
+                               echo -ne " Waiting for ${ENTITY} ${appname} service status on ${url}...$(($SECONDS-$TSTART)) seconds, retrying in $(($TS_TMP+$i-$SECONDS)) seconds   ${SAMELINE}"
+                               sleep 1
+                       done
+               fi
+       done
+
+       if [ "$pa_st" = "false"  ]; then
                ((RES_CONF_FAIL++))
+               echo -e $RED" The ${ENTITY} ${appname} did not respond to service status on ${url} in $(($SECONDS-$TSTART)) seconds"$ERED
                return 1
        fi
+
        echo ""
        return 0
 }
 
-# Perform curl retries when making direct call to ECS for the specified http response codes
-# Speace separated list of http response codes
-# args: [<response-code>]*
-use_agent_retries() {
-       echo -e $BOLD"Do curl retries to the ECS REST inteface for these response codes:$@"$EBOLD
-       ECS_AGENT_RETRY_CODES=$@
-       echo ""
-       return
-}
 
 #################
 ### Log functions
@@ -2444,6 +2398,7 @@ check_sdnc_logs() {
 }
 
 __check_container_logs() {
+
        dispname=$1
        appname=$2
        logpath=$3
@@ -2452,6 +2407,11 @@ __check_container_logs() {
 
        echo -e $BOLD"Checking $dispname container $appname log ($logpath) for WARNINGs and ERRORs"$EBOLD
 
+       if [ $RUNMODE == "KUBE" ]; then
+               echo -e $YELLOW" Internal log for $dispname not checked in kube"$EYELLOW
+               return
+       fi
+
        #tmp=$(docker ps | grep $appname)
        tmp=$(docker ps -q --filter name=$appname) #get the container id
        if [ -z "$tmp" ]; then  #Only check logs for running Policy Agent apps
@@ -2495,63 +2455,83 @@ store_logs() {
 
        docker stats --no-stream > $TESTLOGS/$ATC/$1_docker_stats.log 2>&1
 
-       __check_included_image 'CONSUL'
-       if [ $? -eq 0 ]; then
-               docker logs $CONSUL_APP_NAME > $TESTLOGS/$ATC/$1_consul.log 2>&1
-       fi
+       docker ps -a  > $TESTLOGS/$ATC/$1_docker_ps.log 2>&1
 
-       __check_included_image 'CBS'
-       if [ $? -eq 0 ]; then
-               docker logs $CBS_APP_NAME > $TESTLOGS/$ATC/$1_cbs.log 2>&1
-               body="$(__do_curl $LOCALHOST$CBS_EXTERNAL_PORT/service_component_all/$POLICY_AGENT_APP_NAME)"
-               echo "$body" > $TESTLOGS/$ATC/$1_consul_config.json 2>&1
-       fi
+       cp .httplog_${ATC}.txt $TESTLOGS/$ATC/$1_httplog_${ATC}.txt 2>&1
 
-       __check_included_image 'PA'
-       if [ $? -eq 0 ]; then
-               docker logs $POLICY_AGENT_APP_NAME > $TESTLOGS/$ATC/$1_policy-agent.log 2>&1
-       fi
+       if [ $RUNMODE == "DOCKER" ]; then
+               __check_included_image 'CONSUL'
+               if [ $? -eq 0 ]; then
+                       docker logs $CONSUL_APP_NAME > $TESTLOGS/$ATC/$1_consul.log 2>&1
+               fi
 
-       __check_included_image 'ECS'
-       if [ $? -eq 0 ]; then
-               docker logs $ECS_APP_NAME > $TESTLOGS/$ATC/$1_ecs.log 2>&1
-       fi
+               __check_included_image 'CBS'
+               if [ $? -eq 0 ]; then
+                       docker logs $CBS_APP_NAME > $TESTLOGS/$ATC/$1_cbs.log 2>&1
+                       body="$(__do_curl $LOCALHOST_HTTP:$CBS_EXTERNAL_PORT/service_component_all/$POLICY_AGENT_APP_NAME)"
+                       echo "$body" > $TESTLOGS/$ATC/$1_consul_config.json 2>&1
+               fi
 
-       __check_included_image 'CP'
-       if [ $? -eq 0 ]; then
-               docker logs $CONTROL_PANEL_APP_NAME > $TESTLOGS/$ATC/$1_control-panel.log 2>&1
-       fi
+               __check_included_image 'PA'
+               if [ $? -eq 0 ]; then
+                       docker logs $POLICY_AGENT_APP_NAME > $TESTLOGS/$ATC/$1_policy-agent.log 2>&1
+               fi
 
-       __check_included_image 'MR'
-       if [ $? -eq 0 ]; then
-               docker logs $MR_APP_NAME > $TESTLOGS/$ATC/$1_mr.log 2>&1
-       fi
+               __check_included_image 'ECS'
+               if [ $? -eq 0 ]; then
+                       docker logs $ECS_APP_NAME > $TESTLOGS/$ATC/$1_ecs.log 2>&1
+               fi
 
-       __check_included_image 'CR'
-       if [ $? -eq 0 ]; then
-               docker logs $CR_APP_NAME > $TESTLOGS/$ATC/$1_cr.log 2>&1
-       fi
+               __check_included_image 'CP'
+               if [ $? -eq 0 ]; then
+                       docker logs $CONTROL_PANEL_APP_NAME > $TESTLOGS/$ATC/$1_control-panel.log 2>&1
+               fi
 
-       cp .httplog_${ATC}.txt $TESTLOGS/$ATC/$1_httplog_${ATC}.txt 2>&1
+               __check_included_image 'MR'
+               if [ $? -eq 0 ]; then
+                       docker logs $MR_STUB_APP_NAME > $TESTLOGS/$ATC/$1_mr_stub.log 2>&1
+               fi
 
-       __check_included_image 'SDNC'
-       if [ $? -eq 0 ]; then
-               docker exec -t $SDNC_APP_NAME cat $SDNC_KARAF_LOG> $TESTLOGS/$ATC/$1_SDNC_karaf.log 2>&1
-       fi
+               __check_included_image 'DMAAPSMR'
+               if [ $? -eq 0 ]; then
+                       docker logs $MR_DMAAP_APP_NAME > $TESTLOGS/$ATC/$1_mr.log 2>&1
+                       docker logs $MR_KAFKA_APP_NAME > $TESTLOGS/$ATC/$1_mr_kafka.log 2>&1
+                       docker logs $MR_ZOOKEEPER_APP_NAME > $TESTLOGS/$ATC/$1_mr_zookeeper.log 2>&1
 
-       __check_included_image 'RICSIM'
-       if [ $? -eq 0 ]; then
-               rics=$(docker ps -f "name=$RIC_SIM_PREFIX" --format "{{.Names}}")
-               for ric in $rics; do
-                       docker logs $ric > $TESTLOGS/$ATC/$1_$ric.log 2>&1
-               done
-       fi
+               fi
 
-       __check_included_image 'PRODSTUB'
-       if [ $? -eq 0 ]; then
-               docker logs $PROD_STUB_APP_NAME > $TESTLOGS/$ATC/$1_prodstub.log 2>&1
-       fi
+               __check_included_image 'CR'
+               if [ $? -eq 0 ]; then
+                       docker logs $CR_APP_NAME > $TESTLOGS/$ATC/$1_cr.log 2>&1
+               fi
+
+               __check_included_image 'SDNC'
+               if [ $? -eq 0 ]; then
+                       docker exec -t $SDNC_APP_NAME cat $SDNC_KARAF_LOG> $TESTLOGS/$ATC/$1_SDNC_karaf.log 2>&1
+               fi
+
+               __check_included_image 'RICSIM'
+               if [ $? -eq 0 ]; then
+                       rics=$(docker ps -f "name=$RIC_SIM_PREFIX" --format "{{.Names}}")
+                       for ric in $rics; do
+                               docker logs $ric > $TESTLOGS/$ATC/$1_$ric.log 2>&1
+                       done
+               fi
 
+               __check_included_image 'PRODSTUB'
+               if [ $? -eq 0 ]; then
+                       docker logs $PROD_STUB_APP_NAME > $TESTLOGS/$ATC/$1_prodstub.log 2>&1
+               fi
+       fi
+       if [ $RUNMODE == "KUBE" ]; then
+               namespaces=$(kubectl  get namespaces -o jsonpath='{.items[?(@.metadata.name)].metadata.name}')
+               for nsid in $namespaces; do
+                       pods=$(kubectl get pods -n $nsid -o jsonpath='{.items[?(@.metadata.labels.autotest)].metadata.name}')
+                       for podid in $pods; do
+                               kubectl logs -n $nsid $podid > $TESTLOGS/$ATC/$1_${podid}.log
+                       done
+               done
+       fi
        echo ""
 }
 
@@ -2714,55 +2694,3 @@ __var_test() {
                exit 1
        fi
 }
-
-
-### Generic test cases for varaible checking
-
-# Tests if a variable value in the MR stub is equal to a target value and and optional timeout.
-# Arg: <variable-name> <target-value> - This test set pass or fail depending on if the variable is
-# equal to the target or not.
-# Arg: <variable-name> <target-value> <timeout-in-sec>  - This test waits up to the timeout seconds
-# before setting pass or fail depending on if the variable value becomes equal to the target
-# value or not.
-# (Function for test scripts)
-mr_equal() {
-       if [ $# -eq 2 ] || [ $# -eq 3 ]; then
-               __var_test "MR" "$LOCALHOST$MR_EXTERNAL_PORT/counter/" $1 "=" $2 $3
-       else
-               ((RES_CONF_FAIL++))
-               __print_err "Wrong args to mr_equal, needs two or three args: <sim-param> <target-value> [ timeout ]" $@
-       fi
-}
-
-# Tests if a variable value in the MR stub is greater than a target value and and optional timeout.
-# Arg: <variable-name> <target-value> - This test set pass or fail depending on if the variable is
-# greater than the target or not.
-# Arg: <variable-name> <target-value> <timeout-in-sec>  - This test waits up to the timeout seconds
-# before setting pass or fail depending on if the variable value becomes greater than the target
-# value or not.
-# (Function for test scripts)
-mr_greater() {
-       if [ $# -eq 2 ] || [ $# -eq 3 ]; then
-               __var_test "MR" "$LOCALHOST$MR_EXTERNAL_PORT/counter/" $1 ">" $2 $3
-       else
-               ((RES_CONF_FAIL++))
-               __print_err "Wrong args to mr_greater, needs two or three args: <sim-param> <target-value> [ timeout ]" $@
-       fi
-}
-
-# Read a variable value from MR sim and send to stdout. Arg: <variable-name>
-mr_read() {
-       echo "$(__do_curl $LOCALHOST$MR_EXTERNAL_PORT/counter/$1)"
-}
-
-# Print a variable value from the MR stub.
-# arg: <variable-name>
-# (Function for test scripts)
-mr_print() {
-       if [ $# != 1 ]; then
-               ((RES_CONF_FAIL++))
-       __print_err "need one arg, <mr-param>" $@
-               exit 1
-       fi
-       echo -e $BOLD"INFO(${BASH_LINENO[0]}): mrstub, $1 = $(__do_curl $LOCALHOST$MR_EXTERNAL_PORT/counter/$1)"$EBOLD
-}
index 75b23f1..db13fc0 100644 (file)
@@ -24,8 +24,10 @@ import json
 from flask import Flask
 from flask import Response
 import traceback
-from threading import RLock
+from threading import RLock, Thread
 import logging
+import os
+import requests
 
 # Disable all logging of GET on reading counters
 class AjaxFilter(logging.Filter):
@@ -61,6 +63,89 @@ MIME_JSON="application/json"
 CAUGHT_EXCEPTION="Caught exception: "
 SERVER_ERROR="Server error :"
 
+topic_write=""
+topic_read=""
+
+uploader_thread=None
+downloader_thread=None
+
+# Function to download messages from dmaap
+def dmaap_uploader():
+    global msg_requests
+    global cntr_msg_requests_fetched
+
+    print("Starting uploader")
+
+    headers = {'Content-type': 'application/json', 'Accept': '*/*'}
+    #url="http://"+topic_host+"/events/"+topic_read
+    url=topic_read
+
+    while True:
+        while (len(msg_requests)>0):
+            msg=msg_requests[0]
+            if msg is not None:
+                try:
+                    print("Sending to dmaap : "+ url)
+                    print("Sending to dmaap : "+ msg)
+                    resp=requests.post(url, data=msg, headers=headers, timeout=10)
+                    if (resp.status_code<199 & resp.status_code > 299):
+                        print("Failed, response code: " + str(resp.status_code))
+                        sleep(1)
+                    else:
+                        print("Dmaap response code: " + str(resp.status_code))
+                        print("Dmaap response text: " + str(resp.text))
+                        with lock:
+                            msg_requests.pop(0)
+                            cntr_msg_requests_fetched += 1
+                except Exception as e:
+                    print("Failed, exception: "+ str(e))
+                    sleep(1)
+        sleep(0.01)
+
+
+# Function to download messages from dmaap
+def dmaap_downloader():
+    global msg_responses
+    global cntr_msg_responses_submitted
+
+    print("Starting uploader")
+
+    while True:
+
+        try :
+            #url="http://"+topic_host+"/events/"+topic_write+"/users/mr-stub?timeout=15000&limit=100"
+            url=topic_write
+            headers = {'Accept': 'application/json'}
+            print("Reading from dmaap: " + url)
+            resp=requests.get(url, headers=headers)
+            if (resp.status_code<199 & resp.status_code > 299):
+                print("Failed, response code: " + resp.status_code)
+                sleep(1)
+            else:
+                print("Recieved data from dmaap mr")
+                try:
+                    data=resp.json()
+                    print("Recieved data (raw): " + str(resp.text))
+                    if isinstance(data, list):
+                        for item in data:
+                            item=json.loads(item)
+                            corrid=str(item["correlationId"])
+                            status=str(item["status"])
+                            msg=str(item["message"])
+                            item_str=msg+status[0:3]
+                            with lock:
+                                msg_responses[corrid]=item_str
+                                cntr_msg_responses_submitted += 1
+                    else:
+                        print("Data from dmaap is not json array: " + str(resp.text))
+                        sleep(1)
+                except Exception as e:
+                    print("Corrupt data from dmaap mr -  dropping " + str(data))
+                    print("CAUGHT_EXCEPTION" + str(e) + " "+traceback.format_exc())
+                    sleep(1)
+        except Exception as e:
+            sleep(1)
+
 #I'm alive function
 @app.route('/',
     methods=['GET'])
@@ -134,19 +219,19 @@ def receiveresponse():
     with lock:
         print("APP_READ_URL lock")
         try:
-            id=request.args.get('correlationid')
-            if (id is None):
+            cid=request.args.get('correlationid')
+            if (cid is None):
                 print(APP_READ_URL+" parameter 'correclationid' missing")
                 return Response('Parameter correlationid missing in json', status=500, mimetype=MIME_TEXT)
 
-            if (id in msg_responses):
-                answer=msg_responses[id]
-                del msg_responses[id]
-                print(APP_READ_URL+" response (correlationid="+id+"): " + answer)
+            if (cid in msg_responses):
+                answer=msg_responses[cid]
+                del msg_responses[cid]
+                print(APP_READ_URL+" response (correlationid="+cid+"): " + answer)
                 cntr_msg_responses_fetched += 1
                 return Response(answer, status=200, mimetype=MIME_JSON)
 
-            print(APP_READ_URL+" - no messages (correlationid="+id+"): ")
+            print(APP_READ_URL+" - no messages (correlationid="+cid+"): ")
             return Response('', status=204, mimetype=MIME_JSON)
         except Exception as e:
             print(APP_READ_URL+"-"+CAUGHT_EXCEPTION+" "+str(e) + " "+traceback.format_exc())
@@ -163,6 +248,9 @@ def events_read():
     global msg_requests
     global cntr_msg_requests_fetched
 
+    if topic_write or topic_read:
+        return Response('Url not available when running as mrstub frontend', status=404, mimetype=MIME_TEXT)
+
     limit=request.args.get('limit')
     if (limit is None):
         limit=4096
@@ -180,10 +268,10 @@ def events_read():
     else:
         timeout=min(int(timeout),60000)
 
-    startTime=int(round(time.time() * 1000))
-    currentTime=int(round(time.time() * 1000))
+    start_time=int(round(time.time() * 1000))
+    current_time=int(round(time.time() * 1000))
 
-    while(currentTime<startTime+int(timeout)):
+    while(current_time<start_time+int(timeout)):
         with lock:
             if(len(msg_requests)>0):
                 try:
@@ -202,9 +290,9 @@ def events_read():
                     print(AGENT_READ_URL+"-"+CAUGHT_EXCEPTION+" "+str(e) + " "+traceback.format_exc())
                     return Response(SERVER_ERROR+" "+str(e), status=500, mimetype=MIME_TEXT)
         sleep(0.025) # sleep 25 milliseconds
-        currentTime=int(round(time.time() * 1000))
+        current_time=int(round(time.time() * 1000))
 
-    print("timeout: "+str(timeout)+", startTime: "+str(startTime)+", currentTime: "+str(currentTime))
+    print("timeout: "+str(timeout)+", start_time: "+str(start_time)+", current_time: "+str(current_time))
     return Response("[]", status=200, mimetype=MIME_JSON)
 
 # Write messages stream. URI according to agent configuration.
@@ -215,6 +303,10 @@ def events_read():
 def events_write():
     global msg_responses
     global cntr_msg_responses_submitted
+
+    if topic_write or topic_read:
+        return Response('Url not available when running as mrstub frontend', status=404, mimetype=MIME_TEXT)
+
     with lock:
         print("AGENT_WRITE_URL lock")
         try:
@@ -227,8 +319,8 @@ def events_write():
                 answer=answer_list
 
             for item in answer:
-                id=item['correlationId']
-                if (id is None):
+                cid=item['correlationId']
+                if (cid is None):
                     print(AGENT_WRITE_URL+" parameter 'correlatonid' missing")
                     return Response('Parameter <correlationid> missing in json', status=400, mimetype=MIME_TEXT)
                 msg=item['message']
@@ -243,9 +335,9 @@ def events_write():
                     msg_str=json.dumps(msg)+status[0:3]
                 else:
                     msg_str=msg+status[0:3]
-                msg_responses[id]=msg_str
+                msg_responses[cid]=msg_str
                 cntr_msg_responses_submitted += 1
-                print(AGENT_WRITE_URL+ " msg+status (correlationid="+id+") :" + str(msg_str))
+                print(AGENT_WRITE_URL+ " msg+status (correlationid="+cid+") :" + str(msg_str))
         except Exception as e:
             print(AGENT_WRITE_URL+"-"+CAUGHT_EXCEPTION+" "+str(e) + " "+traceback.format_exc())
             return Response('{"message": "' + SERVER_ERROR + ' ' + str(e) + '","status":"500"}', status=200, mimetype=MIME_JSON)
@@ -306,5 +398,27 @@ def reset():
     msg_responses={}
     return Response('OK', status=200, mimetype=MIME_TEXT)
 
+# Get env vars, if present
+if os.getenv("TOPIC_READ") is not None:
+
+    print("Env variables:")
+    print("TOPIC_READ:"+os.environ['TOPIC_READ'])
+    print("TOPIC_WRITE:"+os.environ['TOPIC_WRITE'])
+
+    topic_read=os.environ['TOPIC_READ']
+    topic_write=os.environ['TOPIC_WRITE']
+
+
+    if topic_read and downloader_thread is None:
+        downloader_thread=Thread(target=dmaap_downloader)
+        downloader_thread.start()
+
+    if topic_write and uploader_thread is None:
+        uploader_thread=Thread(target=dmaap_uploader)
+        uploader_thread.start()
+
+else:
+    print("No env variables - OK")
+
 if __name__ == "__main__":
     app.run(port=HOST_PORT, host=HOST_IP)
\ No newline at end of file
index 60b1dd9..c548e56 100644 (file)
@@ -28,10 +28,10 @@ http {
     default_type application/octet-stream;
 
     server { # simple reverse-proxy
-        listen      3905;
-        listen      [::]:3905;
-        listen      3906 ssl;
-        listen      [::]:3906 ssl;
+        listen      3904;
+        listen      [::]:3904;
+        listen      3905 ssl;
+        listen      [::]:3905 ssl;
         server_name  localhost;
         ssl_certificate     /usr/src/app/cert/cert.crt;
         ssl_certificate_key /usr/src/app/cert/key.crt;
index 8fd414f..8c3d61f 100644 (file)
@@ -1,2 +1,3 @@
 pip==20.1
-Flask==1.1.2
\ No newline at end of file
+Flask==1.1.2
+requests==2.25.1
\ No newline at end of file
index 8b2347d..dbd4297 100755 (executable)
@@ -31,12 +31,12 @@ fi
 
 if [ $1 == "nonsecure" ]; then
     #Default http port for the simulator
-    PORT=3905
+    PORT=3904
     # Set http protocol
     HTTPX="http"
 else
     #Default https port for the mr-stub
-    PORT=3906
+    PORT=3905
     # Set https protocol
     HTTPX="https"
 fi
index 8ad1d16..c9f70a1 100755 (executable)
@@ -21,4 +21,4 @@
 
 docker build --build-arg NEXUS_PROXY_REPO=nexus3.onap.org:10001/  -t mrstub .
 
-docker run --rm -it -p 3905:3905 -p 3906:3906 -v "$PWD/cert:/usr/src/app/cert" mrstub
+docker run --rm -it -p 3904:3904 -p 3905:3905 -v "$PWD/cert:/usr/src/app/cert" mrstub
diff --git a/test/simulator-group/control_panel/app.yaml b/test/simulator-group/control_panel/app.yaml
new file mode 100644 (file)
index 0000000..a962f3d
--- /dev/null
@@ -0,0 +1,37 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: $CONTROL_PANEL_APP_NAME
+  namespace: $KUBE_NONRTRIC_NAMESPACE
+  labels:
+    run: $CONTROL_PANEL_APP_NAME
+    autotest: CP
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      run: $CONTROL_PANEL_APP_NAME
+  template:
+    metadata:
+      labels:
+        run: $CONTROL_PANEL_APP_NAME
+        autotest: CP
+    spec:
+      containers:
+      - name: $CONTROL_PANEL_APP_NAME
+        image: $CONTROL_PANEL_IMAGE
+        imagePullPolicy: Never
+        ports:
+        - name: http
+          containerPort: $CONTROL_PANEL_INTERNAL_PORT
+        - name: https
+          containerPort: $CONTROL_PANEL_INTERNAL_SECURE_PORT
+        volumeMounts:
+        - mountPath: $CONTROL_PANEL_CONFIG_MOUNT_PATH/$CONTROL_PANEL_CONFIG_FILE
+          subPath: $CONTROL_PANEL_CONFIG_FILE
+          name: cp-conf-name
+      volumes:
+      - configMap:
+          defaultMode: 420
+          name: $CP_CONFIG_CONFIGMAP_NAME
+        name: cp-conf-name
\ No newline at end of file
diff --git a/test/simulator-group/control_panel/application.properties b/test/simulator-group/control_panel/application.properties
new file mode 100644 (file)
index 0000000..2fc7093
--- /dev/null
@@ -0,0 +1,37 @@
+################################################################################
+#   Copyright (c) 2020 Nordix Foundation.                                      #
+#                                                                              #
+#   Licensed under the Apache License, Version 2.0 (the "License");            #
+#   you may not use this file except in compliance with the License.           #
+#   You may obtain a copy of the License at                                    #
+#                                                                              #
+#       http://www.apache.org/licenses/LICENSE-2.0                             #
+#                                                                              #
+#   Unless required by applicable law or agreed to in writing, software        #
+#   distributed under the License is distributed on an "AS IS" BASIS,          #
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
+#   See the License for the specific language governing permissions and        #
+#   limitations under the License.                                             #
+################################################################################
+server.port = 8082
+server.ssl.key-store-type = PKCS12
+server.ssl.key-store-password = ericsson_kwdjfhw
+server.ssl.key-store =  classpath:keystore.jks
+server.ssl.key-password = ericsson_kwdjfhw
+server.http.port = 8080
+# https api
+policycontroller.url.prefix = https://${POLICY_AGENT_DOMAIN_NAME}:${POLICY_AGENT_EXTERNAL_SECURE_PORT}
+
+userfile = users.json
+portalapi.decryptor = org.oransc.portal.nonrtric.controlpanel.portalapi.PortalSdkDecryptorAes
+portalapi.usercookie = UserId
+portalapi.security = false
+portalapi.appname = Non-RT RIC Control Panel
+portalapi.username = Default
+portalapi.password = password
+
+# URL for enrichment coordinator service
+enrichmentcontroller.url.prefix = https://${ECS_DOMAIN_NAME}:${ECS_EXTERNAL_SECURE_PORT}/ei-producer/v1
+
+# Mimic slow endpoints by defining sleep period, in milliseconds
+mock.config.delay = 0
index 4e86f3c..0d603a0 100644 (file)
@@ -18,7 +18,7 @@ version: '3.0'
 networks:
   default:
     external:
-      name: nonrtric-docker-net
+      name: ${DOCKER_SIM_NWNAME}
 services:
   control-panel:
     image: ${CONTROL_PANEL_IMAGE}
@@ -27,6 +27,6 @@ services:
       - default
     ports:
     - ${CONTROL_PANEL_EXTERNAL_PORT}:${CONTROL_PANEL_INTERNAL_PORT}
-
+    - ${CONTROL_PANEL_EXTERNAL_SECURE_PORT}:${CONTROL_PANEL_INTERNAL_SECURE_PORT}
 
 
diff --git a/test/simulator-group/control_panel/svc.yaml b/test/simulator-group/control_panel/svc.yaml
new file mode 100644 (file)
index 0000000..85a4682
--- /dev/null
@@ -0,0 +1,21 @@
+apiVersion: v1
+kind: Service
+metadata:
+  name: $CONTROL_PANEL_APP_NAME
+  namespace: $KUBE_NONRTRIC_NAMESPACE
+  labels:
+    run: $CONTROL_PANEL_APP_NAME
+    autotest: CP
+spec:
+  type: ClusterIP
+  ports:
+  - port: $CONTROL_PANEL_EXTERNAL_PORT
+    targetPort: $CONTROL_PANEL_INTERNAL_PORT
+    protocol: TCP
+    name: http
+  - port: $CONTROL_PANEL_EXTERNAL_SECURE_PORT
+    targetPort: $CONTROL_PANEL_INTERNAL_SECURE_PORT
+    protocol: TCP
+    name: https
+  selector:
+    run: $CONTROL_PANEL_APP_NAME
\ No newline at end of file
diff --git a/test/simulator-group/cr/app.yaml b/test/simulator-group/cr/app.yaml
new file mode 100644 (file)
index 0000000..3497b88
--- /dev/null
@@ -0,0 +1,28 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: $CR_APP_NAME
+  namespace: $KUBE_SIM_NAMESPACE
+  labels:
+    run: $CR_APP_NAME
+    autotest: CR
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      run: $CR_APP_NAME
+  template:
+    metadata:
+      labels:
+        run: $CR_APP_NAME
+        autotest: CR
+    spec:
+      containers:
+      - name: $CR_APP_NAME
+        image: $CR_IMAGE
+        imagePullPolicy: Never
+        ports:
+        - name: http
+          containerPort: $CR_INTERNAL_PORT
+        - name: https
+          containerPort: $CR_INTERNAL_SECURE_PORT
diff --git a/test/simulator-group/cr/svc.yaml b/test/simulator-group/cr/svc.yaml
new file mode 100644 (file)
index 0000000..43e532b
--- /dev/null
@@ -0,0 +1,21 @@
+apiVersion: v1
+kind: Service
+metadata:
+  name: $CR_APP_NAME
+  namespace: $KUBE_SIM_NAMESPACE
+  labels:
+    run: $CR_APP_NAME
+    autotest: CR
+spec:
+  type: ClusterIP
+  ports:
+  - port: $CR_EXTERNAL_PORT
+    targetPort: $CR_INTERNAL_PORT
+    protocol: TCP
+    name: http
+  - port: $CR_EXTERNAL_SECURE_PORT
+    targetPort: $CR_INTERNAL_SECURE_PORT
+    protocol: TCP
+    name: https
+  selector:
+    run: $CR_APP_NAME
\ No newline at end of file
diff --git a/test/simulator-group/dmaapmr/app.yaml b/test/simulator-group/dmaapmr/app.yaml
new file mode 100644 (file)
index 0000000..50e6943
--- /dev/null
@@ -0,0 +1,178 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: $MR_DMAAP_KUBE_APP_NAME
+  namespace: $KUBE_ONAP_NAMESPACE
+  labels:
+    run: $MR_DMAAP_KUBE_APP_NAME
+    autotest: DMAAPMR
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      run: $MR_DMAAP_KUBE_APP_NAME
+  template:
+    metadata:
+      labels:
+        run: $MR_DMAAP_KUBE_APP_NAME
+        autotest: DMAAPMR
+    spec:
+      containers:
+      - name: $MR_DMAAP_KUBE_APP_NAME
+        image: $ONAP_DMAAPMR_IMAGE
+        imagePullPolicy: Never
+        ports:
+        - name: http
+          containerPort: $MR_INTERNAL_PORT
+        - name: https
+          containerPort: $MR_INTERNAL_SECURE_PORT
+        env:
+        - name: enableCadi
+          value: 'false'
+        volumeMounts:
+        - mountPath: /appl/dmaapMR1/bundleconfig/etc/appprops/MsgRtrApi.properties
+          subPath: MsgRtrApi.properties
+          name: dmaapmr-msg-rtr-api
+        volumeMounts:
+        - mountPath: /appl/dmaapMR1/bundleconfig/etc/logback.xml
+          subPath: logback.xml
+          name: dmaapmr-log-back
+        volumeMounts:
+        - mountPath: /appl/dmaapMR1/etc/cadi.properties
+          subPath: cadi.properties
+          name: dmaapmr-cadi
+      volumes:
+      - configMap:
+          defaultMode: 420
+          name: dmaapmr-msgrtrapi.properties
+        name: dmaapmr-msg-rtr-api
+      - configMap:
+          defaultMode: 420
+          name: dmaapmr-logback.xml
+        name: dmaapmr-log-back
+      - configMap:
+          defaultMode: 420
+          name: dmaapmr-cadi.properties
+        name: dmaapmr-cadi
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: $MR_KAFKA_BWDS_NAME
+  namespace: $KUBE_ONAP_NAMESPACE
+  labels:
+    run: $MR_KAFKA_BWDS_NAME
+    autotest: DMAAPMR
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      run: $MR_KAFKA_BWDS_NAME
+  template:
+    metadata:
+      labels:
+        run: $MR_KAFKA_BWDS_NAME
+        autotest: DMAAPMR
+    spec:
+      containers:
+      - name: $MR_KAFKA_BWDS_NAME
+        image: $ONAP_KAFKA_IMAGE
+        imagePullPolicy: Never
+        ports:
+        - name: http
+          containerPort: 9092
+        env:
+        - name: enableCadi
+          value: 'false'
+        - name: KAFKA_ZOOKEEPER_CONNECT
+          value: 'zookeeper.onap:2181'
+        - name: KAFKA_ZOOKEEPER_CONNECTION_TIMEOUT_MS
+          value: '40000'
+        - name: KAFKA_ZOOKEEPER_SESSION_TIMEOUT_MS
+          value: '40000'
+        - name: KAFKA_LISTENER_SECURITY_PROTOCOL_MAP
+          value: 'INTERNAL_PLAINTEXT:PLAINTEXT,EXTERNAL_PLAINTEXT:PLAINTEXT'
+#        - name: KAFKA_ADVERTISED_LISTENERS
+#          value: 'INTERNAL_PLAINTEXT://akfak-bwds.onap:9092'
+        - name: KAFKA_ADVERTISED_LISTENERS
+          value: 'INTERNAL_PLAINTEXT://localhost:9092'
+        - name: KAFKA_LISTENERS
+          value: 'INTERNAL_PLAINTEXT://0.0.0.0:9092'
+        - name: KAFKA_INTER_BROKER_LISTENER_NAME
+          value: INTERNAL_PLAINTEXT
+        - name: KAFKA_CONFLUENT_SUPPORT_METRICS_ENABLE
+          value: 'false'
+        - name: KAFKA_OPTS
+          value: '-Djava.security.auth.login.config=/etc/kafka/secrets/jaas/zk_client_jaas.conf'
+        - name: KAFKA_ZOOKEEPER_SET_ACL
+          value: 'true'
+        - name: KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR
+          value: '1'
+        - name: KAFKA_OFFSETS_TOPIC_NUM_PARTITIONS
+          value: '1'
+        volumeMounts:
+        - mountPath: /etc/kafka/secrets/jaas/zk_client_jaas.conf
+          subPath: zk_client_jaas.conf
+          name: dmaapmr-zk-client-jaas
+      volumes:
+      - configMap:
+          defaultMode: 420
+          name: dmaapmr-zk-client-jaas.conf
+        name: dmaapmr-zk-client-jaas
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: $MR_ZOOKEEPER_APP_NAME
+  namespace: $KUBE_ONAP_NAMESPACE
+  labels:
+    run: $MR_ZOOKEEPER_APP_NAME
+    autotest: DMAAPMR
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      run: $MR_ZOOKEEPER_APP_NAME
+  template:
+    metadata:
+      labels:
+        run: $MR_ZOOKEEPER_APP_NAME
+        autotest: DMAAPMR
+    spec:
+      containers:
+      - name: $MR_ZOOKEEPER_APP_NAME
+        image: $ONAP_ZOOKEEPER_IMAGE
+        imagePullPolicy: Never
+        ports:
+        - name: http
+          containerPort: 2181
+        env:
+        - name: ZOOKEEPER_REPLICAS
+          value: '1'
+        - name: ZOOKEEPER_TICK_TIME
+          value: '2000'
+        - name: ZOOKEEPER_SYNC_LIMIT
+          value: '5'
+        - name: ZOOKEEPER_INIT_LIMIT
+          value: '10'
+        - name: ZOOKEEPER_MAX_CLIENT_CNXNS
+          value: '200'
+        - name: ZOOKEEPER_AUTOPURGE_SNAP_RETAIN_COUNT
+          value: '3'
+        - name: ZOOKEEPER_AUTOPURGE_PURGE_INTERVAL
+          value: '24'
+        - name: ZOOKEEPER_CLIENT_PORT
+          value: '2181'
+        - name: KAFKA_OPTS
+          value: '-Djava.security.auth.login.config=/etc/zookeeper/secrets/jaas/zk_server_jaas.conf -Dzookeeper.kerberos.removeHostFromPrincipal=true -Dzookeeper.kerberos.removeRealmFromPrincipal=true -Dzookeeper.authProvider.1=org.apache.zookeeper.server.auth.SASLAuthenticationProvider -Dzookeeper.requireClientAuthScheme=sasl'
+        - name: ZOOKEEPER_SERVER_ID
+          value: '1'
+        volumeMounts:
+        - mountPath: /etc/zookeeper/secrets/jaas/zk_server_jaas.conf
+          subPath: zk_server_jaas.conf
+          name: dmaapmr-zk-server-jaas
+      volumes:
+      - configMap:
+          defaultMode: 420
+          name: dmaapmr-zk-server-jaas.conf
+        name: dmaapmr-zk-server-jaas
\ No newline at end of file
diff --git a/test/simulator-group/dmaapmr/docker-compose.yaml b/test/simulator-group/dmaapmr/docker-compose.yaml
new file mode 100644 (file)
index 0000000..b418028
--- /dev/null
@@ -0,0 +1,89 @@
+#  ============LICENSE_START===============================================
+#  Copyright (C) 2020 Nordix Foundation. All rights reserved.
+#  ========================================================================
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+#  ============LICENSE_END=================================================
+#
+
+version: '3.5'
+networks:
+  default:
+    external:
+      name: ${DOCKER_SIM_NWNAME}
+
+services:
+  zookeeper:
+    image: $ONAP_ZOOKEEPER_IMAGE
+    container_name: $MR_ZOOKEEPER_APP_NAME
+    ports:
+      - "2181:2181"
+    environment:
+     ZOOKEEPER_REPLICAS: 1
+     ZOOKEEPER_TICK_TIME: 2000
+     ZOOKEEPER_SYNC_LIMIT: 5
+     ZOOKEEPER_INIT_LIMIT: 10
+     ZOOKEEPER_MAX_CLIENT_CNXNS: 200
+     ZOOKEEPER_AUTOPURGE_SNAP_RETAIN_COUNT: 3
+     ZOOKEEPER_AUTOPURGE_PURGE_INTERVAL: 24
+     ZOOKEEPER_CLIENT_PORT: 2181
+     KAFKA_OPTS: -Djava.security.auth.login.config=/etc/zookeeper/secrets/jaas/zk_server_jaas.conf -Dzookeeper.kerberos.removeHostFromPrincipal=true -Dzookeeper.kerberos.removeRealmFromPrincipal=true -Dzookeeper.authProvider.1=org.apache.zookeeper.server.auth.SASLAuthenticationProvider -Dzookeeper.requireClientAuthScheme=sasl
+     ZOOKEEPER_SERVER_ID: 1
+    volumes:
+      -  ./mnt/zk/zk_server_jaas.conf:/etc/zookeeper/secrets/jaas/zk_server_jaas.conf
+    networks:
+      - default
+
+  kafka:
+   image: $ONAP_KAFKA_IMAGE
+   container_name: $MR_KAFKA_APP_NAME
+   ports:
+    - "9092:9092"
+   environment:
+    enableCadi: 'false'
+    KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
+    KAFKA_ZOOKEEPER_CONNECTION_TIMEOUT_MS: 40000
+    KAFKA_ZOOKEEPER_SESSION_TIMEOUT_MS: 40000
+    KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL_PLAINTEXT:PLAINTEXT,EXTERNAL_PLAINTEXT:PLAINTEXT
+    KAFKA_ADVERTISED_LISTENERS: INTERNAL_PLAINTEXT://kafka:9092
+    KAFKA_LISTENERS: INTERNAL_PLAINTEXT://0.0.0.0:9092
+    KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL_PLAINTEXT
+    KAFKA_CONFLUENT_SUPPORT_METRICS_ENABLE: 'false'
+    KAFKA_OPTS: -Djava.security.auth.login.config=/etc/kafka/secrets/jaas/zk_client_jaas.conf
+    KAFKA_ZOOKEEPER_SET_ACL: 'true'
+    KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
+    # Reduced the number of partitions only to avoid the timeout error for the first subscribe call in slow environment
+    KAFKA_OFFSETS_TOPIC_NUM_PARTITIONS: 1
+   volumes:
+     -  ./mnt/kafka/zk_client_jaas.conf:/etc/kafka/secrets/jaas/zk_client_jaas.conf
+   networks:
+      - default
+   depends_on:
+    - zookeeper
+
+  dmaap:
+    image: $ONAP_DMAAPMR_IMAGE
+    container_name: $MR_DMAAP_APP_NAME
+    ports:
+      - ${MR_DMAAP_LOCALHOST_PORT}:${MR_INTERNAL_PORT}
+      - ${MR_DMAAP_LOCALHOST_SECURE_PORT}:${MR_INTERNAL_SECURE_PORT}
+    environment:
+     enableCadi: 'false'
+    volumes:
+      - ./mnt/mr/MsgRtrApi.properties:/appl/dmaapMR1/bundleconfig/etc/appprops/MsgRtrApi.properties
+      - ./mnt/mr/logback.xml:/appl/dmaapMR1/bundleconfig/etc/logback.xml
+      - ./mnt/mr/cadi.properties:/appl/dmaapMR1/etc/cadi.properties
+    networks:
+      - default
+    depends_on:
+      - zookeeper
+      - kafka
diff --git a/test/simulator-group/dmaapmr/mnt/kafka/zk_client_jaas.conf b/test/simulator-group/dmaapmr/mnt/kafka/zk_client_jaas.conf
new file mode 100644 (file)
index 0000000..d4ef1eb
--- /dev/null
@@ -0,0 +1,5 @@
+Client {
+   org.apache.zookeeper.server.auth.DigestLoginModule required
+   username="kafka"
+   password="kafka_secret";
+ };
\ No newline at end of file
diff --git a/test/simulator-group/dmaapmr/mnt/mr/KUBE-MsgRtrApi.properties b/test/simulator-group/dmaapmr/mnt/mr/KUBE-MsgRtrApi.properties
new file mode 100644 (file)
index 0000000..66c7db1
--- /dev/null
@@ -0,0 +1,173 @@
+# LICENSE_START=======================================================
+#  org.onap.dmaap
+#  ================================================================================
+#  Copyright Â© 2020 Nordix Foundation. All rights reserved.
+#  Copyright Â© 2017 AT&T Intellectual Property. All rights reserved.
+#  ================================================================================
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+#  ============LICENSE_END=========================================================
+#
+#  ECOMP is a trademark and service mark of AT&T Intellectual Property.
+#
+###############################################################################
+###############################################################################
+##
+## Cambria API Server config
+##
+## Default values are shown as commented settings.
+##
+###############################################################################
+##
+## HTTP service
+##
+## 3904 is standard as of 7/29/14.
+#
+## Zookeeper Connection
+##
+## Both Cambria and Kafka make use of Zookeeper.
+##
+#config.zk.servers=172.18.1.1
+#config.zk.servers={{.Values.zookeeper.name}}:{{.Values.zookeeper.port}}
+config.zk.servers=zookeeper.onap:2181
+
+#config.zk.root=/fe3c/cambria/config
+
+
+###############################################################################
+##
+## Kafka Connection
+##
+##        Items below are passed through to Kafka's producer and consumer
+##        configurations (after removing "kafka.")
+##        if you want to change request.required.acks it can take this one value
+#kafka.metadata.broker.list=localhost:9092,localhost:9093
+#kafka.metadata.broker.list={{.Values.kafka.name}}:{{.Values.kafka.port}}
+kafka.metadata.broker.list=akfak-bwds.onap:9092
+##kafka.request.required.acks=-1
+#kafka.client.zookeeper=${config.zk.servers}
+consumer.timeout.ms=100
+zookeeper.connection.timeout.ms=6000
+zookeeper.session.timeout.ms=20000
+zookeeper.sync.time.ms=2000
+auto.commit.interval.ms=1000
+fetch.message.max.bytes =1000000
+auto.commit.enable=false
+
+#(backoff*retries > zksessiontimeout)
+kafka.rebalance.backoff.ms=10000
+kafka.rebalance.max.retries=6
+
+
+###############################################################################
+##
+##        Secured Config
+##
+##        Some data stored in the config system is sensitive -- API keys and secrets,
+##        for example. to protect it, we use an encryption layer for this section
+##        of the config.
+##
+## The key is a base64 encode AES key. This must be created/configured for
+## each installation.
+#cambria.secureConfig.key=
+##
+## The initialization vector is a 16 byte value specific to the secured store.
+## This must be created/configured for each installation.
+#cambria.secureConfig.iv=
+
+## Southfield Sandbox
+cambria.secureConfig.key=b/7ouTn9FfEw2PQwL0ov/Q==
+cambria.secureConfig.iv=wR9xP5k5vbz/xD0LmtqQLw==
+authentication.adminSecret=fe3cCompound
+#cambria.secureConfig.key[pc569h]=YT3XPyxEmKCTLI2NK+Sjbw==
+#cambria.secureConfig.iv[pc569h]=rMm2jhR3yVnU+u2V9Ugu3Q==
+
+
+###############################################################################
+##
+## Consumer Caching
+##
+##        Kafka expects live connections from the consumer to the broker, which
+##        obviously doesn't work over connectionless HTTP requests. The Cambria
+##        server proxies HTTP requests into Kafka consumer sessions that are kept
+##        around for later re-use. Not doing so is costly for setup per request,
+##        which would substantially impact a high volume consumer's performance.
+##
+##        This complicates Cambria server failover, because we often need server
+##        A to close its connection before server B brings up the replacement.
+##
+
+## The consumer cache is normally enabled.
+#cambria.consumer.cache.enabled=true
+
+## Cached consumers are cleaned up after a period of disuse. The server inspects
+## consumers every sweepFreqSeconds and will clean up any connections that are
+## dormant for touchFreqMs.
+#cambria.consumer.cache.sweepFreqSeconds=15
+cambria.consumer.cache.touchFreqMs=120000
+##stickforallconsumerrequests=false
+## The cache is managed through ZK. The default value for the ZK connection
+## string is the same as config.zk.servers.
+#cambria.consumer.cache.zkConnect=${config.zk.servers}
+
+##
+## Shared cache information is associated with this node's name. The default
+## name is the hostname plus the HTTP service port this host runs on. (The
+## hostname is determined via InetAddress.getLocalHost ().getCanonicalHostName(),
+## which is not always adequate.) You can set this value explicitly here.
+##
+#cambria.api.node.identifier=<use-something-unique-to-this-instance>
+
+#cambria.rateLimit.maxEmptyPollsPerMinute=30
+#cambria.rateLimitActual.delay.ms=10
+
+###############################################################################
+##
+## Metrics Reporting
+##
+##        This server can report its metrics periodically on a topic.
+##
+#metrics.send.cambria.enabled=true
+#metrics.send.cambria.topic=cambria.apinode.metrics                                  #msgrtr.apinode.metrics.dmaap
+#metrics.send.cambria.sendEverySeconds=60
+
+cambria.consumer.cache.zkBasePath=/fe3c/cambria/consumerCache
+consumer.timeout=17
+default.partitions=3
+default.replicas=3
+##############################################################################
+#100mb
+maxcontentlength=10000
+
+
+##############################################################################
+#AAF Properties
+msgRtr.namespace.aaf=org.onap.dmaap.mr.topic
+msgRtr.topicfactory.aaf=org.onap.dmaap.mr.topicFactory|:org.onap.dmaap.mr.topic:
+enforced.topic.name.AAF=org.onap.dmaap.mr
+forceAAF=false
+transidUEBtopicreqd=false
+defaultNSforUEB=org.onap.dmaap.mr
+##############################################################################
+#Mirror Maker Agent
+
+msgRtr.mirrormakeradmin.aaf=org.onap.dmaap.mr.mirrormaker|*|admin
+msgRtr.mirrormakeruser.aaf=org.onap.dmaap.mr.mirrormaker|*|user
+msgRtr.mirrormakeruser.aaf.create=org.onap.dmaap.mr.topicFactory|:org.onap.dmaap.mr.topic:
+msgRtr.mirrormaker.timeout=15000
+msgRtr.mirrormaker.topic=org.onap.dmaap.mr.mirrormakeragent
+msgRtr.mirrormaker.consumergroup=mmagentserver
+msgRtr.mirrormaker.consumerid=1
+
+kafka.max.poll.interval.ms=300000
+kafka.heartbeat.interval.ms=60000
+kafka.session.timeout.ms=240000
+kafka.max.poll.records=1000
\ No newline at end of file
diff --git a/test/simulator-group/dmaapmr/mnt/mr/MsgRtrApi.properties b/test/simulator-group/dmaapmr/mnt/mr/MsgRtrApi.properties
new file mode 100644 (file)
index 0000000..573a81a
--- /dev/null
@@ -0,0 +1,173 @@
+# LICENSE_START=======================================================
+#  org.onap.dmaap
+#  ================================================================================
+#  Copyright Â© 2020 Nordix Foundation. All rights reserved.
+#  Copyright Â© 2017 AT&T Intellectual Property. All rights reserved.
+#  ================================================================================
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+#  ============LICENSE_END=========================================================
+#
+#  ECOMP is a trademark and service mark of AT&T Intellectual Property.
+#
+###############################################################################
+###############################################################################
+##
+## Cambria API Server config
+##
+## Default values are shown as commented settings.
+##
+###############################################################################
+##
+## HTTP service
+##
+## 3904 is standard as of 7/29/14.
+#
+## Zookeeper Connection
+##
+## Both Cambria and Kafka make use of Zookeeper.
+##
+#config.zk.servers=172.18.1.1
+#config.zk.servers={{.Values.zookeeper.name}}:{{.Values.zookeeper.port}}
+config.zk.servers=zookeeper:2181
+
+#config.zk.root=/fe3c/cambria/config
+
+
+###############################################################################
+##
+## Kafka Connection
+##
+##        Items below are passed through to Kafka's producer and consumer
+##        configurations (after removing "kafka.")
+##        if you want to change request.required.acks it can take this one value
+#kafka.metadata.broker.list=localhost:9092,localhost:9093
+#kafka.metadata.broker.list={{.Values.kafka.name}}:{{.Values.kafka.port}}
+kafka.metadata.broker.list=kafka:9092
+##kafka.request.required.acks=-1
+#kafka.client.zookeeper=${config.zk.servers}
+consumer.timeout.ms=100
+zookeeper.connection.timeout.ms=6000
+zookeeper.session.timeout.ms=20000
+zookeeper.sync.time.ms=2000
+auto.commit.interval.ms=1000
+fetch.message.max.bytes =1000000
+auto.commit.enable=false
+
+#(backoff*retries > zksessiontimeout)
+kafka.rebalance.backoff.ms=10000
+kafka.rebalance.max.retries=6
+
+
+###############################################################################
+##
+##        Secured Config
+##
+##        Some data stored in the config system is sensitive -- API keys and secrets,
+##        for example. to protect it, we use an encryption layer for this section
+##        of the config.
+##
+## The key is a base64 encode AES key. This must be created/configured for
+## each installation.
+#cambria.secureConfig.key=
+##
+## The initialization vector is a 16 byte value specific to the secured store.
+## This must be created/configured for each installation.
+#cambria.secureConfig.iv=
+
+## Southfield Sandbox
+cambria.secureConfig.key=b/7ouTn9FfEw2PQwL0ov/Q==
+cambria.secureConfig.iv=wR9xP5k5vbz/xD0LmtqQLw==
+authentication.adminSecret=fe3cCompound
+#cambria.secureConfig.key[pc569h]=YT3XPyxEmKCTLI2NK+Sjbw==
+#cambria.secureConfig.iv[pc569h]=rMm2jhR3yVnU+u2V9Ugu3Q==
+
+
+###############################################################################
+##
+## Consumer Caching
+##
+##        Kafka expects live connections from the consumer to the broker, which
+##        obviously doesn't work over connectionless HTTP requests. The Cambria
+##        server proxies HTTP requests into Kafka consumer sessions that are kept
+##        around for later re-use. Not doing so is costly for setup per request,
+##        which would substantially impact a high volume consumer's performance.
+##
+##        This complicates Cambria server failover, because we often need server
+##        A to close its connection before server B brings up the replacement.
+##
+
+## The consumer cache is normally enabled.
+#cambria.consumer.cache.enabled=true
+
+## Cached consumers are cleaned up after a period of disuse. The server inspects
+## consumers every sweepFreqSeconds and will clean up any connections that are
+## dormant for touchFreqMs.
+#cambria.consumer.cache.sweepFreqSeconds=15
+cambria.consumer.cache.touchFreqMs=120000
+##stickforallconsumerrequests=false
+## The cache is managed through ZK. The default value for the ZK connection
+## string is the same as config.zk.servers.
+#cambria.consumer.cache.zkConnect=${config.zk.servers}
+
+##
+## Shared cache information is associated with this node's name. The default
+## name is the hostname plus the HTTP service port this host runs on. (The
+## hostname is determined via InetAddress.getLocalHost ().getCanonicalHostName(),
+## which is not always adequate.) You can set this value explicitly here.
+##
+#cambria.api.node.identifier=<use-something-unique-to-this-instance>
+
+#cambria.rateLimit.maxEmptyPollsPerMinute=30
+#cambria.rateLimitActual.delay.ms=10
+
+###############################################################################
+##
+## Metrics Reporting
+##
+##        This server can report its metrics periodically on a topic.
+##
+#metrics.send.cambria.enabled=true
+#metrics.send.cambria.topic=cambria.apinode.metrics                                  #msgrtr.apinode.metrics.dmaap
+#metrics.send.cambria.sendEverySeconds=60
+
+cambria.consumer.cache.zkBasePath=/fe3c/cambria/consumerCache
+consumer.timeout=17
+default.partitions=3
+default.replicas=3
+##############################################################################
+#100mb
+maxcontentlength=10000
+
+
+##############################################################################
+#AAF Properties
+msgRtr.namespace.aaf=org.onap.dmaap.mr.topic
+msgRtr.topicfactory.aaf=org.onap.dmaap.mr.topicFactory|:org.onap.dmaap.mr.topic:
+enforced.topic.name.AAF=org.onap.dmaap.mr
+forceAAF=false
+transidUEBtopicreqd=false
+defaultNSforUEB=org.onap.dmaap.mr
+##############################################################################
+#Mirror Maker Agent
+
+msgRtr.mirrormakeradmin.aaf=org.onap.dmaap.mr.mirrormaker|*|admin
+msgRtr.mirrormakeruser.aaf=org.onap.dmaap.mr.mirrormaker|*|user
+msgRtr.mirrormakeruser.aaf.create=org.onap.dmaap.mr.topicFactory|:org.onap.dmaap.mr.topic:
+msgRtr.mirrormaker.timeout=15000
+msgRtr.mirrormaker.topic=org.onap.dmaap.mr.mirrormakeragent
+msgRtr.mirrormaker.consumergroup=mmagentserver
+msgRtr.mirrormaker.consumerid=1
+
+kafka.max.poll.interval.ms=300000
+kafka.heartbeat.interval.ms=60000
+kafka.session.timeout.ms=240000
+kafka.max.poll.records=1000
\ No newline at end of file
diff --git a/test/simulator-group/dmaapmr/mnt/mr/cadi.properties b/test/simulator-group/dmaapmr/mnt/mr/cadi.properties
new file mode 100644 (file)
index 0000000..dca56c8
--- /dev/null
@@ -0,0 +1,19 @@
+aaf_locate_url=https://aaf-locate.{{ include "common.namespace" . }}:8095
+aaf_url=https://AAF_LOCATE_URL/onap.org.osaaf.aaf.service:2.1
+aaf_env=DEV
+aaf_lur=org.onap.aaf.cadi.aaf.v2_0.AAFLurPerm
+
+cadi_truststore=/appl/dmaapMR1/etc/org.onap.dmaap.mr.trust.jks
+cadi_truststore_password=enc:mN6GiIzFQxKGDzAXDOs7b4j8DdIX02QrZ9QOWNRpxV3rD6whPCfizSMZkJwxi_FJ
+
+cadi_keyfile=/appl/dmaapMR1/etc/org.onap.dmaap.mr.keyfile
+
+cadi_alias=dmaapmr@mr.dmaap.onap.org
+cadi_keystore=/appl/dmaapMR1/etc/org.onap.dmaap.mr.p12
+cadi_keystore_password=enc:_JJT2gAEkRzXla5xfDIHal8pIoIB5iIos3USvZQT6sL-l14LpI5fRFR_QIGUCh5W
+cadi_x509_issuers=CN=intermediateCA_1, OU=OSAAF, O=ONAP, C=US:CN=intermediateCA_7, OU=OSAAF, O=ONAP, C=US:CN=intermediateCA_9, OU=OSAAF, O=ONAP, C=US
+
+cadi_loglevel=INFO
+cadi_protocols=TLSv1.1,TLSv1.2
+cadi_latitude=37.78187
+cadi_longitude=-122.26147
\ No newline at end of file
diff --git a/test/simulator-group/dmaapmr/mnt/mr/logback.xml b/test/simulator-group/dmaapmr/mnt/mr/logback.xml
new file mode 100644 (file)
index 0000000..8471208
--- /dev/null
@@ -0,0 +1,209 @@
+<!--
+     ============LICENSE_START=======================================================
+     Copyright Â© 2020 Nordix Foundation. All rights reserved.
+     Copyright Â© 2019 AT&T Intellectual Property. All rights reserved.
+     ================================================================================
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+           http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+     ============LICENSE_END=========================================================
+ -->
+
+<configuration scan="true" scanPeriod="3 seconds" debug="false">
+  <contextName>${module.ajsc.namespace.name}</contextName>
+  <jmxConfigurator />
+  <property name="logDirectory" value="${AJSC_HOME}/log" />
+  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+    <filter class="ch.qos.logback.classic.filter.LevelFilter">
+      <level>ERROR</level>
+      <onMatch>ACCEPT</onMatch>
+      <onMismatch>DENY</onMismatch>
+    </filter>
+    <encoder>
+      <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{1024} - %msg%n
+      </pattern>
+    </encoder>
+  </appender>
+
+  <appender name="INFO" class="ch.qos.logback.core.ConsoleAppender">
+    <filter class="ch.qos.logback.classic.filter.LevelFilter">
+      <level>INFO</level>
+      <onMatch>ACCEPT</onMatch>
+      <onMismatch>DENY</onMismatch>
+    </filter>
+  </appender>
+
+  <appender name="DEBUG" class="ch.qos.logback.core.ConsoleAppender">
+
+    <encoder>
+      <pattern>"%d [%thread] %-5level %logger{1024} - %msg%n"</pattern>
+    </encoder>
+  </appender>
+
+  <appender name="ERROR" class="ch.qos.logback.core.ConsoleAppender"> class="ch.qos.logback.core.ConsoleAppender">
+    <filter class="ch.qos.logback.classic.filter.LevelFilter">
+      <level>ERROR</level>
+      <onMatch>ACCEPT</onMatch>
+      <onMismatch>DENY</onMismatch>
+    </filter>
+    <encoder>
+      <pattern>"%d [%thread] %-5level %logger{1024} - %msg%n"</pattern>
+    </encoder>
+  </appender>
+
+
+  <!-- Msgrtr related loggers -->
+  <logger name="org.onap.dmaap.dmf.mr.service" level="INFO" />
+  <logger name="org.onap.dmaap.dmf.mr.service.impl" level="INFO" />
+
+  <logger name="org.onap.dmaap.dmf.mr.resources" level="INFO" />
+  <logger name="org.onap.dmaap.dmf.mr.resources.streamReaders" level="INFO" />
+
+  <logger name="org.onap.dmaap.dmf.mr.backends" level="INFO" />
+  <logger name="org.onap.dmaap.dmf.mr.backends.kafka" level="INFO" />
+  <logger name="org.onap.dmaap.dmf.mr.backends.memory" level="INFO" />
+
+  <logger name="org.onap.dmaap.dmf.mr.beans" level="INFO" />
+
+  <logger name="org.onap.dmaap.dmf.mr.constants" level="INFO" />
+
+  <logger name="org.onap.dmaap.dmf.mr.exception" level="INFO" />
+
+  <logger name="org.onap.dmaap.dmf.mr.listener" level="INFO" />
+
+  <logger name="org.onap.dmaap.dmf.mr.metabroker" level="INFO" />
+
+  <logger name="org.onap.dmaap.dmf.mr.metrics.publisher" level="INFO" />
+  <logger name="org.onap.dmaap.dmf.mr.metrics.publisher.impl" level="INFO" />
+
+
+
+  <logger name="org.onap.dmaap.dmf.mr.security" level="INFO" />
+  <logger name="org.onap.dmaap.dmf.mr.security.impl" level="INFO" />
+
+  <logger name="org.onap.dmaap.dmf.mr.transaction" level="INFO" />
+  <logger name="com.att.dmf.mr.transaction.impl" level="INFO" />
+
+  <logger name="org.onap.dmaap.dmf.mr.metabroker" level="INFO" />
+  <logger name="org.onap.dmaap.dmf.mr.metabroker" level="INFO" />
+
+  <logger name="org.onap.dmaap.dmf.mr.utils" level="INFO" />
+  <logger name="org.onap.dmaap.mr.filter" level="INFO" />
+
+  <!--<logger name="com.att.nsa.cambria.*" level="INFO" />-->
+
+  <!-- Msgrtr loggers in ajsc -->
+  <logger name="org.onap.dmaap.service" level="INFO" />
+  <logger name="org.onap.dmaap" level="INFO" />
+
+
+  <!-- Spring related loggers -->
+  <logger name="org.springframework" level="WARN" additivity="false"/>
+  <logger name="org.springframework.beans" level="WARN" additivity="false"/>
+  <logger name="org.springframework.web" level="WARN" additivity="false" />
+  <logger name="com.blog.spring.jms" level="WARN" additivity="false" />
+
+  <!-- AJSC Services (bootstrap services) -->
+  <logger name="ajsc" level="WARN" additivity="false"/>
+  <logger name="ajsc.RouteMgmtService" level="INFO" additivity="false"/>
+  <logger name="ajsc.ComputeService" level="INFO" additivity="false" />
+  <logger name="ajsc.VandelayService" level="WARN" additivity="false"/>
+  <logger name="ajsc.FilePersistenceService" level="WARN" additivity="false"/>
+  <logger name="ajsc.UserDefinedJarService" level="WARN" additivity="false" />
+  <logger name="ajsc.UserDefinedBeansDefService" level="WARN" additivity="false" />
+  <logger name="ajsc.LoggingConfigurationService" level="WARN" additivity="false" />
+
+  <!-- AJSC related loggers (DME2 Registration, csi logging, restlet, servlet
+    logging) -->
+  <logger name="ajsc.utils" level="WARN" additivity="false"/>
+  <logger name="ajsc.utils.DME2Helper" level="INFO" additivity="false" />
+  <logger name="ajsc.filters" level="DEBUG" additivity="false" />
+  <logger name="ajsc.beans.interceptors" level="DEBUG" additivity="false" />
+  <logger name="ajsc.restlet" level="DEBUG" additivity="false" />
+  <logger name="ajsc.servlet" level="DEBUG" additivity="false" />
+  <logger name="com.att" level="WARN" additivity="false" />
+  <logger name="com.att.ajsc.csi.logging" level="WARN" additivity="false" />
+  <logger name="com.att.ajsc.filemonitor" level="WARN" additivity="false"/>
+
+  <logger name="com.att.nsa.dmaap.util" level="INFO" additivity="false"/>
+  <logger name="com.att.cadi.filter" level="INFO" additivity="false" />
+
+
+  <!-- Other Loggers that may help troubleshoot -->
+  <logger name="net.sf" level="WARN" additivity="false" />
+  <logger name="org.apache.commons.httpclient" level="WARN" additivity="false"/>
+  <logger name="org.apache.commons" level="WARN" additivity="false" />
+  <logger name="org.apache.coyote" level="WARN" additivity="false"/>
+  <logger name="org.apache.jasper" level="WARN" additivity="false"/>
+
+  <!-- Camel Related Loggers (including restlet/servlet/jaxrs/cxf logging.
+    May aid in troubleshooting) -->
+  <logger name="org.apache.camel" level="WARN" additivity="false" />
+  <logger name="org.apache.cxf" level="WARN" additivity="false" />
+  <logger name="org.apache.camel.processor.interceptor" level="WARN" additivity="false"/>
+  <logger name="org.apache.cxf.jaxrs.interceptor" level="WARN" additivity="false" />
+  <logger name="org.apache.cxf.service" level="WARN" additivity="false" />
+  <logger name="org.restlet" level="DEBUG" additivity="false" />
+  <logger name="org.apache.camel.component.restlet" level="DEBUG" additivity="false" />
+  <logger name="org.apache.kafka" level="DEBUG" additivity="false" />
+  <logger name="org.apache.zookeeper" level="INFO" additivity="false" />
+  <logger name="org.I0Itec.zkclient" level="DEBUG" additivity="false" />
+
+  <!-- logback internals logging -->
+  <logger name="ch.qos.logback.classic" level="INFO" additivity="false"/>
+  <logger name="ch.qos.logback.core" level="INFO" additivity="false" />
+
+  <!-- logback jms appenders & loggers definition starts here -->
+  <!-- logback jms appenders & loggers definition starts here -->
+  <appender name="auditLogs" class="ch.qos.logback.core.ConsoleAppender">
+    <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+    </filter>
+    <encoder>
+      <pattern>"%d [%thread] %-5level %logger{1024} - %msg%n"</pattern>
+    </encoder>
+  </appender>
+  <appender name="perfLogs" class="ch.qos.logback.core.ConsoleAppender">
+    <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+    </filter>
+    <encoder>
+      <pattern>"%d [%thread] %-5level %logger{1024} - %msg%n"</pattern>
+    </encoder>
+  </appender>
+  <appender name="ASYNC-audit" class="ch.qos.logback.classic.AsyncAppender">
+    <queueSize>1000</queueSize>
+    <discardingThreshold>0</discardingThreshold>
+    <appender-ref ref="Audit-Record-Queue" />
+  </appender>
+
+  <logger name="AuditRecord" level="INFO" additivity="FALSE">
+    <appender-ref ref="STDOUT" />
+  </logger>
+  <logger name="AuditRecord_DirectCall" level="INFO" additivity="FALSE">
+    <appender-ref ref="STDOUT" />
+  </logger>
+  <appender name="ASYNC-perf" class="ch.qos.logback.classic.AsyncAppender">
+    <queueSize>1000</queueSize>
+    <discardingThreshold>0</discardingThreshold>
+    <appender-ref ref="Performance-Tracker-Queue" />
+  </appender>
+  <logger name="PerfTrackerRecord" level="INFO" additivity="FALSE">
+    <appender-ref ref="ASYNC-perf" />
+    <appender-ref ref="perfLogs" />
+  </logger>
+  <!-- logback jms appenders & loggers definition ends here -->
+
+  <root level="DEBUG">
+    <appender-ref ref="DEBUG" />
+    <appender-ref ref="ERROR" />
+    <appender-ref ref="INFO" />
+    <appender-ref ref="STDOUT" />
+  </root>
+
+</configuration>
diff --git a/test/simulator-group/dmaapmr/mnt/zk/zk_server_jaas.conf b/test/simulator-group/dmaapmr/mnt/zk/zk_server_jaas.conf
new file mode 100644 (file)
index 0000000..26bf460
--- /dev/null
@@ -0,0 +1,4 @@
+Server {
+       org.apache.zookeeper.server.auth.DigestLoginModule required
+       user_kafka=kafka_secret;
+};
\ No newline at end of file
diff --git a/test/simulator-group/dmaapmr/svc.yaml b/test/simulator-group/dmaapmr/svc.yaml
new file mode 100644 (file)
index 0000000..0a02b4f
--- /dev/null
@@ -0,0 +1,57 @@
+apiVersion: v1
+kind: Service
+metadata:
+  name: $MR_DMAAP_KUBE_APP_NAME
+  namespace: $KUBE_ONAP_NAMESPACE
+  labels:
+    run: $MR_DMAAP_KUBE_APP_NAME
+    autotest: DMAAPMR
+spec:
+  type: ClusterIP
+  ports:
+  - port: $MR_EXTERNAL_PORT
+    targetPort: $MR_INTERNAL_PORT
+    protocol: TCP
+    name: http
+  - port: $MR_EXTERNAL_SECURE_PORT
+    targetPort: $MR_INTERNAL_SECURE_PORT
+    protocol: TCP
+    name: https
+  selector:
+    run: $MR_DMAAP_KUBE_APP_NAME
+---
+apiVersion: v1
+kind: Service
+metadata:
+  name: $MR_KAFKA_BWDS_NAME
+  namespace: $KUBE_ONAP_NAMESPACE
+  labels:
+    run: $MR_KAFKA_BWDS_NAME
+    autotest: DMAAPMR
+spec:
+  type: ClusterIP
+  ports:
+  - port: 9092
+    targetPort: 9092
+    protocol: TCP
+    name: http
+  selector:
+    run: $MR_KAFKA_BWDS_NAME
+---
+apiVersion: v1
+kind: Service
+metadata:
+  name: $MR_ZOOKEEPER_APP_NAME
+  namespace: $KUBE_ONAP_NAMESPACE
+  labels:
+    run: $MR_ZOOKEEPER_APP_NAME
+    autotest: DMAAPMR
+spec:
+  type: ClusterIP
+  ports:
+  - port: 2181
+    targetPort: 2181
+    protocol: TCP
+    name: http
+  selector:
+    run: $MR_ZOOKEEPER_APP_NAME
\ No newline at end of file
diff --git a/test/simulator-group/ecs/app.yaml b/test/simulator-group/ecs/app.yaml
new file mode 100644 (file)
index 0000000..640b61d
--- /dev/null
@@ -0,0 +1,43 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: $ECS_APP_NAME
+  namespace: $KUBE_NONRTRIC_NAMESPACE
+  labels:
+    run: $ECS_APP_NAME
+    autotest: ECS
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      run: $ECS_APP_NAME
+  template:
+    metadata:
+      labels:
+        run: $ECS_APP_NAME
+        autotest: ECS
+    spec:
+      containers:
+      - name: $ECS_APP_NAME
+        image: $ECS_IMAGE
+        imagePullPolicy: Never
+        ports:
+        - name: http
+          containerPort: $ECS_INTERNAL_PORT
+        - name: https
+          containerPort: $ECS_INTERNAL_SECURE_PORT
+        volumeMounts:
+        - mountPath: $ECS_CONFIG_MOUNT_PATH
+          name: ecs-conf-name
+        volumeMounts:
+        - mountPath: $ECS_CONTAINER_MNT_DIR
+          name: ecs-data-name
+      volumes:
+      - configMap:
+          defaultMode: 420
+          name: $ECS_CONFIG_CONFIGMAP_NAME
+        name: ecs-conf-name
+      - persistentVolumeClaim:
+          claimName: $ECS_DATA_CONFIGMAP_NAME
+        name: ecs-data-name
+
diff --git a/test/simulator-group/ecs/application.yaml b/test/simulator-group/ecs/application.yaml
new file mode 100644 (file)
index 0000000..75b11ad
--- /dev/null
@@ -0,0 +1,54 @@
+################################################################################
+#   Copyright (c) 2020 Nordix Foundation.                                      #
+#                                                                              #
+#   Licensed under the Apache License, Version 2.0 (the "License");            #
+#   you may not use this file except in compliance with the License.           #
+#   You may obtain a copy of the License at                                    #
+#                                                                              #
+#       http://www.apache.org/licenses/LICENSE-2.0                             #
+#                                                                              #
+#   Unless required by applicable law or agreed to in writing, software        #
+#   distributed under the License is distributed on an "AS IS" BASIS,          #
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
+#   See the License for the specific language governing permissions and        #
+#   limitations under the License.                                             #
+################################################################################
+
+spring:
+  profiles:
+    active: prod
+  main:
+    allow-bean-definition-overriding: true
+  aop:
+    auto: false
+management:
+  endpoints:
+    web:
+      exposure:
+        include: "loggers,logfile,health,info,metrics,threaddump,heapdump"
+
+logging:
+  level:
+    ROOT: ERROR
+    org.springframework: ERROR
+    org.springframework.data: ERROR
+    org.springframework.web.reactive.function.client.ExchangeFunctions: ERROR
+    org.oransc.enrichment: INFO
+  file:
+    name: /var/log/enrichment-coordinator-service/application.log
+server:
+   port : 8434
+   http-port: 8083
+   ssl:
+      key-store-type: JKS
+      key-store-password: policy_agent
+      key-store: /opt/app/enrichment-coordinator-service/etc/cert/keystore.jks
+      key-password: policy_agent
+      key-alias: policy_agent
+app:
+  filepath: /opt/app/enrichment-coordinator-service/data/application_configuration.json
+  webclient:
+    trust-store-used: false
+    trust-store-password: policy_agent
+    trust-store: /opt/app/enrichment-coordinator-service/etc/cert/truststore.jks
+  vardata-directory: /var/enrichment-coordinator-service
\ No newline at end of file
diff --git a/test/simulator-group/ecs/pvc.yaml b/test/simulator-group/ecs/pvc.yaml
new file mode 100644 (file)
index 0000000..3abd359
--- /dev/null
@@ -0,0 +1,16 @@
+apiVersion: v1
+kind: PersistentVolumeClaim
+metadata:
+  name: $ECS_DATA_CONFIGMAP_NAME
+  namespace: $KUBE_NONRTRIC_NAMESPACE
+  labels:
+    run: $ECS_APP_NAME
+    autotest: ECS
+spec:
+  accessModes:
+  - ReadWriteOnce
+  resources:
+    requests:
+      storage: 10Mi
+  storageClassName: standard
+  volumeMode: Filesystem
\ No newline at end of file
diff --git a/test/simulator-group/ecs/svc.yaml b/test/simulator-group/ecs/svc.yaml
new file mode 100644 (file)
index 0000000..e311c0e
--- /dev/null
@@ -0,0 +1,21 @@
+apiVersion: v1
+kind: Service
+metadata:
+  name: $ECS_APP_NAME
+  namespace: $KUBE_NONRTRIC_NAMESPACE
+  labels:
+    run: $ECS_APP_NAME
+    autotest: ECS
+spec:
+  type: ClusterIP
+  ports:
+  - port: $ECS_EXTERNAL_PORT
+    targetPort: $ECS_INTERNAL_PORT
+    protocol: TCP
+    name: http
+  - port: $ECS_EXTERNAL_SECURE_PORT
+    targetPort: $ECS_INTERNAL_SECURE_PORT
+    protocol: TCP
+    name: https
+  selector:
+    run: $ECS_APP_NAME
\ No newline at end of file
diff --git a/test/simulator-group/httpproxy/.gitignore b/test/simulator-group/httpproxy/.gitignore
new file mode 100644 (file)
index 0000000..3384196
--- /dev/null
@@ -0,0 +1 @@
+.dockererr
\ No newline at end of file
diff --git a/test/simulator-group/httpproxy/app.yaml b/test/simulator-group/httpproxy/app.yaml
new file mode 100644 (file)
index 0000000..3e0c8ac
--- /dev/null
@@ -0,0 +1,30 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: $HTTP_PROXY_APP_NAME
+  namespace: $KUBE_SIM_NAMESPACE
+  labels:
+    run: $HTTP_PROXY_APP_NAME
+    autotest: HTTPPROXY
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      run: $HTTP_PROXY_APP_NAME
+  template:
+    metadata:
+      labels:
+        run: $HTTP_PROXY_APP_NAME
+        autotest: HTTPPROXY
+    spec:
+      containers:
+      - name: $HTTP_PROXY_APP_NAME
+        image: $HTTP_PROXY_IMAGE
+        imagePullPolicy: Never
+        ports:
+        - name: http
+          containerPort: $HTTP_PROXY_INTERNAL_PORT
+        - name: web
+          containerPort: $HTTP_PROXY_WEB_INTERNAL_PORT
+        command: ["mitmweb"]
+        args: ["--web-host", "0.0.0.0", "--no-web-open-browser", "-p", "$HTTP_PROXY_INTERNAL_PORT", "--set", "ssl_insecure"]
\ No newline at end of file
@@ -21,13 +21,12 @@ networks:
     external:
       name: ${DOCKER_SIM_NWNAME}
 services:
-  message-router:
+  httpproxy:
     networks:
       - default
-    container_name: ${MR_APP_NAME}
-    image: ${MRSTUB_IMAGE}
+    container_name: ${HTTP_PROXY_APP_NAME}
+    image: ${HTTP_PROXY_IMAGE}
+    tty: true
+    command: mitmweb --web-host 0.0.0.0 --no-web-open-browser --set ssl_insecure
     ports:
-      - ${MR_EXTERNAL_PORT}:${MR_INTERNAL_PORT}
-      - ${MR_EXTERNAL_SECURE_PORT}:${MR_INTERNAL_SECURE_PORT}
-    volumes:
-      - ${MR_CERT_MOUNT_DIR}:/usr/src/app/cert:ro
+      - ${HTTP_PROXY_WEB_EXTERNAL_PORT}:${HTTP_PROXY_WEB_INTERNAL_PORT}
\ No newline at end of file
diff --git a/test/simulator-group/httpproxy/svc.yaml b/test/simulator-group/httpproxy/svc.yaml
new file mode 100644 (file)
index 0000000..cd27563
--- /dev/null
@@ -0,0 +1,21 @@
+apiVersion: v1
+kind: Service
+metadata:
+  name: $HTTP_PROXY_APP_NAME
+  namespace: $KUBE_SIM_NAMESPACE
+  labels:
+    run: $HTTP_PROXY_APP_NAME
+    autotest: HTTP_PROXY_APP_NAME
+spec:
+  type: ClusterIP
+  ports:
+  - port: $HTTP_PROXY_EXTERNAL_PORT
+    targetPort: $HTTP_PROXY_INTERNAL_PORT
+    protocol: TCP
+    name: http
+  - port: $HTTP_PROXY_WEB_EXTERNAL_PORT
+    targetPort: $HTTP_PROXY_WEB_INTERNAL_PORT
+    protocol: TCP
+    name: web
+  selector:
+    run: $HTTP_PROXY_APP_NAME
\ No newline at end of file
diff --git a/test/simulator-group/mrstub/app.yaml b/test/simulator-group/mrstub/app.yaml
new file mode 100644 (file)
index 0000000..f29db93
--- /dev/null
@@ -0,0 +1,33 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: $MR_STUB_APP_NAME
+  namespace: $KUBE_ONAP_NAMESPACE
+  labels:
+    run: $MR_STUB_APP_NAME
+    autotest: MR
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      run: $MR_STUB_APP_NAME
+  template:
+    metadata:
+      labels:
+        run: $MR_STUB_APP_NAME
+        autotest: MR
+    spec:
+      containers:
+      - name: $MR_STUB_APP_NAME
+        image: $MRSTUB_IMAGE
+        imagePullPolicy: Never
+        ports:
+        - name: http
+          containerPort: $MR_INTERNAL_PORT
+        - name: https
+          containerPort: $MR_INTERNAL_SECURE_PORT
+        env:
+        - name: TOPIC_READ
+          value: $TOPIC_READ
+        - name: TOPIC_WRITE
+          value: $TOPIC_WRITE
\ No newline at end of file
 #  ============LICENSE_END=================================================
 #
 
-service {
-  # Name for CBS in consul, env var CONFIG_BINDING_SERVICE
-  # should be passed to Policy Agent app with this value
-  # This is only to be used when contacting cbs via local host
-  # (typicall when Policy Agent is executed as an application without a container)
-  Name = "config-binding-service-localhost"
-  # Host name where CBS is running
-  Address = "localhost"
-  # Port number where CBS is running
-  Port = 10000
-}
\ No newline at end of file
+version: '3.0'
+networks:
+  default:
+    external:
+      name: ${DOCKER_SIM_NWNAME}
+services:
+  mr-stub:
+    networks:
+      - default
+    container_name: ${MR_STUB_APP_NAME}
+    image: ${MRSTUB_IMAGE}
+    ports:
+      - ${MR_STUB_LOCALHOST_PORT}:${MR_INTERNAL_PORT}
+      - ${MR_STUB_LOCALHOST_SECURE_PORT}:${MR_INTERNAL_SECURE_PORT}
+    volumes:
+      - ${MR_STUB_CERT_MOUNT_DIR}:/usr/src/app/cert:ro
+    environment:
+      - TOPIC_READ=${TOPIC_READ}
+      - TOPIC_WRITE=${TOPIC_WRITE}
diff --git a/test/simulator-group/mrstub/svc.yaml b/test/simulator-group/mrstub/svc.yaml
new file mode 100644 (file)
index 0000000..7723677
--- /dev/null
@@ -0,0 +1,21 @@
+apiVersion: v1
+kind: Service
+metadata:
+  name: $MR_STUB_APP_NAME
+  namespace: $KUBE_ONAP_NAMESPACE
+  labels:
+    run: $MR_STUB_APP_NAME
+    autotest: MR
+spec:
+  type: ClusterIP
+  ports:
+  - port: $MR_EXTERNAL_PORT
+    targetPort: $MR_INTERNAL_PORT
+    protocol: TCP
+    name: http
+  - port: $MR_EXTERNAL_SECURE_PORT
+    targetPort: $MR_INTERNAL_SECURE_PORT
+    protocol: TCP
+    name: https
+  selector:
+    run: $MR_STUB_APP_NAME
\ No newline at end of file
diff --git a/test/simulator-group/policy_agent/app.yaml b/test/simulator-group/policy_agent/app.yaml
new file mode 100644 (file)
index 0000000..ddbae37
--- /dev/null
@@ -0,0 +1,42 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: $POLICY_AGENT_APP_NAME
+  namespace: $KUBE_NONRTRIC_NAMESPACE
+  labels:
+    run: $POLICY_AGENT_APP_NAME
+    autotest: PA
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      run: $POLICY_AGENT_APP_NAME
+  template:
+    metadata:
+      labels:
+        run: $POLICY_AGENT_APP_NAME
+        autotest: PA
+    spec:
+      containers:
+      - name: $POLICY_AGENT_APP_NAME
+        image: $POLICY_AGENT_IMAGE
+        imagePullPolicy: Never
+        ports:
+        - name: http
+          containerPort: $POLICY_AGENT_INTERNAL_PORT
+        - name: https
+          containerPort: $POLICY_AGENT_INTERNAL_SECURE_PORT
+        volumeMounts:
+        - mountPath: $POLICY_AGENT_CONFIG_MOUNT_PATH
+          name: pa-conf-name
+        - mountPath: $POLICY_AGENT_DATA_MOUNT_PATH
+          name: pa-data-name
+      volumes:
+      - configMap:
+          defaultMode: 420
+          name: $POLICY_AGENT_CONFIG_CONFIGMAP_NAME
+        name: pa-conf-name
+      - configMap:
+          defaultMode: 420
+          name: $POLICY_AGENT_DATA_CONFIGMAP_NAME
+        name: pa-data-name
\ No newline at end of file
diff --git a/test/simulator-group/policy_agent/application.yaml b/test/simulator-group/policy_agent/application.yaml
new file mode 100644 (file)
index 0000000..49111d8
--- /dev/null
@@ -0,0 +1,66 @@
+################################################################################
+#   Copyright (c) 2020 Nordix Foundation.                                      #
+#                                                                              #
+#   Licensed under the Apache License, Version 2.0 (the \"License\");            #
+#   you may not use this file except in compliance with the License.           #
+#   You may obtain a copy of the License at                                    #
+#                                                                              #
+#       http://www.apache.org/licenses/LICENSE-2.0                             #
+#                                                                              #
+#   Unless required by applicable law or agreed to in writing, software        #
+#   distributed under the License is distributed on an \"AS IS\" BASIS,          #
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
+#   See the License for the specific language governing permissions and        #
+#   limitations under the License.                                             #
+################################################################################
+
+spring:
+  profiles:
+    active: prod
+  main:
+    allow-bean-definition-overriding: true
+  aop:
+    auto: false
+management:
+  endpoints:
+    web:
+      exposure:
+        # Enabling of springboot actuator features. See springboot documentation.
+        include: "loggers,logfile,health,info,metrics,threaddump,heapdump"
+
+logging:
+  # Configuration of logging
+  level:
+    ROOT: ERROR
+    org.springframework: ERROR
+    org.springframework.data: ERROR
+    org.springframework.web.reactive.function.client.ExchangeFunctions: ERROR
+    ${POLICY_AGENT_PKG_NAME}: INFO
+  file: /var/log/policy-agent/application.log
+
+server:
+  # Configuration of the HTTP/REST server. The parameters are defined and handeled by the springboot framework.
+  # See springboot documentation.
+  port : 8433
+  http-port: 8081
+  ssl:
+    key-store-type: JKS
+    key-store-password: policy_agent
+    key-store: /opt/app/policy-agent/etc/cert/keystore.jks
+    key-password: policy_agent
+    key-alias: policy_agent
+app:
+  # Location of the component configuration file. The file will only be used if the Consul database is not used;
+  # configuration from the Consul will override the file.
+  filepath: /opt/app/policy-agent/data/application_configuration.json
+  webclient:
+    # Configuration of the trust store used for the HTTP client (outgoing requests)
+    # The file location and the password for the truststore is only relevant if trust-store-used == true
+    # Note that the same keystore as for the server is used.
+    trust-store-used: false
+    trust-store-password: policy_agent
+    trust-store: /opt/app/policy-agent/etc/cert/truststore.jks
+    # Configuration of usage of HTTP Proxy for the southbound accesses.
+    # The HTTP proxy (if configured) will only be used for accessing NearRT RIC:s
+    http.proxy-host: $AGENT_HTTP_PROXY_CONFIG_HOST_NAME
+    http.proxy-port: $AGENT_HTTP_PROXY_CONFIG_PORT
index 506c716..18350a0 100644 (file)
@@ -33,6 +33,8 @@ services:
       - CONSUL_HOST=${CONSUL_HOST}
       - CONSUL_PORT=${CONSUL_INTERNAL_PORT}
       - CONFIG_BINDING_SERVICE=${CONFIG_BINDING_SERVICE}
-      - HOSTNAME=${POLICY_AGENT_APP_NAME}
+      - HOSTNAME=${POLICY_AGENT_CONFIG_KEY}
+    volumes:
+    - ${POLICY_AGENT_HOST_MNT_DIR}/$POLICY_AGENT_CONFIG_FILE:${POLICY_AGENT_CONFIG_MOUNT_PATH}/$POLICY_AGENT_CONFIG_FILE
 
 
diff --git a/test/simulator-group/policy_agent/mnt/application.yaml b/test/simulator-group/policy_agent/mnt/application.yaml
new file mode 100644 (file)
index 0000000..30ec4de
--- /dev/null
@@ -0,0 +1,66 @@
+################################################################################
+#   Copyright (c) 2020 Nordix Foundation.                                      #
+#                                                                              #
+#   Licensed under the Apache License, Version 2.0 (the \"License\");            #
+#   you may not use this file except in compliance with the License.           #
+#   You may obtain a copy of the License at                                    #
+#                                                                              #
+#       http://www.apache.org/licenses/LICENSE-2.0                             #
+#                                                                              #
+#   Unless required by applicable law or agreed to in writing, software        #
+#   distributed under the License is distributed on an \"AS IS\" BASIS,          #
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
+#   See the License for the specific language governing permissions and        #
+#   limitations under the License.                                             #
+################################################################################
+
+spring:
+  profiles:
+    active: prod
+  main:
+    allow-bean-definition-overriding: true
+  aop:
+    auto: false
+management:
+  endpoints:
+    web:
+      exposure:
+        # Enabling of springboot actuator features. See springboot documentation.
+        include: "loggers,logfile,health,info,metrics,threaddump,heapdump"
+
+logging:
+  # Configuration of logging
+  level:
+    ROOT: ERROR
+    org.springframework: ERROR
+    org.springframework.data: ERROR
+    org.springframework.web.reactive.function.client.ExchangeFunctions: ERROR
+    org.onap.ccsdk.oran.a1policymanagementservice: INFO
+  file: /var/log/policy-agent/application.log
+
+server:
+  # Configuration of the HTTP/REST server. The parameters are defined and handeled by the springboot framework.
+  # See springboot documentation.
+  port : 8433
+  http-port: 8081
+  ssl:
+    key-store-type: JKS
+    key-store-password: policy_agent
+    key-store: /opt/app/policy-agent/etc/cert/keystore.jks
+    key-password: policy_agent
+    key-alias: policy_agent
+app:
+  # Location of the component configuration file. The file will only be used if the Consul database is not used;
+  # configuration from the Consul will override the file.
+  filepath: /opt/app/policy-agent/data/application_configuration.json
+  webclient:
+    # Configuration of the trust store used for the HTTP client (outgoing requests)
+    # The file location and the password for the truststore is only relevant if trust-store-used == true
+    # Note that the same keystore as for the server is used.
+    trust-store-used: false
+    trust-store-password: policy_agent
+    trust-store: /opt/app/policy-agent/etc/cert/truststore.jks
+    # Configuration of usage of HTTP Proxy for the southbound accesses.
+    # The HTTP proxy (if configured) will only be used for accessing NearRT RIC:s
+    http.proxy-host: 
+    http.proxy-port: 0
diff --git a/test/simulator-group/policy_agent/svc.yaml b/test/simulator-group/policy_agent/svc.yaml
new file mode 100644 (file)
index 0000000..0a9eca9
--- /dev/null
@@ -0,0 +1,21 @@
+apiVersion: v1
+kind: Service
+metadata:
+  name: $POLICY_AGENT_APP_NAME
+  namespace: $KUBE_NONRTRIC_NAMESPACE
+  labels:
+    run: $POLICY_AGENT_APP_NAME
+    autotest: PA
+spec:
+  type: ClusterIP
+  ports:
+  - port: $POLICY_AGENT_EXTERNAL_PORT
+    targetPort: $POLICY_AGENT_INTERNAL_PORT
+    protocol: TCP
+    name: http
+  - port: $POLICY_AGENT_EXTERNAL_SECURE_PORT
+    targetPort: $POLICY_AGENT_INTERNAL_SECURE_PORT
+    protocol: TCP
+    name: https
+  selector:
+    run: $POLICY_AGENT_APP_NAME
\ No newline at end of file
diff --git a/test/simulator-group/prodstub/app.yaml b/test/simulator-group/prodstub/app.yaml
new file mode 100644 (file)
index 0000000..9fb5ad5
--- /dev/null
@@ -0,0 +1,28 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: $PROD_STUB_APP_NAME
+  namespace: $KUBE_SIM_NAMESPACE
+  labels:
+    run: $PROD_STUB_APP_NAME
+    autotest: PRODSTUB
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      run: $PROD_STUB_APP_NAME
+  template:
+    metadata:
+      labels:
+        run: $PROD_STUB_APP_NAME
+        autotest: PRODSTUB
+    spec:
+      containers:
+      - name: $PROD_STUB_APP_NAME
+        image: $PROD_STUB_IMAGE
+        imagePullPolicy: Never
+        ports:
+        - name: http
+          containerPort: $PROD_STUB_INTERNAL_PORT
+        - name: https
+          containerPort: $PROD_STUB_INTERNAL_SECURE_PORT
diff --git a/test/simulator-group/prodstub/svc.yaml b/test/simulator-group/prodstub/svc.yaml
new file mode 100644 (file)
index 0000000..1fe4048
--- /dev/null
@@ -0,0 +1,21 @@
+apiVersion: v1
+kind: Service
+metadata:
+  name: $PROD_STUB_APP_NAME
+  namespace: $KUBE_SIM_NAMESPACE
+  labels:
+    run: $PROD_STUB_APP_NAME
+    autotest: PROD_STUB
+spec:
+  type: ClusterIP
+  ports:
+  - port: $PROD_STUB_EXTERNAL_PORT
+    targetPort: $PROD_STUB_INTERNAL_PORT
+    protocol: TCP
+    name: http
+  - port: $PROD_STUB_EXTERNAL_SECURE_PORT
+    targetPort: $PROD_STUB_INTERNAL_SECURE_PORT
+    protocol: TCP
+    name: https
+  selector:
+    run: $PROD_STUB_APP_NAME
\ No newline at end of file
diff --git a/test/simulator-group/rapp_catalogue/app.yaml b/test/simulator-group/rapp_catalogue/app.yaml
new file mode 100644 (file)
index 0000000..0c0a26c
--- /dev/null
@@ -0,0 +1,28 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: $RAPP_CAT_APP_NAME
+  namespace: $KUBE_NONRTRIC_NAMESPACE
+  labels:
+    run: $RAPP_CAT_APP_NAME
+    autotest: RC
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      run: $RAPP_CAT_APP_NAME
+  template:
+    metadata:
+      labels:
+        run: $RAPP_CAT_APP_NAME
+        autotest: RC
+    spec:
+      containers:
+      - name: $RAPP_CAT_APP_NAME
+        image: $RAPP_CAT_IMAGE
+        imagePullPolicy: Never
+        ports:
+        - name: http
+          containerPort: $RAPP_CAT_INTERNAL_PORT
+        - name: https
+          containerPort: $RAPP_CAT_INTERNAL_SECURE_PORT
index 1cf35f7..35d2bef 100644 (file)
@@ -18,7 +18,7 @@ version: '3.0'
 networks:
   default:
     external:
-      name: nonrtric-docker-net
+      name: ${DOCKER_SIM_NWNAME}
 services:
   rapp-catalogue:
     image: ${RAPP_CAT_IMAGE}
diff --git a/test/simulator-group/rapp_catalogue/svc.yaml b/test/simulator-group/rapp_catalogue/svc.yaml
new file mode 100644 (file)
index 0000000..0cb6235
--- /dev/null
@@ -0,0 +1,21 @@
+apiVersion: v1
+kind: Service
+metadata:
+  name: $RAPP_CAT_APP_NAME
+  namespace: $KUBE_NONRTRIC_NAMESPACE
+  labels:
+    run: $RAPP_CAT_APP_NAME
+    autotest: RC
+spec:
+  type: ClusterIP
+  ports:
+  - port: $RAPP_CAT_EXTERNAL_PORT
+    targetPort: $RAPP_CAT_INTERNAL_PORT
+    protocol: TCP
+    name: http
+  - port: $RAPP_CAT_EXTERNAL_SECURE_PORT
+    targetPort: $RAPP_CAT_INTERNAL_SECURE_PORT
+    protocol: TCP
+    name: https
+  selector:
+    run: $RAPP_CAT_APP_NAME
\ No newline at end of file
diff --git a/test/simulator-group/ric/app.yaml b/test/simulator-group/ric/app.yaml
new file mode 100644 (file)
index 0000000..df5d982
--- /dev/null
@@ -0,0 +1,36 @@
+apiVersion: apps/v1
+kind: StatefulSet
+metadata:
+  name: $RIC_SIM_SET_NAME
+  namespace: $KUBE_NONRTRIC_NAMESPACE
+  labels:
+    run: $RIC_SIM_SET_NAME
+    autotest: RICSIM
+spec:
+  replicas: $RIC_SIM_COUNT
+  serviceName: $RIC_SIM_SET_NAME
+  selector:
+    matchLabels:
+      run: $RIC_SIM_SET_NAME
+  template:
+    metadata:
+      labels:
+        run: $RIC_SIM_SET_NAME
+        autotest: RICSIM
+    spec:
+      containers:
+      - name: $RIC_SIM_SET_NAME
+        image: $RIC_SIM_IMAGE
+        env:
+        - name: A1_VERSION
+          value: $A1_VERSION
+        - name: REMOTE_HOSTS_LOGGING
+          value: "1"
+        - name: ALLOW_HTTP
+          value: "true"
+        imagePullPolicy: Never
+        ports:
+        - name: http
+          containerPort: $RIC_SIM_INTERNAL_PORT
+        - name: https
+          containerPort: $RIC_SIM_INTERNAL_SECURE_PORT
\ No newline at end of file
diff --git a/test/simulator-group/ric/svc.yaml b/test/simulator-group/ric/svc.yaml
new file mode 100644 (file)
index 0000000..902bb64
--- /dev/null
@@ -0,0 +1,15 @@
+apiVersion: v1
+kind: Service
+metadata:
+  name: $RIC_SIM_SET_NAME
+  namespace: $KUBE_NONRTRIC_NAMESPACE
+  labels:
+    run: $RIC_SIM_SET_NAME
+    autotest: RICSIM
+spec:
+  ports:
+  - port: 80
+    name: http
+  clusterIP: None
+  selector:
+    run: $RIC_SIM_SET_NAME
\ No newline at end of file
diff --git a/test/simulator-group/sdnc/app.yaml b/test/simulator-group/sdnc/app.yaml
new file mode 100644 (file)
index 0000000..cd170f6
--- /dev/null
@@ -0,0 +1,72 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: $SDNC_APP_NAME
+  namespace: $KUBE_NONRTRIC_NAMESPACE
+  labels:
+    run: $SDNC_APP_NAME
+    autotest: SDNC
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      run: $SDNC_APP_NAME
+  template:
+    metadata:
+      labels:
+        run: $SDNC_APP_NAME
+        autotest: SDNC
+    spec:
+      containers:
+      - name: $SDNC_APP_NAME
+        image: $SDNC_A1_CONTROLLER_IMAGE
+        imagePullPolicy: Never
+        ports:
+        - name: http
+          containerPort: $SDNC_INTERNAL_PORT
+        - name: https
+          containerPort: $SDNC_INTERNAL_SECURE_PORT
+        env:
+        - name: MYSQL_ROOT_PASSWORD
+          value: openECOMP1.0
+        - name: SDNC_CONFIG_DIR
+          value: /opt/onap/sdnc/data/properties
+        - name: SDNC_DB_INIT
+          value: 'true'
+        - name: A1_TRUSTSTORE_PASSWORD
+          value: $SDNC_A1_TRUSTSTORE_PASSWORD
+        command:
+        - /opt/onap/sdnc/bin/startODL.sh
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: $SDNC_DB_APP_NAME
+  namespace: $KUBE_NONRTRIC_NAMESPACE
+  labels:
+    run: $SDNC_DB_APP_NAME
+    autotest: SDNC
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      run: $SDNC_DB_APP_NAME
+  template:
+    metadata:
+      labels:
+        run: $SDNC_DB_APP_NAME
+        autotest: SDNC
+    spec:
+      containers:
+        - name: $SDNC_DB_APP_NAME
+          image: $SDNC_DB_IMAGE
+          imagePullPolicy: Never
+          ports:
+          - name: http
+            containerPort: 3306
+          env:
+          - name: MYSQL_ROOT_PASSWORD
+            value: openECOMP1.0
+          - name: MYSQL_ROOT_HOST
+            value: '%'
+
index b9391ea..80f60f7 100644 (file)
@@ -37,7 +37,7 @@ services:
         max-size: "30m"
         max-file: "5"
 
-  a1-controller:
+  a1controller:
     image: ${SDNC_A1_CONTROLLER_IMAGE}
     depends_on :
       - db
diff --git a/test/simulator-group/sdnc/svc.yaml b/test/simulator-group/sdnc/svc.yaml
new file mode 100644 (file)
index 0000000..6a9cd1d
--- /dev/null
@@ -0,0 +1,57 @@
+apiVersion: v1
+kind: Service
+metadata:
+  name: $SDNC_APP_NAME
+  namespace: $KUBE_NONRTRIC_NAMESPACE
+  labels:
+    run: $SDNC_APP_NAME
+    autotest: SDNC
+spec:
+  type: ClusterIP
+  ports:
+  - port: $SDNC_EXTERNAL_PORT
+    targetPort: $SDNC_INTERNAL_PORT
+    protocol: TCP
+    name: http
+  - port: $SDNC_EXTERNAL_SECURE_PORT
+    targetPort: $SDNC_INTERNAL_SECURE_PORT
+    protocol: TCP
+    name: https
+  selector:
+    run: $SDNC_APP_NAME
+---
+apiVersion: v1
+kind: Service
+metadata:
+  name: dbhost
+  namespace: $KUBE_NONRTRIC_NAMESPACE
+  labels:
+    run: $SDNC_DB_APP_NAME
+    autotest: SDNC
+spec:
+  type: ClusterIP
+  ports:
+  - port: 3306
+    targetPort: 3306
+    protocol: TCP
+    name: http
+  selector:
+    run: $SDNC_DB_APP_NAME
+---
+apiVersion: v1
+kind: Service
+metadata:
+  name: sdnctldb01
+  namespace: $KUBE_NONRTRIC_NAMESPACE
+  labels:
+    run: $SDNC_DB_APP_NAME
+    autotest: SDNC
+spec:
+  type: ClusterIP
+  ports:
+  - port: 3306
+    targetPort: 3306
+    protocol: TCP
+    name: http
+  selector:
+    run: $SDNC_DB_APP_NAME
\ No newline at end of file