X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Fcommon%2Ftestcase_common.sh;h=78f27fd2662d8ada23188d7d5d2cf334906a5b54;hb=8fbc63697f2edaaf2c9db40f54b318e7211361e2;hp=f2783f39501f1a0221f9494b424263f4cd64f3a6;hpb=de4d0f86a327469fb64645c2bcd3aeea7832ad25;p=nonrtric.git diff --git a/test/common/testcase_common.sh b/test/common/testcase_common.sh index f2783f39..78f27fd2 100755 --- a/test/common/testcase_common.sh +++ b/test/common/testcase_common.sh @@ -17,10 +17,65 @@ # ============LICENSE_END================================================= # -# This is a script that contains all the functions needed for auto test -# Arg: local|remote|remote-remove [auto-clean] [--stop-at-error] [--ricsim-prefix ] [ --env-file ] [--use-local-image []*] +# This is a script that contains all the common functions needed for auto test. +# Specific test function are defined in scripts XXXX_functions.sh +. ../common/api_curl.sh +. ../common/testengine_config.sh +__print_args() { + echo "Args: remote|remote-remove docker|kube --env-file [release] [auto-clean] [--stop-at-error] " + echo " [--ricsim-prefix ] [--use-local-image +] [--use-snapshot-image +]" + echo " [--use-staging-image +] [--use-release-image +] [--image-repo ]" + echo " [--repo-policy local|remote] [--cluster-timeout ] [--print-stats]" + echo " [--override ] [--pre-clean] [--gen-stats] [--delete-namespaces]" + echo " [--delete-containers] [--endpoint-stats] [--kubeconfig ] [--host-path-dir ]" + echo " [--kubecontext ] [--docker-host ] [--docker-proxy ]" +} + +if [ $# -eq 1 ] && [ "$1" == "help" ]; then + + if [ ! -z "$TC_ONELINE_DESCR" ]; then + echo "Test script description:" + echo $TC_ONELINE_DESCR + echo "" + fi + __print_args + echo "" + echo "remote - Use images from remote repositories. Can be overridden for individual images using the '--use_xxx' flags" + echo "remote-remove - Same as 'remote' but will also try to pull fresh images from remote repositories" + echo "docker - Test executed in docker environment" + echo "kube - Test executed in kubernetes environment - requires an already started kubernetes environment" + echo "--env-file - The script will use the supplied file to read environment variables from" + echo "release - If this flag is given the script will use release version of the images" + echo "auto-clean - If the function 'auto_clean_containers' is present in the end of the test script then all containers will be stopped and removed. If 'auto-clean' is not given then the function has no effect." + echo "--stop-at-error - The script will stop when the first failed test or configuration" + echo "--ricsim-prefix - The a1 simulator will use the supplied string as container prefix instead of 'ricsim'" + echo "--use-local-image - The script will use local images for the supplied apps, space separated list of app short names" + echo "--use-snapshot-image - The script will use images from the nexus snapshot repo for the supplied apps, space separated list of app short names" + 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 "--print-stats - Print current test stats after each test." + echo "--override - Override setting from the file supplied by --env-file" + echo "--pre-clean - Will clean kube resouces when running docker and vice versa" + echo "--gen-stats - Collect container/pod runtime statistics" + echo "--delete-namespaces - Delete kubernetes namespaces before starting tests - but only those created by the test scripts. Kube mode only. Ignored if running with prestarted apps." + echo "--delete-containers - Delete docker containers before starting tests - but only those created by the test scripts. Docker mode only." + echo "--endpoint-stats - Collect endpoint statistics" + echo "--kubeconfig - Configure kubectl to use cluster specific cluster config file" + echo "--host-path-dir - (Base-)path on local-hostmounted to all VMs (nodes), for hostpath volumes in kube" + echo "--kubecontext - Configure kubectl to use a certain context, e.g 'minikube'" + echo "--docker-host - Configure docker to use docker in e.g. a VM" + echo "--docker-proxy - Configure ip/host to docker when docker is running in a VM" + echo "" + echo "List of app short names supported: "$APP_SHORT_NAMES + exit 0 +fi + +AUTOTEST_HOME=$PWD # Create a test case id, ATC (Auto Test Case), from the name of the test case script. # FTC1.sh -> ATC == FTC1 ATC=$(basename "${BASH_SOURCE[$i+1]}" .sh) @@ -40,55 +95,48 @@ YELLOW="\033[33m\033[1m" EYELLOW="\033[0m" SAMELINE="\033[0K\r" -tmp=$(which python3) -if [ $? -ne 0 ] || [ -z tmp ]; then - echo -e $RED"python3 is required to run the test environment, pls install"$ERED - exit 1 -fi -tmp=$(which docker) -if [ $? -ne 0 ] || [ -z tmp ]; then - echo -e $RED"docker is required to run the test environment, pls install"$ERED - exit 1 -fi - -tmp=$(which docker-compose) -if [ $? -ne 0 ] || [ -z tmp ]; then - echo -e $RED"docker-compose is required to run the test environment, pls install"$ERED - exit 1 -fi - # Just resetting any previous echo formatting... echo -ne $EBOLD # default test environment variables TEST_ENV_VAR_FILE="" +#Override env file, will be added on top of the above file +TEST_ENV_VAR_FILE_OVERRIDE="" echo "Test case started as: ${BASH_SOURCE[$i+1]} "$@ -#Localhost constant -LOCALHOST="http://localhost:" +# Var to hold 'auto' in case containers shall be stopped when test case ends +AUTO_CLEAN="" -# Make curl retries towards ECS for http response codes set in this env var, space separated list of codes -ECS_RETRY_CODES="" +# Var to indicate pre clean, if flag --pre-clean is set the script will clean kube resouces when running docker and vice versa +PRE_CLEAN="0" -# Make curl retries towards the agent for http response codes set in this env var, space separated list of codes -AGENT_RETRY_CODES="" +# Var to hold the app names to use local images for +USE_LOCAL_IMAGES="" -# Var to contol if the agent runs in a container (normal = 0) or as application on the local machine ( = 1) -AGENT_STAND_ALONE=0 +# Var to hold the app names to use remote snapshot images for +USE_SNAPSHOT_IMAGES="" -# Var to hold 'auto' in case containers shall be stopped when test case ends -AUTO_CLEAN="" +# Var to hold the app names to use remote staging images for +USE_STAGING_IMAGES="" -# Var to hold the app names to use local image for when running 'remote' or 'remote-remove' -USE_LOCAL_IMAGES="" +# Var to hold the app names to use remote release images for +USE_RELEASE_IMAGES="" -# List of available apps to override with local image -AVAILABLE_LOCAL_IMAGES_OVERRIDE="PA ECS CP SDNC RICSIM RC" # Use this var (STOP_AT_ERROR=1 in the test script) for debugging/trouble shooting to take all logs and exit at first FAIL test case STOP_AT_ERROR=0 +# The default value "DEV" indicate that development image tags (SNAPSHOT) and nexus repos (nexus port 10002) are used. +# The value "RELEASE" indicate that relase image tag and nexus repos (nexus port) are used +# Applies only to images defined in the test-env files with image names and tags defined as XXXX_RELEASE +IMAGE_CATEGORY="DEV" + +#Var to indicate docker-compose version, V1 or V2 +#V1 names replicated containers __ +#V2 names replicated containers -- +DOCKER_COMPOSE_VERION="V1" + # Function to indent cmd output with one space indent1() { sed 's/^/ /'; } @@ -116,15 +164,60 @@ TESTLOGS=$PWD/logs # Create the tmp dir for temporary files that is not needed after the test # hidden files for the test env is still stored in the current dir +# files in the ./tmp is moved to ./tmp/prev when a new test is started if [ ! -d "tmp" ]; then mkdir tmp + if [ $? -ne 0 ]; then + echo "Cannot create dir for temp files, $PWD/tmp" + echo "Exiting...." + exit 1 + fi +fi +curdir=$PWD +cd tmp +if [ $? -ne 0 ]; then + echo "Cannot cd to $PWD/tmp" + echo "Exiting...." + exit 1 +fi + +TESTENV_TEMP_FILES=$PWD + +if [ ! -d "prev" ]; then + mkdir prev + if [ $? -ne 0 ]; then + echo "Cannot create dir for previous temp files, $PWD/prev" + echo "Exiting...." + exit 1 + fi +fi + +TMPFILES=$(ls -A | grep -vw prev) +if [ ! -z "$TMPFILES" ]; then + cp -r $TMPFILES prev #Move all temp files to prev dir + if [ $? -ne 0 ]; then + echo "Cannot move temp files in $PWD to previous temp files in, $PWD/prev" + echo "Exiting...." + exit 1 + fi + if [ $(pwd | xargs basename) == "tmp" ]; then #Check that current dir is tmp...for safety + + rm -rf $TMPFILES # Remove all temp files + fi fi +cd $curdir +if [ $? -ne 0 ]; then + echo "Cannot cd to $curdir" + echo "Exiting...." + exit 1 +fi + + # Create a http message log for this testcase HTTPLOG=$PWD"/.httplog_"$ATC".txt" echo "" > $HTTPLOG - # Create a log dir for the test case mkdir -p $TESTLOGS/$ATC @@ -144,6 +237,9 @@ rm $TESTLOGS/$ATC/*.log &> /dev/null rm $TESTLOGS/$ATC/*.txt &> /dev/null rm $TESTLOGS/$ATC/*.json &> /dev/null +#Create result file in the log dir +echo "1" > "$TESTLOGS/$ATC/.result$ATC.txt" + # Log all output from the test case to a TC log TCLOG=$TESTLOGS/$ATC/TC.log exec &> >(tee ${TCLOG}) @@ -155,24 +251,68 @@ RES_FAIL=0 RES_CONF_FAIL=0 RES_DEVIATION=0 +#Var to control if current stats shall be printed +PRINT_CURRENT_STATS=0 + +#Var to control if container/pod runtim statistics shall be collected +COLLECT_RUNTIME_STATS=0 +COLLECT_RUNTIME_STATS_PID=0 + +#Var to control if endpoint statistics shall be collected +COLLECT_ENDPOINT_STATS=0 + +#Var to control if namespaces shall be delete before test setup +DELETE_KUBE_NAMESPACES=0 + +#Var to control if containers shall be delete before test setup +DELETE_CONTAINERS=0 + +#Var to configure kubectl from a config file or context +KUBECONF="" + +#Localhost, may be set to another host/ip by cmd parameter +LOCALHOST_NAME="localhost" + +#Reseting vars related to token/keys used by kubeproxy when istio is enabled +#The vars are populated if istio is used in the testcase +KUBE_PROXY_CURL_JWT="" +KUBE_PROXY_ISTIO_JWKS_KEYS="" + +#Var pointing to dir mounted to each kubernetes node (master and workers) +#Persistent volumes using "hostpath" are allocated beneath the point. +#Typically it is a dir on local host mounted to each VM running the master and worker. +#So the intention is make this dir available so the PODs can be restarted on any +#node and still access the persistent data +#If not set from cmd line, the path is defaults to "/tmp" +HOST_PATH_BASE_DIR="" + #File to keep deviation messages DEVIATION_FILE=".tmp_deviations" rm $DEVIATION_FILE &> /dev/null - # Trap "command not found" and make the script fail trap_fnc() { if [ $? -eq 127 ]; then echo -e $RED"Function not found, setting script to FAIL"$ERED ((RES_CONF_FAIL++)) + __print_current_stats fi } trap trap_fnc ERR +# Trap to kill subprocess for stats collection (if running) +trap_fnc2() { + if [ $COLLECT_RUNTIME_STATS_PID -ne 0 ]; then + kill $COLLECT_RUNTIME_STATS_PID + fi +} +trap trap_fnc2 EXIT + # Counter for tests TEST_SEQUENCE_NR=1 +# Function to log the start of a test case __log_test_start() { TIMESTAMP=$(date "+%Y-%m-%d %H:%M:%S") echo -e $BOLD"TEST $TEST_SEQUENCE_NR (${BASH_LINENO[1]}): ${FUNCNAME[1]}" $@ $EBOLD @@ -181,40 +321,59 @@ __log_test_start() { ((TEST_SEQUENCE_NR++)) } +# Function to print current statistics +__print_current_stats() { + if [ $PRINT_CURRENT_STATS -ne 0 ]; then + echo " Current stats - exe-time, tests, passes, fails, conf fails, deviations: $(($SECONDS-$TCTEST_START)), $RES_TEST, $RES_PASS, $RES_FAIL, $RES_CONF_FAIL, $RES_DEVIATION" + fi +} + +# General function to log a failed test case __log_test_fail_general() { echo -e $RED" FAIL."$1 $ERED ((RES_FAIL++)) + __print_current_stats __check_stop_at_error } +# Function to log a test case failed due to incorrect response code __log_test_fail_status_code() { echo -e $RED" FAIL. Exepected status "$1", got "$2 $3 $ERED ((RES_FAIL++)) + __print_current_stats __check_stop_at_error } +# Function to log a test case failed due to incorrect response body __log_test_fail_body() { echo -e $RED" FAIL, returned body not correct"$ERED ((RES_FAIL++)) + __print_current_stats __check_stop_at_error } +# Function to log a test case that is not supported __log_test_fail_not_supported() { echo -e $RED" FAIL, function not supported"$ERED ((RES_FAIL++)) + __print_current_stats __check_stop_at_error } +# General function to log a passed test case __log_test_pass() { if [ $# -gt 0 ]; then echo $@ fi ((RES_PASS++)) echo -e $GREEN" PASS"$EGREEN + __print_current_stats } #Counter for configurations CONF_SEQUENCE_NR=1 + +# Function to log the start of a configuration setup __log_conf_start() { TIMESTAMP=$(date "+%Y-%m-%d %H:%M:%S") echo -e $BOLD"CONF $CONF_SEQUENCE_NR (${BASH_LINENO[1]}): "${FUNCNAME[1]} $@ $EBOLD @@ -222,38 +381,103 @@ __log_conf_start() { ((CONF_SEQUENCE_NR++)) } +# Function to log a failed configuration setup __log_conf_fail_general() { echo -e $RED" FAIL."$1 $ERED ((RES_CONF_FAIL++)) + __print_current_stats __check_stop_at_error } +# Function to log a failed configuration setup due to incorrect response code __log_conf_fail_status_code() { echo -e $RED" FAIL. Exepected status "$1", got "$2 $3 $ERED ((RES_CONF_FAIL++)) + __print_current_stats __check_stop_at_error } +# Function to log a failed configuration setup due to incorrect response body __log_conf_fail_body() { echo -e $RED" FAIL, returned body not correct"$ERED ((RES_CONF_FAIL++)) + __print_current_stats + __check_stop_at_error +} + +# Function to log a configuration that is not supported +__log_conf_fail_not_supported() { + echo -e $RED" FAIL, function not supported"$ERED$@ + ((RES_CONF_FAIL++)) + __print_current_stats __check_stop_at_error } +# Function to log a passed configuration setup __log_conf_ok() { if [ $# -gt 0 ]; then echo $@ fi echo -e $GREEN" OK"$EGREEN + __print_current_stats +} + +# Function to collect stats on endpoints +# args: [] +__collect_endpoint_stats() { + if [ $COLLECT_ENDPOINT_STATS -eq 0 ]; then + return + fi + ENDPOINT_COUNT=1 + if [ $# -gt 5 ]; then + ENDPOINT_COUNT=$6 + fi + ENDPOINT_STAT_FILE=$TESTLOGS/$ATC/endpoint_$ATC_$1_$2".log" + ENDPOINT_POS=0 + ENDPOINT_NEG=0 + if [ -f $ENDPOINT_STAT_FILE ]; then + ENDPOINT_VAL=$(< $ENDPOINT_STAT_FILE) + ENDPOINT_POS=$(echo $ENDPOINT_VAL | cut -f4 -d ' ' | cut -f1 -d '/') + ENDPOINT_NEG=$(echo $ENDPOINT_VAL | cut -f5 -d ' ' | cut -f1 -d '/') + fi + + if [ $5 -ge 200 ] && [ $5 -lt 300 ]; then + let ENDPOINT_POS=ENDPOINT_POS+$ENDPOINT_COUNT + else + let ENDPOINT_NEG=ENDPOINT_NEG+$ENDPOINT_COUNT + fi + + printf '%-2s %-10s %-45s %-16s %-16s' "#" "$3" "$4" "$ENDPOINT_POS/$ENDPOINT_POS" "$ENDPOINT_NEG/$ENDPOINT_NEG" > $ENDPOINT_STAT_FILE +} + +# Function to collect stats on endpoints +# args: +__collect_endpoint_stats_image_info() { + if [ $COLLECT_ENDPOINT_STATS -eq 0 ]; then + return + fi + ENDPOINT_STAT_FILE=$TESTLOGS/$ATC/imageinfo_$ATC_$1".log" + echo $A1PMS_IMAGE > $ENDPOINT_STAT_FILE } #Var for measuring execution time TCTEST_START=$SECONDS +#Vars to hold the start time and timer text for a custom timer +TC_TIMER_STARTTIME="" +TC_TIMER_TIMER_TEXT="" +TC_TIMER_CURRENT_FAILS="" # Then numer of failed test when timer starts. + # Compared with the current number of fails at timer stop + # to judge the measurement reliability + #File to save timer measurement results TIMER_MEASUREMENTS=".timer_measurement.txt" -echo -e "Activity \t Duration" > $TIMER_MEASUREMENTS +echo -e "Activity \t Duration \t Info" > $TIMER_MEASUREMENTS +# If this is set, some images (controlled by the parameter repo-policy) will be re-tagged and pushed to this repo before any +IMAGE_REPO_ADR="" +IMAGE_REPO_POLICY="local" +CLUSTER_TIME_OUT=0 echo "-------------------------------------------------------------------------------------------------" echo "----------------------------------- Test case: "$ATC @@ -263,21 +487,52 @@ echo "-- Description: "$TC_ONELINE_DESCR echo "-------------------------------------------------------------------------------------------------" echo "----------------------------------- Test case setup -----------------------------------" +echo "Setting AUTOTEST_HOME="$AUTOTEST_HOME START_ARG=$1 paramerror=0 +paramerror_str="" if [ $# -lt 1 ]; then paramerror=1 fi if [ $paramerror -eq 0 ]; then - if [ "$1" != "remote" ] && [ "$1" != "remote-remove" ] && [ "$1" != "local" ]; then + if [ "$1" != "remote" ] && [ "$1" != "remote-remove" ]; then + paramerror=1 + if [ -z "$paramerror_str" ]; then + paramerror_str="First arg shall be 'remote' or 'remote-remove'" + fi + else + shift; + fi +fi +if [ $paramerror -eq 0 ]; then + if [ "$1" != "docker" ] && [ "$1" != "kube" ]; then paramerror=1 + if [ -z "$paramerror_str" ]; then + paramerror_str="Second arg shall be 'docker' or 'kube'" + fi else + if [ $1 == "docker" ]; then + RUNMODE="DOCKER" + echo "Setting RUNMODE=DOCKER" + fi + if [ $1 == "kube" ]; then + RUNMODE="KUBE" + echo "Setting RUNMODE=KUBE" + fi shift; fi fi foundparm=0 while [ $paramerror -eq 0 ] && [ $foundparm -eq 0 ]; do foundparm=1 + if [ $paramerror -eq 0 ]; then + if [ "$1" == "release" ]; then + IMAGE_CATEGORY="RELEASE" + echo "Option set - Release image tags used for applicable images " + shift; + foundparm=0 + fi + fi if [ $paramerror -eq 0 ]; then if [ "$1" == "auto-clean" ]; then AUTO_CLEAN="auto" @@ -297,9 +552,12 @@ while [ $paramerror -eq 0 ] && [ $foundparm -eq 0 ]; do if [ $paramerror -eq 0 ]; then if [ "$1" == "--ricsim-prefix" ]; then shift; - RIC_SIM_PREFIX=$1 + TMP_RIC_SIM_PREFIX=$1 #RIC_SIM_PREFIX need to be updated after sourcing of the env file if [ -z "$1" ]; then paramerror=1 + if [ -z "$paramerror_str" ]; then + paramerror_str="No prefix found for flag: '--ricsim-prefix'" + fi else echo "Option set - Overriding RIC_SIM_PREFIX with: "$1 shift; @@ -313,6 +571,9 @@ while [ $paramerror -eq 0 ] && [ $foundparm -eq 0 ]; do TEST_ENV_VAR_FILE=$1 if [ -z "$1" ]; then paramerror=1 + if [ -z "$paramerror_str" ]; then + paramerror_str="No env file found for flag: '--env-file'" + fi else echo "Option set - Reading test env from: "$1 shift; @@ -326,599 +587,1291 @@ while [ $paramerror -eq 0 ] && [ $foundparm -eq 0 ]; do shift while [ $# -gt 0 ] && [[ "$1" != "--"* ]]; do USE_LOCAL_IMAGES=$USE_LOCAL_IMAGES" "$1 - if [[ "$AVAILABLE_LOCAL_IMAGES_OVERRIDE" != *"$1"* ]]; then + if [[ "$AVAILABLE_IMAGES_OVERRIDE" != *"$1"* ]]; then paramerror=1 + if [ -z "$paramerror_str" ]; then + paramerror_str="App name $1 is not available for local override for flag: '--use-local-image'" + fi fi shift; done foundparm=0 if [ -z "$USE_LOCAL_IMAGES" ]; then paramerror=1 + if [ -z "$paramerror_str" ]; then + paramerror_str="No app name found for flag: '--use-local-image'" + fi else - echo "Option set - Override remote images for app(s):"$USE_LOCAL_IMAGES + echo "Option set - Overriding with local 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 ] [ --env-file ] [--use-local-image []*]"$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 + if [ $paramerror -eq 0 ]; then + if [ "$1" == "--use-snapshot-image" ]; then + USE_SNAPSHOT_IMAGES="" + shift + while [ $# -gt 0 ] && [[ "$1" != "--"* ]]; do + USE_SNAPSHOT_IMAGES=$USE_SNAPSHOT_IMAGES" "$1 + if [[ "$AVAILABLE_IMAGES_OVERRIDE" != *"$1"* ]]; then + paramerror=1 + if [ -z "$paramerror_str" ]; then + paramerror_str="App name $1 is not available for snapshot override for flag: '--use-snapshot-image'" + fi + fi + shift; + done + foundparm=0 + if [ -z "$USE_SNAPSHOT_IMAGES" ]; then + paramerror=1 + if [ -z "$paramerror_str" ]; then + paramerror_str="No app name found for flag: '--use-snapshot-image'" + fi + else + echo "Option set - Overriding with snapshot images for app(s):"$USE_SNAPSHOT_IMAGES + fi 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 " - 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 - -echo -e $BOLD"Checking configured image setting for this test case"$EBOLD - -#Temp var to check for image variable name errors -IMAGE_ERR=0 -#Create a file with image info for later printing as a table -image_list_file="./tmp/.image-list" -echo -e " Container\tImage\ttag" > $image_list_file - -# Check if image env var is set and if so export the env var with image to use (used by docker compose files) -# arg: