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"
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"
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=""
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"
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"
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"
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"
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"
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"
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"
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"
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"
. ../common/control_panel_api_functions.sh
. ../common/controller_api_functions.sh
. ../common/kube_proxy_api_functions.sh
+. ../common/gateway_api_functions.sh
setup_testenvironment
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"
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"
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++))
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
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
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++))
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"
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"
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"
# ============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
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"
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"
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"
./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
===========
| 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 |
|-|-|
| `--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 |
# 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 |
# 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.
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
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"
# 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
# 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
# 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
### 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)
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
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
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
#######################################################
+## 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
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
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}")
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
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
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
#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
#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
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
#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
#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
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
#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
#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
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
#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"
#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
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
# ============LICENSE_END=================================================
#
#Profile for ORAN Cherry
-TEST_ENV_PROFILE="ORAN-DAWN"
+TEST_ENV_PROFILE="ORAN-D-RELEASE"
FLAVOUR="ORAN"
########################################
#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"
#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
#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
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
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
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
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 "-------------------------------------------------------------------------------------------------"
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;
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"=""
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
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
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 $@"
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
| 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 |
echo "CMD OK"
else
echo "CMD FAIL"
+ exti 1
fi
echo ""
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 ""
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 ""
echo "CMD OK"
else
echo "CMD FAIL"
+ exti 1
fi
echo ""
});
}
-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) {
);
}
+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")
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
- 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}"
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
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
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