+START_ARG=$1
+paramerror=0
+if [ $# -lt 1 ]; then
+ paramerror=1
+fi
+if [ $paramerror -eq 0 ]; then
+ if [ "$1" != "remote" ] && [ "$1" != "remote-remove" ] && [ "$1" != "local" ]; then
+ paramerror=1
+ else
+ shift;
+ fi
+fi
+foundparm=0
+while [ $paramerror -eq 0 ] && [ $foundparm -eq 0 ]; do
+ foundparm=1
+ if [ $paramerror -eq 0 ]; then
+ if [ "$1" == "auto-clean" ]; then
+ AUTO_CLEAN="auto"
+ echo "Option set - Auto clean at end of test script"
+ shift;
+ foundparm=0
+ fi
+ fi
+ if [ $paramerror -eq 0 ]; then
+ if [ "$1" == "--stop-at-error" ]; then
+ STOP_AT_ERROR=1
+ echo "Option set - Stop at first error"
+ shift;
+ foundparm=0
+ fi
+ fi
+ if [ $paramerror -eq 0 ]; then
+ if [ "$1" == "--ricsim-prefix" ]; then
+ shift;
+ RIC_SIM_PREFIX=$1
+ if [ -z "$1" ]; then
+ paramerror=1
+ else
+ echo "Option set - Overriding RIC_SIM_PREFIX with: "$1
+ shift;
+ foundparm=0
+ fi
+ fi
+ fi
+ if [ $paramerror -eq 0 ]; then
+ if [ "$1" == "--env-file" ]; then
+ shift;
+ TEST_ENV_VAR_FILE=$1
+ if [ -z "$1" ]; then
+ paramerror=1
+ else
+ echo "Option set - Reading test env from: "$1
+ shift;
+ foundparm=0
+ fi
+ fi
+ fi
+ if [ $paramerror -eq 0 ]; then
+ if [ "$1" == "--use-local-image" ]; then
+ USE_LOCAL_IMAGES=""
+ shift
+ while [ $# -gt 0 ] && [[ "$1" != "--"* ]]; do
+ USE_LOCAL_IMAGES=$USE_LOCAL_IMAGES" "$1
+ if [[ "$AVAILABLE_LOCAL_IMAGES_OVERRIDE" != *"$1"* ]]; then
+ paramerror=1
+ fi
+ shift;
+ done
+ foundparm=0
+ if [ -z "$USE_LOCAL_IMAGES" ]; then
+ paramerror=1
+ else
+ echo "Option set - Override remote images for app(s):"$USE_LOCAL_IMAGES
+ fi
+ fi
+ fi
+done
+echo ""
+
+#Still params left?
+if [ $paramerror -eq 0 ] && [ $# -gt 0 ]; then
+ paramerror=1
+fi
+
+if [ $paramerror -eq 1 ]; then
+ echo -e $RED"Expected arg: local|remote|remote-remove [auto-clean] [--stop-at-error] [--ricsim-prefix <prefix> ] [ --env-file <environment-filename> ] [--use-local-image <app-nam> [<app-name>]*]"$ERED
+ exit 1
+fi
+
+# sourcing the selected env variables for the test case
+if [ -f "$TEST_ENV_VAR_FILE" ]; then
+ echo -e $BOLD"Sourcing env vars from: "$TEST_ENV_VAR_FILE$EBOLD
+ . $TEST_ENV_VAR_FILE
+
+ if [ -z "$TEST_ENV_PROFILE" ] || [ -z "$SUPPORTED_PROFILES" ]; then
+ echo -e $YELLOW"This test case may no work with selected test env file. TEST_ENV_PROFILE is missing in test_env file or SUPPORTED_PROFILES is missing in test case file"$EYELLOW
+ else
+ if [[ "$SUPPORTED_PROFILES" == *"$TEST_ENV_PROFILE"* ]]; then
+ echo -e $GREEN"Test case support the selected test env file"$EGREEN
+ else
+ echo -e $RED"Test case does not support the selected test env file"$ERED
+ echo -e $RED"Exiting...."$ERED
+ exit 1
+ fi
+ fi
+else
+ echo -e $RED"Selected env var file does not exist: "$TEST_ENV_VAR_FILE$ERED
+ echo " Select one of following env var file matching the intended target of the test"
+ echo " Restart the test using the flag '--env-file <path-to-env-file>"
+ ls ../common/test_env* | indent1
+ exit 1
+fi
+
+#Vars for A1 interface version and container count
+G1_A1_VERSION=""
+G2_A1_VERSION=""
+G3_A1_VERSION=""
+G4_A1_VERSION=""
+G5_A1_VERSION=""
+G1_COUNT=0
+G2_COUNT=0
+G3_COUNT=0
+G4_COUNT=0
+G5_COUNT=0
+
+# Vars to switch between http and https. Extra curl flag needed for https
+export RIC_SIM_HTTPX="http"
+export RIC_SIM_LOCALHOST=$RIC_SIM_HTTPX"://localhost:"
+export RIC_SIM_PORT=$RIC_SIM_INTERNAL_PORT
+export RIC_SIM_CERT_MOUNT_DIR="./cert"
+
+export MR_HTTPX="http"
+export MR_PORT=$MR_INTERNAL_PORT
+export MR_LOCAL_PORT=$MR_EXTERNAL_PORT #When agent is running outside the docker net
+
+export CR_HTTPX="http"
+export CR_PORT=$CR_INTERNAL_PORT
+export CR_LOCAL_PORT=$CR_EXTERNAL_PORT #When CR is running outside the docker net
+export CR_PATH="$CR_HTTPX://$CR_APP_NAME:$CR_PORT$CR_APP_CALLBACK"
+
+export PROD_STUB_HTTPX="http"
+export PROD_STUB_PORT=$PROD_STUB_INTERNAL_PORT
+export PROD_STUB_LOCAL_PORT=$PROD_STUB_EXTERNAL_PORT #When Prodstub is running outside the docker net
+export PROD_STUB_LOCALHOST=$PROD_STUB_HTTPX"://localhost:"$PROD_STUB_LOCAL_PORT
+
+export SDNC_HTTPX="http"
+export SDNC_PORT=$SDNC_INTERNAL_PORT
+export SDNC_LOCAL_PORT=$SDNC_EXTERNAL_PORT #When agent is running outside the docker net
+
+export RAPP_CAT_HTTPX="http"
+export RAPP_CAT_PORT=$RAPP_CAT_INTERNAL_PORT
+export RAPP_CAT_LOCAL_PORT=$RAPP_CAT_EXTERNAL_PORT #When Rapp catalogue is running outside the docker net
+