Test env updates 19/6019/1
authorBjornMagnussonXA <bjorn.magnusson@est.tech>
Thu, 6 May 2021 17:49:17 +0000 (19:49 +0200)
committerBjornMagnussonXA <bjorn.magnusson@est.tech>
Fri, 7 May 2021 06:01:26 +0000 (08:01 +0200)
Updated test cases
Updated release name to D Release
Added image push policy when using custom image repo
Updated http proxies to also accept https in proxy requests

Issue-ID: NONRTRIC-486
Signed-off-by: BjornMagnussonXA <bjorn.magnusson@est.tech>
Change-Id: I8a4a642ee50f53f7f278dd0963eb1f1b70563bbf

42 files changed:
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/FTC2001.sh
test/auto-test/FTC300.sh
test/auto-test/FTC310.sh
test/auto-test/FTC350.sh
test/auto-test/FTC800.sh
test/auto-test/FTC805.sh
test/auto-test/FTC810.sh
test/auto-test/FTC850.sh
test/auto-test/FTC900.sh
test/auto-test/FTC_HELM_RECIPE_D_RELEASE.sh [moved from test/auto-test/FTC_HELM_RECIPE_DAWN.sh with 99% similarity]
test/auto-test/PM_DEMO.sh
test/auto-test/PM_EI_DEMO.sh
test/auto-test/README.md
test/common/README.md
test/common/api_curl.sh
test/common/controller_api_functions.sh
test/common/http_proxy_api_functions.sh
test/common/kube_proxy_api_functions.sh
test/common/prodstub_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-onap-istanbul.sh
test/common/test_env-oran-cherry.sh
test/common/test_env-oran-d-release.sh [moved from test/common/test_env-oran-dawn.sh with 95% similarity]
test/common/testcase_common.sh
test/common/testengine_config.sh
test/http-https-proxy/README.md
test/http-https-proxy/basic_test.sh
test/http-https-proxy/http_proxy.js
test/simulator-group/httpproxy/app.yaml
test/simulator-group/httpproxy/docker-compose.yml
test/simulator-group/httpproxy/svc.yaml
test/simulator-group/kubeproxy/app.yaml
test/simulator-group/kubeproxy/svc.yaml

index f39ebfb..5347f8f 100755 (executable)
@@ -34,7 +34,7 @@ KUBE_PRESTARTED_IMAGES=""
 CONDITIONALLY_IGNORED_IMAGES="NGW"
 
 #Supported test environment profiles
-SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-DAWN"
+SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-D-RELEASE"
 #Supported run modes
 SUPPORTED_RUNMODES="DOCKER KUBE"
 
index 2e443cb..a3010f2 100755 (executable)
@@ -33,7 +33,7 @@ KUBE_PRESTARTED_IMAGES=""
 CONDITIONALLY_IGNORED_IMAGES="NGW"
 
 #Supported test environment profiles
-SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-DAWN"
+SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-D-RELEASE"
 #Supported run modes
 SUPPORTED_RUNMODES="DOCKER KUBE"
 
index f58ba16..a3432e1 100755 (executable)
@@ -24,7 +24,7 @@ TC_ONELINE_DESCR="Full agent API walkthrough using agent REST/DMAAP and with/wit
 DOCKER_INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC NGW"
 
 #App names to include in the test when running kubernetes, space separated list
-KUBE_INCLUDED_IMAGES="CP CR MR PA RICSIM SDNC KUBEPROXY NGw"
+KUBE_INCLUDED_IMAGES="CP CR MR PA RICSIM SDNC KUBEPROXY NGW"
 #Prestarted app (not started by script) to include in the test when running kubernetes, space separated list
 KUBE_PRESTARTED_IMAGES=""
 
@@ -34,7 +34,7 @@ KUBE_PRESTARTED_IMAGES=""
 CONDITIONALLY_IGNORED_IMAGES="NGW"
 
 #Supported test environment profiles
-SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-DAWN"
+SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-D-RELEASE"
 #Supported run modes
 SUPPORTED_RUNMODES="DOCKER KUBE"
 
index c9108f8..c74ce24 100755 (executable)
@@ -34,7 +34,7 @@ KUBE_PRESTARTED_IMAGES=""
 CONDITIONALLY_IGNORED_IMAGES="NGW"
 
 #Supported test environment profiles
-SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-DAWN"
+SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-D-RELEASE"
 #Supported run modes
 SUPPORTED_RUNMODES="DOCKER KUBE"
 
index 6c74daf..76f03d5 100755 (executable)
@@ -34,7 +34,7 @@ KUBE_PRESTARTED_IMAGES=""
 CONDITIONALLY_IGNORED_IMAGES="NGW"
 
 #Supported test environment profiles
-SUPPORTED_PROFILES="ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-DAWN"
+SUPPORTED_PROFILES="ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-D-RELEASE"
 #Supported run modes
 SUPPORTED_RUNMODES="DOCKER KUBE"
 
index 51bcbe4..a3dfbe0 100755 (executable)
@@ -28,7 +28,7 @@ KUBE_INCLUDED_IMAGES=" RICSIM SDNC KUBEPROXY"
 KUBE_PRESTARTED_IMAGES=" "
 
 #Supported test environment profiles
-SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-DAWN"
+SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-D-RELEASE"
 #Supported run modes
 SUPPORTED_RUNMODES="DOCKER KUBE"
 
index f3d9501..01f0178 100755 (executable)
@@ -34,7 +34,7 @@ KUBE_PRESTARTED_IMAGES=""
 CONDITIONALLY_IGNORED_IMAGES="NGW"
 
 #Supported test environment profiles
-SUPPORTED_PROFILES="ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-DAWN"
+SUPPORTED_PROFILES="ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-D-RELEASE"
 #Supported run modes
 SUPPORTED_RUNMODES="DOCKER KUBE"
 
index c62a135..ab48c6e 100755 (executable)
@@ -33,7 +33,7 @@ KUBE_PRESTARTED_IMAGES=""
 CONDITIONALLY_IGNORED_IMAGES="NGW"
 
 #Supported test environment profiles
-SUPPORTED_PROFILES="ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-DAWN"
+SUPPORTED_PROFILES="ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-D-RELEASE"
 #Supported run modes
 SUPPORTED_RUNMODES="DOCKER KUBE"
 
index 1efdfde..7c0208a 100755 (executable)
@@ -33,7 +33,7 @@ KUBE_PRESTARTED_IMAGES=""
 CONDITIONALLY_IGNORED_IMAGES="NGW"
 
 #Supported test environment profiles
-SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-DAWN"
+SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-D-RELEASE"
 #Supported run modes
 SUPPORTED_RUNMODES="DOCKER KUBE"
 
index 616751b..7865edb 100755 (executable)
@@ -24,7 +24,7 @@ TC_ONELINE_DESCR="Resync of RIC via changes in the consul config or pushed confi
 DOCKER_INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM NGW"
 
 #Supported test environment profiles
-SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-DAWN"
+SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-D-RELEASE"
 #Supported run modes
 SUPPORTED_RUNMODES="DOCKER"
 
index 4390cdb..756ea7f 100755 (executable)
@@ -28,7 +28,7 @@ KUBE_INCLUDED_IMAGES="CP CR MR PA RICSIM SDNC KUBEPROXY NGW"
 KUBE_PRESTARTED_IMAGES=""
 
 #Supported test environment profiles
-SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-DAWN"
+SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-D-RELEASE"
 #Supported run modes
 SUPPORTED_RUNMODES="DOCKER KUBE"
 
@@ -41,6 +41,7 @@ SUPPORTED_RUNMODES="DOCKER KUBE"
 . ../common/control_panel_api_functions.sh
 . ../common/controller_api_functions.sh
 . ../common/kube_proxy_api_functions.sh
+. ../common/gateway_api_functions.sh
 
 setup_testenvironment
 
index 40c4f13..0a5cb3a 100755 (executable)
@@ -33,7 +33,7 @@ KUBE_PRESTARTED_IMAGES=""
 CONDITIONALLY_IGNORED_IMAGES="NGW"
 
 #Supported test environment profiles
-SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-DAWN"
+SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-D-RELEASE"
 #Supported run modes
 SUPPORTED_RUNMODES="DOCKER KUBE"
 
index c563bb0..3c99ed9 100755 (executable)
@@ -33,7 +33,7 @@ KUBE_PRESTARTED_IMAGES=""
 CONDITIONALLY_IGNORED_IMAGES="NGW"
 
 #Supported test environment profiles
-SUPPORTED_PROFILES="ONAP-ISTANBUL ORAN-DAWN"
+SUPPORTED_PROFILES="ONAP-ISTANBUL ORAN-D-RELEASE"
 #Supported run modes
 SUPPORTED_RUNMODES="DOCKER KUBE"
 
@@ -154,7 +154,7 @@ for __httpx in $TESTED_PROTOCOLS ; do
             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_SERVICE_PATH/1"
+        api_put_service 201 "serv1" 0 "$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++))
@@ -182,6 +182,8 @@ for __httpx in $TESTED_PROTOCOLS ; do
             sim_equal ricsim_g1_$i num_instances $NUM_POLICIES_PER_RIC
         done
 
+        api_get_services 200 "serv1" "serv1" 0 "$CR_SERVICE_PATH/1"
+
         stop_policy_agent
 
         start_stopped_policy_agent
@@ -217,6 +219,8 @@ for __httpx in $TESTED_PROTOCOLS ; do
 
         print_timer "Restore $((NUM_POLICIES_PER_RIC*$NUM_RICS)) polices after restart over $interface using "$__httpx
 
+        api_get_services 200 "serv1" "serv1" 0 "$CR_SERVICE_PATH/1"
+
         start_timer "Delete $((NUM_POLICIES_PER_RIC*$NUM_RICS)) polices over $interface using "$__httpx
 
         api_delete_policy_parallel 204 $NUM_RICS $START_ID $NUM_POLICIES_PER_RIC 7
@@ -245,6 +249,8 @@ for __httpx in $TESTED_PROTOCOLS ; do
 
         sleep_wait 200
 
+        api_get_services 200 "serv1" "serv1" 0 "$CR_SERVICE_PATH/1"
+
         api_equal json:policies 0
 
         for ((i=1; i<=$NUM_RICS; i++))
index 44015d6..37faaa4 100755 (executable)
@@ -33,7 +33,7 @@ KUBE_PRESTARTED_IMAGES=""
 CONDITIONALLY_IGNORED_IMAGES="NGW"
 
 #Supported test environment profiles
-SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-DAWN"
+SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-D-RELEASE"
 #Supported run modes
 SUPPORTED_RUNMODES="DOCKER KUBE"
 
index 451da3f..b49dcc2 100755 (executable)
@@ -33,7 +33,7 @@ KUBE_PRESTARTED_IMAGES=""
 CONDITIONALLY_IGNORED_IMAGES="NGW"
 
 #Supported test environment profiles
-SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-DAWN"
+SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-D-RELEASE"
 #Supported run modes
 SUPPORTED_RUNMODES="DOCKER KUBE"
 
index 33ebd69..3cd3bd2 100755 (executable)
@@ -33,7 +33,7 @@ KUBE_PRESTARTED_IMAGES=""
 CONDITIONALLY_IGNORED_IMAGES="NGW"
 
 #Supported test environment profiles
-SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-DAWN"
+SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-D-RELEASE"
 #Supported run modes
 SUPPORTED_RUNMODES="DOCKER KUBE"
 
similarity index 99%
rename from test/auto-test/FTC_HELM_RECIPE_DAWN.sh
rename to test/auto-test/FTC_HELM_RECIPE_D_RELEASE.sh
index 7d8f079..4343bea 100755 (executable)
@@ -17,7 +17,7 @@
 #  ============LICENSE_END=================================================
 #
 
-TC_ONELINE_DESCR="Sanity test of Non-RT RIC Helm recepie - all components - DAWN release"
+TC_ONELINE_DESCR="Sanity test of Non-RT RIC Helm recepie - all components - D-RELEASE"
 
 #App names to include in the test when running docker, space separated list
 DOCKER_INCLUDED_IMAGES="" # Not used -  KUBE only test script
@@ -28,7 +28,7 @@ KUBE_INCLUDED_IMAGES=" MR CR  PRODSTUB KUBEPROXY"
 KUBE_PRESTARTED_IMAGES=" PA RICSIM CP ECS RC SDNC"
 
 #Supported test environment profiles
-SUPPORTED_PROFILES="ORAN-DAWN"
+SUPPORTED_PROFILES="ORAN-D-RELEASE"
 #Supported run modes
 SUPPORTED_RUNMODES="KUBE"
 
index f9d08b5..644c5e2 100755 (executable)
@@ -33,7 +33,7 @@ KUBE_PRESTARTED_IMAGES=""
 CONDITIONALLY_IGNORED_IMAGES="NGW"
 
 #Supported test environment profiles
-SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-DAWN"
+SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-D-RELEASE"
 #Supported run modes
 SUPPORTED_RUNMODES="DOCKER KUBE"
 
index 66b6454..6f866fb 100755 (executable)
@@ -33,7 +33,7 @@ KUBE_PRESTARTED_IMAGES=""
 CONDITIONALLY_IGNORED_IMAGES="NGW"
 
 #Supported test environment profiles
-SUPPORTED_PROFILES="ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-DAWN"
+SUPPORTED_PROFILES="ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-D-RELEASE"
 #Supported run modes
 SUPPORTED_RUNMODES="DOCKER KUBE"
 
index 8882ce7..4926b58 100644 (file)
@@ -34,12 +34,12 @@ ORAN CHERRY
 ./PM_EI_DEMO.sh remote-remove  docker release   --env-file ../common/test_env-oran-cherry.sh
 ./PM_EI_DEMO.sh remote-remove  kube  release --env-file ../common/test_env-oran-cherry.sh
 
-ORAN DAWN
+ORAN D-RELEASE
 =========
-./PM_EI_DEMO.sh remote-remove  docker   --env-file ../common/test_env-oran-dawn.sh  --use-release-image SDNC
-./PM_EI_DEMO.sh remote-remove  kube   --env-file ../common/test_env-oran-dawn.sh  --use-release-image SDNC
-Note that dawn has not update the SDNC so cherry release is used
-Note: When dawn is released, add the 'release' arg to run released images.
+./PM_EI_DEMO.sh remote-remove  docker   --env-file ../common/test_env-oran-d-release.sh  --use-release-image SDNC
+./PM_EI_DEMO.sh remote-remove  kube   --env-file ../common/test_env-oran-d-release.sh  --use-release-image SDNC
+Note that D-Release has not updated the SDNC so cherry release is used
+Note: When D-Release is released, add the 'release' arg to run released images.
 
 ONAP GUILIN
 ===========
index 8553519..dd64c42 100644 (file)
@@ -129,7 +129,7 @@ The script can be started with these arguments
 
 | arg list |
 |--|
-| `remote|remote-remove docker|kube --env-file <environment-filename> [release] [auto-clean] [--stop-at-error] [--ricsim-prefix <prefix> ] [--use-local-image <app-nam>+]  [--use-snapshot-image <app-nam>+] [--use-staging-image <app-nam>+] [--use-release-image <app-nam>+] [--image-repo <repo-address]` |
+| `remote|remote-remove docker|kube --env-file <environment-filename> [release] [auto-clean] [--stop-at-error] [--ricsim-prefix <prefix> ] [--use-local-image <app-nam>+]  [--use-snapshot-image <app-nam>+] [--use-staging-image <app-nam>+] [--use-release-image <app-nam>+] [--image-repo <repo-address] [--repo-policy local|remote] [--cluster-timeout <timeout-in seconds>]` |
 
 | parameter | description |
 |-|-|
@@ -147,6 +147,7 @@ The script can be started with these arguments
 | `--use-staging-image` | The script will use images from the nexus staging repo for the supplied apps, space separated list of app short names |
 | `--use-release-image` | The script will use images from the nexus release repo for the supplied apps, space separated list of app short names |
 | `--image-repo` |  Url to optional image repo. Only locally built images will be re-tagged and pushed to this repo |
+| `-repo-policy ` |  Policy controlling which images to re-tag and push to image repo in param --image-repo. Can be set to 'local' (push on locally built images) or 'remote' (push locally built images and images from nexus repo). Default is 'local' |
 | `--cluster-timeout` |  Optional timeout for cluster where it takes time to obtain external ip/host-name. Timeout in seconds |
 | `help` | Print this info along with the test script description and the list of app short names supported |
 
@@ -1375,6 +1376,18 @@ Only response code tested - not payload
 
 # Description of functions in http_proxy_api_functions.sh #
 
+## Function: use_http_proxy_http ##
+Use http for all proxy requests. Note that this only applicable to the actual proxy request, the proxied protocol can still be http and https.
+| arg list |
+|--|
+| None |
+
+## Function: use_http_proxy_https ##
+Use https for all proxy requests. Note that this only applicable to the actual proxy request, the proxied protocol can still be http and https.
+| arg list |
+|--|
+| None |
+
 ## Function: start_http_proxy ##
 Start the http proxy container in docker or kube depending on running mode.
 | arg list |
@@ -1383,6 +1396,18 @@ Start the http proxy container in docker or kube depending on running mode.
 
 # Description of functions in kube_proxy_api_functions.sh #
 
+## Function: use_kube_proxy_http ##
+Use http for all proxy requests. Note that this only applicable to the actual proxy request, the proxied protocol can still be http and https.
+| arg list |
+|--|
+| None |
+
+## Function: use_kube_proxy_https ##
+Use https for all proxy requests. Note that this only applicable to the actual proxy request, the proxied protocol can still be http and https.
+| arg list |
+|--|
+| None |
+
 ## Function: start_kube_proxy ##
 Start the kube proxy container in kube. This proxy enabled the test env to access all services and pods in a kube cluster.
 No proxy is started if the function is called in docker mode.
index 4ebac80..615ccab 100644 (file)
@@ -31,7 +31,11 @@ __do_curl_to_api() {
        proxyflag=""
        if [ $RUNMODE == "KUBE" ]; then
                if [ ! -z "$KUBE_PROXY_PATH" ]; then
-                       proxyflag=" --proxy $KUBE_PROXY_PATH"
+                       if [ $KUBE_PROXY_HTTPX == "http" ]; then
+                               proxyflag=" --proxy $KUBE_PROXY_PATH"
+                       else
+                               proxyflag=" --proxy-insecure --proxy $KUBE_PROXY_PATH"
+                       fi
                fi
        fi
        paramError=0
index 7bca91c..3ed3933 100644 (file)
@@ -307,7 +307,11 @@ __do_curl_to_controller() {
        proxyflag=""
        if [ $RUNMODE == "KUBE" ]; then
                if [ ! -z "$KUBE_PROXY_PATH" ]; then
-                       proxyflag=" --proxy KUBE_PROXY_PATH"
+                       if [ $KUBE_PROXY_HTTPX == "http" ]; then
+                               proxyflag=" --proxy $KUBE_PROXY_PATH"
+                       else
+                               proxyflag=" --proxy-insecure --proxy $KUBE_PROXY_PATH"
+                       fi
                fi
        fi
     curlString="curl -skw %{http_code} $proxyflag -X POST $SDNC_API_PATH$1 -H accept:application/json -H Content-Type:application/json --data-binary @$payload"
index 3e58a7e..0a7718e 100644 (file)
@@ -25,7 +25,7 @@
 # arg: <image-tag-suffix> (selects staging, snapshot, release etc)
 # <image-tag-suffix> is present only for images with staging, snapshot,release tags
 __HTTPPROXY_imagesetup() {
-       __check_and_create_image_var HTTPPROXY "HTTP_PROXY_IMAGE" "HTTP_PROXY_IMAGE_BASE" "HTTP_PROXY_IMAGE_TAG" REMOTE_PROXY "$HTTP_PROXY_DISPLAY_NAME"
+       __check_and_create_image_var HTTPPROXY "HTTP_PROXY_IMAGE" "HTTP_PROXY_IMAGE_BASE" "HTTP_PROXY_IMAGE_TAG" LOCAL "$HTTP_PROXY_DISPLAY_NAME"
 }
 
 # Pull image from remote repo or use locally built image
@@ -41,7 +41,22 @@ __HTTPPROXY_imagepull() {
 # arg: <image-tag-suffix> (selects staging, snapshot, release etc)
 # <image-tag-suffix> is present only for images with staging, snapshot,release tags
 __HTTPPROXY_imagebuild() {
-       echo -e $RED"Image for app HTTPPROXY shall never be built"$ERED
+       cd ../$HTTP_PROXY_BUILD_DIR       # Note: Reusing same impl as for kube proxy
+       echo " Building HTTPPROXY - $HTTP_PROXY_DISPLAY_NAME - image: $HTTP_PROXY_IMAGE"
+       docker build  --build-arg NEXUS_PROXY_REPO=$NEXUS_PROXY_REPO -t $HTTP_PROXY_IMAGE . &> .dockererr
+       if [ $? -eq 0 ]; then
+               echo -e  $GREEN"  Build Ok"$EGREEN
+               __retag_and_push_image HTTP_PROXY_IMAGE
+               if [ $? -ne 0 ]; then
+                       exit 1
+               fi
+       else
+               echo -e $RED"  Build Failed"$ERED
+               ((RES_CONF_FAIL++))
+               cat .dockererr
+               echo -e $RED"Exiting...."$ERED
+               exit 1
+       fi
 }
 
 # Generate a string for each included image using the app display name and a docker images format string
@@ -64,7 +79,7 @@ __HTTPPROXY_kube_scale_zero() {
 # Scale kubernetes resources to zero and wait until this has been accomplished, if relevant. If not relevant to scale, then do no action.
 # This function is called for prestarted apps not managed by the test script.
 __HTTPPROXY_kube_scale_zero_and_wait() {
-       echo -e $RED" NGW replicas kept as is"$ERED
+       echo -e $RED" HTTPPROXY replicas kept as is"$ERED
 }
 
 # Delete all kube resouces for the app
@@ -94,6 +109,30 @@ HTTP_PROXY_PATH=$HTTP_PROXY_HTTPX"://"$HTTP_PROXY_HOST_NAME":"$HTTP_PROXY_WEB_EX
 ### Http Proxy functions
 #########################
 
+# All calls to httpproxy will be directed to the http interface
+# args: -
+# (Function for test scripts)
+use_http_proxy_http() {
+       echo -e $BOLD"$HTTP_PROXY_DISPLAY_NAME protocol setting"$EBOLD
+       echo -e " Using $BOLD http $EBOLD"
+       HTTP_PROXY_HTTPX="http"
+       HTTP_PROXY_PATH=$HTTP_PROXY_HTTPX"://"$HTTP_PROXY_HOST_NAME":"$HTTP_PROXY_EXTERNAL_PORT
+
+       echo ""
+}
+
+# All calls to httpproxy will be directed to the https interface
+# args: -
+# (Function for test scripts)
+use_http_proxy_https() {
+       echo -e $BOLD"$HTTP_PROXY_DISPLAY_NAME protocol setting"$EBOLD
+       echo -e " Using $BOLD https $EBOLD"
+       HTTP_PROXY_HTTPX="https"
+       HTTP_PROXY_PATH=$HTTP_PROXY_HTTPX"://"$HTTP_PROXY_HOST_NAME":"$HTTP_PROXY_EXTERNAL_SECURE_PORT
+
+       echo ""
+}
+
 # Start the Http Proxy in the simulator group
 # args: -
 # (Function for test scripts)
@@ -132,10 +171,17 @@ start_http_proxy() {
                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 HTTP_PROXY_WEB_EXTERNAL_SECURE_PORT
+                       export HTTP_PROXY_WEB_INTERNAL_SECURE_PORT
+                       export HTTP_PROXY_EXTERNAL_SECURE_PORT
+                       export HTTP_PROXY_INTERNAL_SECURE_PORT
+
                        export KUBE_SIM_NAMESPACE
                        export HTTP_PROXY_IMAGE
 
@@ -156,13 +202,24 @@ start_http_proxy() {
                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_WEB_EXTERNAL_SECURE_PORT=$(__kube_get_service_port $HTTP_PROXY_APP_NAME $KUBE_SIM_NAMESPACE "webs")
+
                HTTP_PROXY_EXTERNAL_PORT=$(__kube_get_service_port $HTTP_PROXY_APP_NAME $KUBE_SIM_NAMESPACE "http")
+               HTTP_PROXY_EXTERNAL_SECURE_PORT=$(__kube_get_service_port $HTTP_PROXY_APP_NAME $KUBE_SIM_NAMESPACE "https")
+
+               if [ $HTTP_PROXY_HTTPX == "http" ]; then
+                       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
 
-               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"
+               else
+                       HTTP_PROXY_PATH=$HTTP_PROXY_HTTPX"://"$HTTP_PROXY_HOST_NAME":"$HTTP_PROXY_WEB_EXTERNAL_SECURE_PORT
+                       HTTP_PROXY_CONFIG_PORT=$HTTP_PROXY_EXTERNAL_SECURE_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"
+                       echo " Host IP, https port: $HTTP_PROXY_HOST_NAME $HTTP_PROXY_WEB_EXTERNAL_SECURE_PORT"
+               fi
 
                __check_service_start $HTTP_PROXY_APP_NAME $HTTP_PROXY_PATH$HTTP_PROXY_ALIVE_URL
 
@@ -176,17 +233,32 @@ start_http_proxy() {
                fi
 
                export HTTP_PROXY_APP_NAME
+               export HTTP_PROXY_EXTERNAL_PORT
+               export HTTP_PROXY_INTERNAL_PORT
+               export HTTP_PROXY_EXTERNAL_SECURE_PORT
+               export HTTP_PROXY_INTERNAL_SECURE_PORT
                export HTTP_PROXY_WEB_EXTERNAL_PORT
                export HTTP_PROXY_WEB_INTERNAL_PORT
+               export HTTP_PROXY_WEB_EXTERNAL_SECURE_PORT
+               export HTTP_PROXY_WEB_INTERNAL_SECURE_PORT
                export DOCKER_SIM_NWNAME
 
                export HTTP_PROXY_DISPLAY_NAME
 
                __start_container $HTTP_PROXY_COMPOSE_DIR "" NODOCKERARGS 1 $HTTP_PROXY_APP_NAME
 
+               if [ $HTTP_PROXY_HTTPX == "http" ]; then
+                       HTTP_PROXY_PATH=$HTTP_PROXY_HTTPX"://"$HTTP_PROXY_HOST_NAME":"$HTTP_PROXY_EXTERNAL_PORT
+               else
+                       HTTP_PROXY_PATH=$HTTP_PROXY_HTTPX"://"$HTTP_PROXY_HOST_NAME":"$HTTP_PROXY_EXTERNAL_SECURE_PORT
+               fi
         __check_service_start $HTTP_PROXY_APP_NAME $HTTP_PROXY_PATH$HTTP_PROXY_ALIVE_URL
 
-               HTTP_PROXY_CONFIG_PORT=$HTTP_PROXY_INTERNAL_PORT
+               if [ $HTTP_PROXY_HTTPX == "http" ]; then
+                       HTTP_PROXY_CONFIG_PORT=$HTTP_PROXY_INTERNAL_PORT
+               else
+                       HTTP_PROXY_CONFIG_PORT=$HTTP_PROXY_INTERNAL_SECURE_PORT
+               fi
                HTTP_PROXY_CONFIG_HOST_NAME=$HTTP_PROXY_APP_NAME
 
        fi
index c352ff1..59b6346 100644 (file)
@@ -98,8 +98,39 @@ __KUBEPROXY_store_docker_logs() {
 
 #######################################################
 
+## Access to Kube http proxy
+# Direct access
+KUBE_PROXY_HTTPX="http"
+
+
+# Set http as the protocol to use for all communication to the Kube http proxy
+# args: -
+# (Function for test scripts)
+use_kube_proxy_http() {
+       echo -e $BOLD"$KUBE_PROXY_DISPLAY_NAME protocol setting"$EBOLD
+       echo -e " Using $BOLD http $EBOLD towards Kube http proxy"
+
+       KUBE_PROXY_HTTPX="http"
+
+       echo -e $YELLOW" This setting cannot be changed once the kube proxy is started"$EYELLOW
+       echo ""
+}
+
+# Set https as the protocol to use for all communication to the Kube http proxy
+# args: -
+# (Function for test scripts)
+use_kube_proxy_https() {
+       echo -e $BOLD"$KUBE_PROXY_DISPLAY_NAME protocol setting"$EBOLD
+       echo -e " Using $BOLD https $EBOLD towards Kube http proxy"
+
+       KUBE_PROXY_HTTPX="https"
+
+       echo -e $YELLOW" This setting cannot be changed once the kube proxy is started"$EYELLOW
+       echo ""
+}
+
 #########################
-### Http Proxy functions
+### Kube Http Proxy functions
 #########################
 
 # Start the Kube Http Proxy in the simulator group
@@ -140,10 +171,17 @@ start_kube_proxy() {
                if [ $retcode_i -eq 0 ]; then
                        echo -e " Creating $KUBE_PROXY_APP_NAME deployment and service"
                        export KUBE_PROXY_APP_NAME
+
                        export KUBE_PROXY_WEB_EXTERNAL_PORT
                        export KUBE_PROXY_WEB_INTERNAL_PORT
                        export KUBE_PROXY_EXTERNAL_PORT
                        export KUBE_PROXY_INTERNAL_PORT
+
+                       export KUBE_PROXY_WEB_EXTERNAL_SECURE_PORT
+                       export KUBE_PROXY_WEB_INTERNAL_SECURE_PORT
+                       export KUBE_PROXY_EXTERNAL_SECURE_PORT
+                       export KUBE_PROXY_INTERNAL_SECURE_PORT
+
                        export KUBE_SIM_NAMESPACE
                        export KUBE_PROXY_IMAGE
 
@@ -163,8 +201,6 @@ start_kube_proxy() {
 
                echo " Retrieving host and ports for service..."
 
-               CLUSTER_KUBE_PROXY="http"
-
                #Finding host of the proxy
                echo "  Trying to find svc hostname..."
                CLUSTER_KUBE_PROXY_HOST=$(__kube_cmd_with_timeout "kubectl get svc $KUBE_PROXY_APP_NAME -n $KUBE_SIM_NAMESPACE  -o jsonpath={.status.loadBalancer.ingress[0].hostname}")
@@ -188,28 +224,33 @@ start_kube_proxy() {
                                echo -e $YELLOW" The test environment host/ip is: $CLUSTER_KUBE_PROXY_HOST."$EYELLOW
                        fi
                fi
+
+               PORT_KEY_PREFIX=""
+               if [ $KUBE_PROXY_HTTPX == "https" ]; then
+                       PORT_KEY_PREFIX="s"  #add suffix to port key name to get https ports
+               fi
                if [ -z "$CLUSTER_KUBE_PROXY_HOST" ]; then
                        #Host/ip of proxy not found, try to use the cluster and the nodeports of the proxy
                        CLUSTER_KUBE_PROXY_HOST=$(kubectl config view -o jsonpath={.clusters[0].cluster.server} | awk -F[/:] '{print $4}')
                        echo -e $YELLOW" The test environment cluster ip is: $CLUSTER_KUBE_PROXY_HOST."$EYELLOW
-                       CLUSTER_KUBE_PROXY_PORT=$(__kube_get_service_nodeport $KUBE_PROXY_APP_NAME $KUBE_SIM_NAMESPACE "http")  # port for proxy access
-                       KUBE_PROXY_WEB_NODEPORT=$(__kube_get_service_nodeport $KUBE_PROXY_APP_NAME $KUBE_SIM_NAMESPACE "web")  # web port, only for alive test
-                       echo " Cluster ip/host, cluster http nodeport, cluster web nodeport: $CLUSTER_KUBE_PROXY_HOST $CLUSTER_KUBE_PROXY_PORT $KUBE_PROXY_WEB_NODEPORT"
+                       CLUSTER_KUBE_PROXY_PORT=$(__kube_get_service_nodeport $KUBE_PROXY_APP_NAME $KUBE_SIM_NAMESPACE "http$PORT_KEY_PREFIX")  # port for proxy access
+                       KUBE_PROXY_WEB_NODEPORT=$(__kube_get_service_nodeport $KUBE_PROXY_APP_NAME $KUBE_SIM_NAMESPACE "web$PORT_KEY_PREFIX")  # web port, only for alive test
+                       echo " Cluster ip/host, cluster http$PORT_KEY_PREFIX nodeport, cluster web$PORT_KEY_PREFIX nodeport: $CLUSTER_KUBE_PROXY_HOST $CLUSTER_KUBE_PROXY_PORT $KUBE_PROXY_WEB_NODEPORT"
                else
                        #Find the service ports of the proxy
-                       CLUSTER_KUBE_PROXY_PORT=$(__kube_get_service_port $KUBE_PROXY_APP_NAME $KUBE_SIM_NAMESPACE "http")  # port for proxy access
-                       KUBE_PROXY_WEB_NODEPORT=$(__kube_get_service_port $KUBE_PROXY_APP_NAME $KUBE_SIM_NAMESPACE "web")  # web port, only for alive test
-                       echo " Proxy ip/host, proxy http port, proxy web port: $CLUSTER_KUBE_PROXY_HOST $CLUSTER_KUBE_PROXY_PORT $KUBE_PROXY_WEB_NODEPORT"
+                       CLUSTER_KUBE_PROXY_PORT=$(__kube_get_service_port $KUBE_PROXY_APP_NAME $KUBE_SIM_NAMESPACE "http$PORT_KEY_PREFIX")  # port for proxy access
+                       KUBE_PROXY_WEB_NODEPORT=$(__kube_get_service_port $KUBE_PROXY_APP_NAME $KUBE_SIM_NAMESPACE "web$PORT_KEY_PREFIX")  # web port, only for alive test
+                       echo " Proxy ip/host, proxy http$PORT_KEY_PREFIX port, proxy web$PORT_KEY_PREFIX port: $CLUSTER_KUBE_PROXY_HOST $CLUSTER_KUBE_PROXY_PORT $KUBE_PROXY_WEB_NODEPORT"
                fi
 
-               KUBE_PROXY_WEB_PATH=$CLUSTER_KUBE_PROXY"://"$CLUSTER_KUBE_PROXY_HOST":"$KUBE_PROXY_WEB_NODEPORT
+               KUBE_PROXY_WEB_PATH=$KUBE_PROXY_HTTPX"://"$CLUSTER_KUBE_PROXY_HOST":"$KUBE_PROXY_WEB_NODEPORT
 
                export KUBE_PROXY_PATH=  # Make sure proxy is empty when checking the proxy itself
                __check_service_start $KUBE_PROXY_APP_NAME $KUBE_PROXY_WEB_PATH$KUBE_PROXY_ALIVE_URL
 
                # Set proxy for all subsequent calls for all services etc
-               export KUBE_PROXY_PATH=$CLUSTER_KUBE_PROXY"://"$CLUSTER_KUBE_PROXY_HOST":"$CLUSTER_KUBE_PROXY_PORT
-
+               export KUBE_PROXY_PATH=$KUBE_PROXY_HTTPX"://"$CLUSTER_KUBE_PROXY_HOST":"$CLUSTER_KUBE_PROXY_PORT
+               export KUBE_PROXY_HTTPX
        else
                echo $YELLOW" Kube http proxy not needed in docker test. App not started"
        fi
index 744e357..8aae95a 100644 (file)
@@ -270,7 +270,11 @@ __execute_curl_to_prodstub() {
        proxyflag=""
        if [ $RUNMODE == "KUBE" ]; then
                if [ ! -z "$KUBE_PROXY_PATH" ]; then
-                       proxyflag=" --proxy $KUBE_PROXY_PATH"
+                       if [ $KUBE_PROXY_HTTPX == "http" ]; then
+                               proxyflag=" --proxy $KUBE_PROXY_PATH"
+                       else
+                               proxyflag=" --proxy-insecure --proxy $KUBE_PROXY_PATH"
+                       fi
                fi
        fi
        echo " CMD: $3 $proxyflag" >> $HTTPLOG
index a835218..0df800f 100644 (file)
@@ -351,7 +351,11 @@ __execute_curl_to_sim() {
        proxyflag=""
        if [ $RUNMODE == "KUBE" ]; then
                if [ ! -z "$KUBE_PROXY_PATH" ]; then
-                       proxyflag=" --proxy $KUBE_PROXY_PATH"
+                       if [ $KUBE_PROXY_HTTPX == "http" ]; then
+                               proxyflag=" --proxy $KUBE_PROXY_PATH"
+                       else
+                               proxyflag=" --proxy-insecure --proxy $KUBE_PROXY_PATH"
+                       fi
                fi
        fi
        echo " CMD: $2 $proxyflag" >> $HTTPLOG
index 8dd205d..59acba3 100755 (executable)
@@ -114,8 +114,8 @@ 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"
+HTTP_PROXY_IMAGE_BASE="nodejs-http-proxy"
+HTTP_PROXY_IMAGE_TAG_LOCAL="latest"
 #No local image for http proxy, remote image always used
 
 #ONAP Zookeeper remote image and tag
@@ -134,7 +134,7 @@ ONAP_DMAAPMR_IMAGE_TAG_REMOTE_RELEASE_ONAP="1.1.18"
 #No local image for ONAP DMAAP-MR, remote image always used
 
 #Kube proxy remote image and tag
-KUBE_PROXY_IMAGE_BASE="nodejs-http-proxy"
+KUBE_PROXY_IMAGE_BASE="nodejs-kube-proxy"
 KUBE_PROXY_IMAGE_TAG_LOCAL="latest"
 #No remote image for kube proxy, local image always used
 
@@ -279,22 +279,30 @@ CONTROL_PANEL_HOST_MNT_DIR="./mnt"                       # Mounted dir, relative
 
 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_EXTERNAL_PORT=8740                            # 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_EXTERNAL_SECURE_PORT=8742                     # Http Proxy container external secure port (host -> container)
+HTTP_PROXY_INTERNAL_SECURE_PORT=8433                     # Http Proxy container internal secure port (container -> container)
+HTTP_PROXY_WEB_EXTERNAL_PORT=8741                        # Http Proxy container external port (host -> container)
 HTTP_PROXY_WEB_INTERNAL_PORT=8081                        # Http Proxy container internal port (container -> container)
+HTTP_PROXY_WEB_EXTERNAL_SECURE_PORT=8743                 # Http Proxy container external secure port (host -> container)
+HTTP_PROXY_WEB_INTERNAL_SECURE_PORT=8434                 # Http Proxy container internal secure 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
-
+HTTP_PROXY_BUILD_DIR="http-https-proxy"                  # Dir in simulator_group for image build - note, reuses source from kubeproxy
 
 KUBE_PROXY_APP_NAME="kubeproxy"                          # Name of the Kube Http Proxy container
 KUBE_PROXY_DISPLAY_NAME="Kube Http Proxy"
 KUBE_PROXY_EXTERNAL_PORT=8730                            # Kube Http Proxy container external port (host -> container)
 KUBE_PROXY_INTERNAL_PORT=8080                            # Kube Http Proxy container internal port (container -> container)
+KUBE_PROXY_EXTERNAL_SECURE_PORT=8782                     # Kube Proxy container external secure port (host -> container)
+KUBE_PROXY_INTERNAL_SECURE_PORT=8433                     # Kube Proxy container internal secure port (container -> container)
 KUBE_PROXY_WEB_EXTERNAL_PORT=8731                        # Kube Http Proxy container external port (host -> container)
 KUBE_PROXY_WEB_INTERNAL_PORT=8081                        # Kube Http Proxy container internal port (container -> container)
+KUBE_PROXY_WEB_EXTERNAL_SECURE_PORT=8783                 # Kube Proxy container external secure port (host -> container)
+KUBE_PROXY_WEB_INTERNAL_SECURE_PORT=8434                 # Kube Proxy container internal secure port (container -> container
 KUBE_PROXY_PATH=""                                       # Proxy url path, will be set if proxy is started
 KUBE_PROXY_ALIVE_URL="/"                                 # Base path for alive check
 KUBE_PROXY_COMPOSE_DIR="kubeproxy"                       # Dir in simulator_group for docker-compose
index 62dfab8..8407662 100755 (executable)
@@ -137,8 +137,8 @@ PROD_STUB_IMAGE_TAG_LOCAL="latest"
 
 
 #Http proxy remote image and tag
-HTTP_PROXY_IMAGE_BASE="mitmproxy/mitmproxy"
-HTTP_PROXY_IMAGE_TAG_REMOTE_PROXY="6.0.2"
+HTTP_PROXY_IMAGE_BASE="nodejs-http-proxy"
+HTTP_PROXY_IMAGE_TAG_LOCAL="latest"
 #No local image for http proxy, remote image always used
 
 #ONAP Zookeeper remote image and tag
@@ -157,7 +157,7 @@ ONAP_DMAAPMR_IMAGE_TAG_REMOTE_RELEASE_ONAP="1.1.18"
 #No local image for ONAP DMAAP-MR, remote image always used
 
 #Kube proxy remote image and tag
-KUBE_PROXY_IMAGE_BASE="nodejs-http-proxy"
+KUBE_PROXY_IMAGE_BASE="nodejs-kube-proxy"
 KUBE_PROXY_IMAGE_TAG_LOCAL="latest"
 #No remote image for kube proxy, local image always used
 
@@ -344,22 +344,30 @@ CONTROL_PANEL_HOST_MNT_DIR="./mnt"                       # Mounted dir, relative
 
 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_EXTERNAL_PORT=8740                            # 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_EXTERNAL_SECURE_PORT=8742                     # Http Proxy container external secure port (host -> container)
+HTTP_PROXY_INTERNAL_SECURE_PORT=8433                     # Http Proxy container internal secure port (container -> container)
+HTTP_PROXY_WEB_EXTERNAL_PORT=8741                        # Http Proxy container external port (host -> container)
 HTTP_PROXY_WEB_INTERNAL_PORT=8081                        # Http Proxy container internal port (container -> container)
+HTTP_PROXY_WEB_EXTERNAL_SECURE_PORT=8743                 # Http Proxy container external secure port (host -> container)
+HTTP_PROXY_WEB_INTERNAL_SECURE_PORT=8434                 # Http Proxy container internal secure 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
-
+HTTP_PROXY_BUILD_DIR="http-https-proxy"                  # Dir in simulator_group for image build - note, reuses source from kubeproxy
 
 KUBE_PROXY_APP_NAME="kubeproxy"                          # Name of the Kube Http Proxy container
 KUBE_PROXY_DISPLAY_NAME="Kube Http Proxy"
 KUBE_PROXY_EXTERNAL_PORT=8730                            # Kube Http Proxy container external port (host -> container)
 KUBE_PROXY_INTERNAL_PORT=8080                            # Kube Http Proxy container internal port (container -> container)
+KUBE_PROXY_EXTERNAL_SECURE_PORT=8782                     # Kube Proxy container external secure port (host -> container)
+KUBE_PROXY_INTERNAL_SECURE_PORT=8433                     # Kube Proxy container internal secure port (container -> container)
 KUBE_PROXY_WEB_EXTERNAL_PORT=8731                        # Kube Http Proxy container external port (host -> container)
 KUBE_PROXY_WEB_INTERNAL_PORT=8081                        # Kube Http Proxy container internal port (container -> container)
+KUBE_PROXY_WEB_EXTERNAL_SECURE_PORT=8783                 # Kube Proxy container external secure port (host -> container)
+KUBE_PROXY_WEB_INTERNAL_SECURE_PORT=8434                 # Kube Proxy container internal secure port (container -> container
 KUBE_PROXY_PATH=""                                       # Proxy url path, will be set if proxy is started
 KUBE_PROXY_ALIVE_URL="/"                                 # Base path for alive check
 KUBE_PROXY_COMPOSE_DIR="kubeproxy"                       # Dir in simulator_group for docker-compose
index 423d3ef..ea7c3e0 100644 (file)
@@ -137,8 +137,8 @@ PROD_STUB_IMAGE_TAG_LOCAL="latest"
 
 
 #Http proxy remote image and tag
-HTTP_PROXY_IMAGE_BASE="mitmproxy/mitmproxy"
-HTTP_PROXY_IMAGE_TAG_REMOTE_PROXY="6.0.2"
+HTTP_PROXY_IMAGE_BASE="nodejs-http-proxy"
+HTTP_PROXY_IMAGE_TAG_LOCAL="latest"
 #No local image for http proxy, remote image always used
 
 #ONAP Zookeeper remote image and tag
@@ -157,7 +157,7 @@ ONAP_DMAAPMR_IMAGE_TAG_REMOTE_RELEASE_ONAP="1.1.18"
 #No local image for ONAP DMAAP-MR, remote image always used
 
 #Kube proxy remote image and tag
-KUBE_PROXY_IMAGE_BASE="nodejs-http-proxy"
+KUBE_PROXY_IMAGE_BASE="nodejs-kube-proxy"
 KUBE_PROXY_IMAGE_TAG_LOCAL="latest"
 #No remote image for kube proxy, local image always used
 
@@ -344,22 +344,30 @@ CONTROL_PANEL_HOST_MNT_DIR="./mnt"                       # Mounted dir, relative
 
 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_EXTERNAL_PORT=8740                            # 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_EXTERNAL_SECURE_PORT=8742                     # Http Proxy container external secure port (host -> container)
+HTTP_PROXY_INTERNAL_SECURE_PORT=8433                     # Http Proxy container internal secure port (container -> container)
+HTTP_PROXY_WEB_EXTERNAL_PORT=8741                        # Http Proxy container external port (host -> container)
 HTTP_PROXY_WEB_INTERNAL_PORT=8081                        # Http Proxy container internal port (container -> container)
+HTTP_PROXY_WEB_EXTERNAL_SECURE_PORT=8743                 # Http Proxy container external secure port (host -> container)
+HTTP_PROXY_WEB_INTERNAL_SECURE_PORT=8434                 # Http Proxy container internal secure 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
-
+HTTP_PROXY_BUILD_DIR="http-https-proxy"                  # Dir in simulator_group for image build - note, reuses source from kubeproxy
 
 KUBE_PROXY_APP_NAME="kubeproxy"                          # Name of the Kube Http Proxy container
 KUBE_PROXY_DISPLAY_NAME="Kube Http Proxy"
 KUBE_PROXY_EXTERNAL_PORT=8730                            # Kube Http Proxy container external port (host -> container)
 KUBE_PROXY_INTERNAL_PORT=8080                            # Kube Http Proxy container internal port (container -> container)
+KUBE_PROXY_EXTERNAL_SECURE_PORT=8782                     # Kube Proxy container external secure port (host -> container)
+KUBE_PROXY_INTERNAL_SECURE_PORT=8433                     # Kube Proxy container internal secure port (container -> container)
 KUBE_PROXY_WEB_EXTERNAL_PORT=8731                        # Kube Http Proxy container external port (host -> container)
 KUBE_PROXY_WEB_INTERNAL_PORT=8081                        # Kube Http Proxy container internal port (container -> container)
+KUBE_PROXY_WEB_EXTERNAL_SECURE_PORT=8783                 # Kube Proxy container external secure port (host -> container)
+KUBE_PROXY_WEB_INTERNAL_SECURE_PORT=8434                 # Kube Proxy container internal secure port (container -> container
 KUBE_PROXY_PATH=""                                       # Proxy url path, will be set if proxy is started
 KUBE_PROXY_ALIVE_URL="/"                                 # Base path for alive check
 KUBE_PROXY_COMPOSE_DIR="kubeproxy"                       # Dir in simulator_group for docker-compose
index f75ff1d..c82a5d3 100755 (executable)
@@ -141,9 +141,9 @@ 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
+HTTP_PROXY_IMAGE_BASE="nodejs-http-proxy"
+HTTP_PROXY_IMAGE_TAG_LOCAL="latest"
+#No local image for http proxy, remote image always used
 
 #ONAP Zookeeper remote image and tag
 ONAP_ZOOKEEPER_IMAGE_BASE="onap/dmaap/zookeeper"
@@ -161,7 +161,7 @@ ONAP_DMAAPMR_IMAGE_TAG_REMOTE_RELEASE_ONAP="1.1.18"
 #No local image for ONAP DMAAP-MR, remote image always used
 
 #Kube proxy remote image and tag
-KUBE_PROXY_IMAGE_BASE="nodejs-http-proxy"
+KUBE_PROXY_IMAGE_BASE="nodejs-kube-proxy"
 KUBE_PROXY_IMAGE_TAG_LOCAL="latest"
 #No remote image for kube proxy, local image always used
 
@@ -345,22 +345,30 @@ CONTROL_PANEL_HOST_MNT_DIR="./mnt"                       # Mounted dir, relative
 
 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_EXTERNAL_PORT=8740                            # 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_EXTERNAL_SECURE_PORT=8742                     # Http Proxy container external secure port (host -> container)
+HTTP_PROXY_INTERNAL_SECURE_PORT=8433                     # Http Proxy container internal secure port (container -> container)
+HTTP_PROXY_WEB_EXTERNAL_PORT=8741                        # Http Proxy container external port (host -> container)
 HTTP_PROXY_WEB_INTERNAL_PORT=8081                        # Http Proxy container internal port (container -> container)
+HTTP_PROXY_WEB_EXTERNAL_SECURE_PORT=8743                 # Http Proxy container external secure port (host -> container)
+HTTP_PROXY_WEB_INTERNAL_SECURE_PORT=8434                 # Http Proxy container internal secure 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
-
+HTTP_PROXY_BUILD_DIR="http-https-proxy"                  # Dir in simulator_group for image build - note, reuses source from kubeproxy
 
 KUBE_PROXY_APP_NAME="kubeproxy"                          # Name of the Kube Http Proxy container
 KUBE_PROXY_DISPLAY_NAME="Kube Http Proxy"
 KUBE_PROXY_EXTERNAL_PORT=8730                            # Kube Http Proxy container external port (host -> container)
 KUBE_PROXY_INTERNAL_PORT=8080                            # Kube Http Proxy container internal port (container -> container)
+KUBE_PROXY_EXTERNAL_SECURE_PORT=8782                     # Kube Proxy container external secure port (host -> container)
+KUBE_PROXY_INTERNAL_SECURE_PORT=8433                     # Kube Proxy container internal secure port (container -> container)
 KUBE_PROXY_WEB_EXTERNAL_PORT=8731                        # Kube Http Proxy container external port (host -> container)
 KUBE_PROXY_WEB_INTERNAL_PORT=8081                        # Kube Http Proxy container internal port (container -> container)
+KUBE_PROXY_WEB_EXTERNAL_SECURE_PORT=8783                 # Kube Proxy container external secure port (host -> container)
+KUBE_PROXY_WEB_INTERNAL_SECURE_PORT=8434                 # Kube Proxy container internal secure port (container -> container
 KUBE_PROXY_PATH=""                                       # Proxy url path, will be set if proxy is started
 KUBE_PROXY_ALIVE_URL="/"                                 # Base path for alive check
 KUBE_PROXY_COMPOSE_DIR="kubeproxy"                       # Dir in simulator_group for docker-compose
similarity index 95%
rename from test/common/test_env-oran-dawn.sh
rename to test/common/test_env-oran-d-release.sh
index f83b7b0..08925a4 100755 (executable)
@@ -17,7 +17,7 @@
 #  ============LICENSE_END=================================================
 #
 #Profile for ORAN Cherry
-TEST_ENV_PROFILE="ORAN-DAWN"
+TEST_ENV_PROFILE="ORAN-D-RELEASE"
 FLAVOUR="ORAN"
 
 ########################################
@@ -95,7 +95,7 @@ SDNC_A1_CONTROLLER_IMAGE_TAG_REMOTE_RELEASE_ONAP="2.1.2"
 #No local image for ONAP SDNC, remote release image always used
 
 # ORAN SDNC adapter kept as reference
-# SDNC A1 Controller image and tags - still using cherry version, no new version for dawn
+# SDNC A1 Controller image and tags - still using cherry version, no new version for D-Release
 #SDNC_A1_CONTROLLER_IMAGE_BASE="o-ran-sc/nonrtric-a1-controller"
 #SDNC_A1_CONTROLLER_IMAGE_TAG_LOCAL="2.0.1-SNAPSHOT"
 #SDNC_A1_CONTROLLER_IMAGE_TAG_REMOTE_SNAPSHOT="2.0.1-SNAPSHOT"
@@ -160,8 +160,8 @@ 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"
+HTTP_PROXY_IMAGE_BASE="nodejs-http-proxy"
+HTTP_PROXY_IMAGE_TAG_LOCAL="latest"
 #No local image for http proxy, remote image always used
 
 #ONAP Zookeeper remote image and tag
@@ -180,7 +180,7 @@ ONAP_DMAAPMR_IMAGE_TAG_REMOTE_RELEASE_ONAP="1.1.18"
 #No local image for ONAP DMAAP-MR, remote image always used
 
 #Kube proxy remote image and tag
-KUBE_PROXY_IMAGE_BASE="nodejs-http-proxy"
+KUBE_PROXY_IMAGE_BASE="nodejs-kube-proxy"
 KUBE_PROXY_IMAGE_TAG_LOCAL="latest"
 #No remote image for kube proxy, local image always used
 
@@ -405,21 +405,30 @@ NRT_GATEWAY_ACTUATOR="/actuator/loggers/$NRT_GATEWAY_PKG_NAME" # Url for trace/d
 
 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_EXTERNAL_PORT=8740                            # 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_EXTERNAL_SECURE_PORT=8742                     # Http Proxy container external secure port (host -> container)
+HTTP_PROXY_INTERNAL_SECURE_PORT=8433                     # Http Proxy container internal secure port (container -> container)
+HTTP_PROXY_WEB_EXTERNAL_PORT=8741                        # Http Proxy container external port (host -> container)
 HTTP_PROXY_WEB_INTERNAL_PORT=8081                        # Http Proxy container internal port (container -> container)
+HTTP_PROXY_WEB_EXTERNAL_SECURE_PORT=8743                 # Http Proxy container external secure port (host -> container)
+HTTP_PROXY_WEB_INTERNAL_SECURE_PORT=8434                 # Http Proxy container internal secure 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
+HTTP_PROXY_BUILD_DIR="http-https-proxy"                  # Dir in simulator_group for image build - note, reuses source from kubeproxy
 
 KUBE_PROXY_APP_NAME="kubeproxy"                          # Name of the Kube Http Proxy container
 KUBE_PROXY_DISPLAY_NAME="Kube Http Proxy"
 KUBE_PROXY_EXTERNAL_PORT=8730                            # Kube Http Proxy container external port (host -> container)
 KUBE_PROXY_INTERNAL_PORT=8080                            # Kube Http Proxy container internal port (container -> container)
+KUBE_PROXY_EXTERNAL_SECURE_PORT=8782                     # Kube Proxy container external secure port (host -> container)
+KUBE_PROXY_INTERNAL_SECURE_PORT=8433                     # Kube Proxy container internal secure port (container -> container)
 KUBE_PROXY_WEB_EXTERNAL_PORT=8731                        # Kube Http Proxy container external port (host -> container)
 KUBE_PROXY_WEB_INTERNAL_PORT=8081                        # Kube Http Proxy container internal port (container -> container)
+KUBE_PROXY_WEB_EXTERNAL_SECURE_PORT=8783                 # Kube Proxy container external secure port (host -> container)
+KUBE_PROXY_WEB_INTERNAL_SECURE_PORT=8434                 # Kube Proxy container internal secure port (container -> container
 KUBE_PROXY_PATH=""                                       # Proxy url path, will be set if proxy is started
 KUBE_PROXY_ALIVE_URL="/"                                 # Base path for alive check
 KUBE_PROXY_COMPOSE_DIR="kubeproxy"                       # Dir in simulator_group for docker-compose
index b4ed9b4..41135af 100755 (executable)
@@ -27,7 +27,7 @@ __print_args() {
        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>+] [--image-repo <repo-address]"
-       echo "      [--cluster-timeout <timeout-in seconds>]"
+       echo "      [--repo-policy local|remote] [--cluster-timeout <timeout-in seconds>]"
 }
 
 if [ $# -eq 1 ] && [ "$1" == "help" ]; then
@@ -53,6 +53,7 @@ if [ $# -eq 1 ] && [ "$1" == "help" ]; then
        echo "--use-staging-image   -  The script will use images from the nexus staging repo for the supplied apps, space separated list of app short names"
        echo "--use-release-image   -  The script will use images from the nexus release repo for the supplied apps, space separated list of app short names"
        echo "--image-repo          -  Url to optional image repo. Only locally built images will be re-tagged and pushed to this repo"
+       echo "--repo-policy         -  Policy controlling which images to re-tag and push if param --image-repo is set. Default is 'local'"
        echo "--cluster-timeout     -  Optional timeout for cluster where it takes time to obtain external ip/host-name. Timeout in seconds. "
        echo ""
        echo "List of app short names supported: "$APP_SHORT_NAMES
@@ -303,8 +304,9 @@ TCTEST_START=$SECONDS
 TIMER_MEASUREMENTS=".timer_measurement.txt"
 echo -e "Activity \t Duration" > $TIMER_MEASUREMENTS
 
-# If this is set, all used images will be re-tagged and pushed to this repo before any
+# If this is set, some images (control by the parameter repo-polcy) will be re-tagged and pushed to this repo before any
 IMAGE_REPO_ADR=""
+IMAGE_REPO_POLICY="local"
 CLUSTER_TIME_OUT=0
 
 echo "-------------------------------------------------------------------------------------------------"
@@ -525,6 +527,29 @@ while [ $paramerror -eq 0 ] && [ $foundparm -eq 0 ]; do
                        fi
                fi
        fi
+       if [ $paramerror -eq 0 ]; then
+               if [ "$1" == "--repo-policy" ]; then
+                       shift;
+                       IMAGE_REPO_POLICY=$1
+                       if [ -z "$1" ]; then
+                               paramerror=1
+                               if [ -z "$paramerror_str" ]; then
+                                       paramerror_str="No policy found for : '--repo-policy'"
+                               fi
+                       else
+                           if [ "$1" == "local" ] || [ "$1" == "remote" ]; then
+                                       echo "Option set - Image repo policy: "$1
+                                       shift;
+                                       foundparm=0
+                               else
+                                       paramerror=1
+                                       if [ -z "$paramerror_str" ]; then
+                                               paramerror_str="Repo policy shall be 'local' or 'remote'"
+                                       fi
+                               fi
+                       fi
+               fi
+       fi
        if [ $paramerror -eq 0 ]; then
                if [ "$1" == "--cluster-timeout" ]; then
                        shift;
@@ -735,8 +760,24 @@ __check_and_create_image_var() {
        echo -e "$tmp" >> $image_list_file
        #Export the env var
        export "${2}"=$image":"$tag  #Note, this var may be set to the value of the target value below in __check_and_pull_image
-       if [ ! -z "$IMAGE_REPO_ADR" ] && [ $5 == "LOCAL" ]; then    # Only push local images if repo is given
+
+       remote_or_local_push=false
+       if [ ! -z "$IMAGE_REPO_ADR" ] && [[ $5 != *"PROXY"* ]]; then
+               if [ $5 == "LOCAL" ]; then
+                       remote_or_local_push=true
+               fi
+               if [[ $5 == *"REMOTE"* ]]; then
+                       if [ "$IMAGE_REPO_POLICY" == "remote" ]; then
+                               remote_or_local_push=true
+                       fi
+               fi
+       fi
+       if $remote_or_local_push; then    # Only re-tag and push images according to policy, if repo is given
                export "${2}_SOURCE"=$image":"$tag  #Var to keep the actual source image
+               if [[ $optional_image_repo_target == *"/"* ]]; then # Replace all / with _ for images to push to external repo
+                       optional_image_repo_target_tmp=${optional_image_repo_target//\//_}
+                       optional_image_repo_target=$optional_image_repo_target_tmp
+               fi
                export "${2}_TARGET"=$IMAGE_REPO_ADR"/"$optional_image_repo_target":"$tag  #Create image + tag for optional image repo - pushed later if needed
        else
                export "${2}_SOURCE"=""
@@ -897,6 +938,11 @@ __retag_and_push_image() {
                source_image="${!1}"
                trg_var_name=$1_"TARGET" # This var is created in func __check_and_create_image_var
                target_image="${!trg_var_name}"
+
+               if [ -z $target_image ]; then
+                       return 0  # Image with no target shall not be pushed
+               fi
+
                echo -ne "  Attempt to re-tag image to: ${BOLD}${target_image}${EBOLD}${SAMELINE}"
                tmp=$(docker image tag $source_image ${target_image} )
                if [ $? -ne 0 ]; then
@@ -1077,8 +1123,8 @@ setup_testenvironment() {
 
 
        echo -e $BOLD"Pulling configured images, if needed"$EBOLD
-       if [ ! -z "$IMAGE_REPO_ADR" ]; then
-               echo -e $YELLOW" Excluding all remote image check/pull when running with image repo: $IMAGE_REPO_ADR"$EYELLOW
+       if [ ! -z "$IMAGE_REPO_ADR" ] && [ $IMAGE_REPO_POLICY == "local" ]; then
+               echo -e $YELLOW" Excluding all remote image check/pull when running with image repo: $IMAGE_REPO_ADR and image policy $IMAGE_REPO_POLICY"$EYELLOW
        else
                for imagename in $APP_SHORT_NAMES; do
                        __check_included_image $imagename
@@ -2325,7 +2371,11 @@ __do_curl() {
        proxyflag=""
        if [ $RUNMODE == "KUBE" ]; then
                if [ ! -z "$KUBE_PROXY_PATH" ]; then
-                       proxyflag=" --proxy $KUBE_PROXY_PATH"
+                       if [ $KUBE_PROXY_HTTPX == "http" ]; then
+                               proxyflag=" --proxy $KUBE_PROXY_PATH"
+                       else
+                               proxyflag=" --proxy-insecure --proxy $KUBE_PROXY_PATH"
+                       fi
                fi
        fi
        curlString="curl -skw %{http_code} $proxyflag $@"
index 311c2f5..e914f72 100644 (file)
@@ -27,7 +27,7 @@ PROJECT_IMAGES="PA ECS SDNC CP NGW RICSIM RC"
 AVAILABLE_IMAGES_OVERRIDE="PA ECS SDNC CP NGW RICSIM RC"
 
 # List of available apps where the image is built by the test environment
-LOCAL_IMAGE_BUILD="MR CR PRODSTUB KUBEPROXY"
+LOCAL_IMAGE_BUILD="MR CR PRODSTUB KUBEPROXY HTTPPROXY"
 
 
 #Integrate a new app into the test environment
index 271db4d..ca58dce 100644 (file)
@@ -23,10 +23,10 @@ The dir cert contains a self-signed cert. Use the script generate_cert_and_key.s
 
 | Operation | curl example |
 | --------- | ------------ |
-| proxy http call via http | curl --proxy localhost:8080 http://pms:1234 |
-| proxy https call via http | curl --proxy localhost:8080 https://pms:5678 |
-| proxy http call via https | curl --proxy-insecure localhost:8433 http://pms:1234 |
-| proxy https call via https |  curl --proxy-insecure localhost:8433 https://pms:5678 |
+| proxy http call via http | curl --proxy http://localhost:8080 http://100.110.120.130:1234 |
+| proxy https call via http | curl -k --proxy http//localhost:8080 https://100.110.120.130:5678 |
+| proxy http call via https | curl --proxy-insecure --proxy https://localhost:8433 http://100.110.120.130:1234 |
+| proxy https call via https | curl --proxy-insecure --proxy https://localhost:8433 https://100.110.120.130:5678 |
 | alive check and get stats | curl localhost:8081 |
 | alive check and get stats via proxy |  curl --proxy localhost:8080 http://localhost:8081 |
 
index 085e17f..7ff1968 100755 (executable)
@@ -32,6 +32,7 @@ if [ $? -eq 0 ]; then
     echo "CMD OK"
 else
     echo "CMD FAIL"
+    exti 1
 fi
 echo ""
 
@@ -43,10 +44,11 @@ if [ $? -eq 0 ]; then
     echo "CMD OK"
 else
     echo "CMD FAIL"
+    exti 1
 fi
 echo ""
 
-CMD="curl --proxy-insecure localhost:8433 localhost:8081"
+CMD="curl --proxy-insecure --proxy https://localhost:8433 localhost:8081"
 echo "Running cmd: "$CMD
 $CMD
 echo ""
@@ -54,10 +56,11 @@ if [ $? -eq 0 ]; then
     echo "CMD OK"
 else
     echo "CMD FAIL"
+    exti 1
 fi
 echo ""
 
-CMD="curl --proxy-insecure localhost:8433 -k https://localhost:8434"
+CMD="curl --proxy-insecure --proxy https://localhost:8433 -k https://localhost:8434"
 echo "Running cmd: "$CMD
 $CMD
 echo ""
@@ -65,6 +68,7 @@ if [ $? -eq 0 ]; then
     echo "CMD OK"
 else
     echo "CMD FAIL"
+    exti 1
 fi
 echo ""
 
index 714548a..4a98285 100644 (file)
@@ -105,51 +105,9 @@ function httpclientrequest(clientrequest, clientresponse) {
   });
 }
 
-function main() {
-
-  // -------------------- Alive server ----------------------------------
-  // Responde with '200' and statistics for any path on the alive address
-  const alivelistener = function (req, res) {
-    console.log(stats)
-    res.writeHead(200, { 'Content-Type': 'application/json' });
-    res.write(JSON.stringify(stats))
-    res.end();
-  };
-
-  // The alive server - for healthckeck
-  const aliveserver = http.createServer(alivelistener);
-
-  // The alive server - for healthckeck
-  const aliveserverhttps = https.createServer(httpsoptions, alivelistener);
-
-  //Handle heatlhcheck requests
-  aliveserver.listen(aliveport, () => {
-    console.log('alive server on: '+aliveport);
-    console.log(' example: curl localhost: '+aliveport)
-  });
-
-  //Handle heatlhcheck requests
-  aliveserverhttps.listen(aliveporthttps, () => {
-    console.log('alive server on: '+aliveporthttps);
-    console.log(' example: curl -k https://localhost: '+aliveporthttps)
-  });
-
-  // -------------------- Proxy server ---------------------------------
-
-  // The proxy server
-  const proxyserver  = http.createServer(httpclientrequest).listen(proxyport);
-  console.log('http/https proxy for http proxy calls on port ' + proxyport);
-  console.log(' example: curl --proxy localhost:8080 http://pms:1234')
-  console.log(' example: curl -k --proxy localhost:8080 https://pms:5678')
-
-  const proxyserverhttps = https.createServer(httpsoptions, httpclientrequest).listen(proxyporthttps);
-  console.log('http/https proxy for https proxy calls on port ' + proxyporthttps);
-  console.log(' example: curl --proxy-insecure localhost:8433 http://pms:1234')
-  console.log(' example: curl --proxy-insecure localhost:8433 https://pms:5678')
-  console.log(' note: proxy shall not specify https')
-
-  // handle a http proxy request - https listener
-  proxyserver.addListener(
+// Function to add a 'connect' message listener to a http server
+function addhttpsconnect(httpserver) {
+  httpserver.addListener(
     'connect',
     function (request, socketrequest, bodyhead) {
 
@@ -205,6 +163,56 @@ function main() {
   );
 }
 
+function main() {
+
+  // -------------------- Alive server ----------------------------------
+  // Responde with '200' and statistics for any path on the alive address
+  const alivelistener = function (req, res) {
+    console.log(stats)
+    res.writeHead(200, { 'Content-Type': 'application/json' });
+    res.write(JSON.stringify(stats))
+    res.end();
+  };
+
+  // The alive server - for healthckeck
+  const aliveserver = http.createServer(alivelistener);
+
+  // The alive server - for healthckeck
+  const aliveserverhttps = https.createServer(httpsoptions, alivelistener);
+
+  //Handle heatlhcheck requests
+  aliveserver.listen(aliveport, () => {
+    console.log('alive server on: '+aliveport);
+    console.log(' example: curl localhost:'+aliveport)
+  });
+
+  //Handle heatlhcheck requests
+  aliveserverhttps.listen(aliveporthttps, () => {
+    console.log('alive server on: '+aliveporthttps);
+    console.log(' example: curl -k https://localhost:'+aliveporthttps)
+  });
+
+  // -------------------- Proxy server ---------------------------------
+
+  // The proxy server
+  const proxyserver  = http.createServer(httpclientrequest).listen(proxyport);
+  console.log('http/https proxy for http proxy calls on port ' + proxyport);
+  console.log(' example: curl --proxy http://localhost:8080 http://100.110.120.130:1234')
+  console.log(' example: curl -k --proxy http//localhost:8080 https://100.110.120.130:5678')
+
+  // handle a http proxy request - https listener
+  addhttpsconnect(proxyserver);
+
+  const proxyserverhttps = https.createServer(httpsoptions, httpclientrequest).listen(proxyporthttps);
+  console.log('http/https proxy for https proxy calls on port ' + proxyporthttps);
+  console.log(' example: curl --proxy-insecure --proxy https://localhost:8433 http://100.110.120.130:1234')
+  console.log(' example: curl --proxy-insecure --proxy https://localhost:8433 https://100.110.120.130:5678')
+
+  // handle a https proxy request - https listener
+  addhttpsconnect(proxyserverhttps);
+
+}
+
 //Handle ctrl c when running in interactive mode
 process.on('SIGINT', () => {
   console.info("Interrupted")
index 266eb19..138da71 100644 (file)
@@ -26,5 +26,7 @@ spec:
           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
+        - name: https
+          containerPort: $HTTP_PROXY_INTERNAL_SECURE_PORT
+        - name: webs
+          containerPort: $HTTP_PROXY_WEB_INTERNAL_SECURE_PORT
\ No newline at end of file
index ff4243b..c27ba5e 100644 (file)
@@ -26,10 +26,11 @@ services:
       - default
     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:
+      - ${HTTP_PROXY_EXTERNAL_PORT}:${HTTP_PROXY_INTERNAL_PORT}
+      - ${HTTP_PROXY_EXTERNAL_SECURE_PORT}:${HTTP_PROXY_INTERNAL_SECURE_PORT}
       - ${HTTP_PROXY_WEB_EXTERNAL_PORT}:${HTTP_PROXY_WEB_INTERNAL_PORT}
+      - ${HTTP_PROXY_WEB_EXTERNAL_SECURE_PORT}:${HTTP_PROXY_WEB_INTERNAL_SECURE_PORT}
     labels:
       - "nrttest_app=HTTPPROXY"
       - "nrttest_dp=${HTTP_PROXY_DISPLAY_NAME}"
index 1e3c009..eb8007c 100644 (file)
@@ -17,5 +17,13 @@ spec:
     targetPort: $HTTP_PROXY_WEB_INTERNAL_PORT
     protocol: TCP
     name: web
+  - port: $HTTP_PROXY_EXTERNAL_SECURE_PORT
+    targetPort: $HTTP_PROXY_INTERNAL_SECURE_PORT
+    protocol: TCP
+    name: https
+  - port: $HTTP_PROXY_WEB_EXTERNAL_SECURE_PORT
+    targetPort: $HTTP_PROXY_WEB_INTERNAL_SECURE_PORT
+    protocol: TCP
+    name: webs
   selector:
     run: $HTTP_PROXY_APP_NAME
index b9f6115..cc2fdb3 100644 (file)
@@ -26,3 +26,7 @@ spec:
           containerPort: $KUBE_PROXY_INTERNAL_PORT
         - name: web
           containerPort: $KUBE_PROXY_WEB_INTERNAL_PORT
+        - name: https
+          containerPort: $KUBE_PROXY_INTERNAL_SECURE_PORT
+        - name: webs
+          containerPort: $KUBE_PROXY_WEB_INTERNAL_SECURE_PORT
\ No newline at end of file
index 51cf745..c92c069 100644 (file)
@@ -19,5 +19,15 @@ spec:
     protocol: TCP
     name: web
     nodePort:
+  - port: $KUBE_PROXY_EXTERNAL_SECURE_PORT
+    targetPort: $KUBE_PROXY_INTERNAL_SECURE_PORT
+    protocol: TCP
+    name: https
+    nodePort:
+  - port: $KUBE_PROXY_WEB_EXTERNAL_SECURE_PORT
+    targetPort: $KUBE_PROXY_WEB_INTERNAL_SECURE_PORT
+    protocol: TCP
+    name: webs
+    nodePort:
   selector:
     run: $KUBE_PROXY_APP_NAME