Doc update with j-release links (master branch)
[nonrtric.git] / test / common / testcase_common.sh
index 5eb6ab8..336bd8f 100755 (executable)
@@ -137,10 +137,10 @@ STOP_AT_ERROR=0
 # 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
+#Var to indicate docker-compose version, V1 or V2. V1 is not supported. 
 #V1 names replicated containers <proj-name>_<service-name>_<index>
 #V2 names replicated containers <proj-name>-<service-name>-<index>
-DOCKER_COMPOSE_VERSION="V1"
+DOCKER_COMPOSE_VERSION="V2"
 
 # Name of target platform, if set by start cmd
 IMAGE_TARGET_PLATFORM=""
@@ -1196,13 +1196,16 @@ echo  "  $(docker version --format 'Client version {{.Client.Version}} Server ve
 if [ $RUNMODE == "DOCKER" ]; then
        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
+               echo -e $RED"docker-compose (v.2+) is required to run the test environment, pls install"$ERED
                exit 1
        else
-               tmp=$(docker-compose version)
+               tmp=$(docker-compose -v)
                echo " docker-compose installed and using version $tmp"
                if [[ "$tmp" == *'v2'* ]]; then
                        DOCKER_COMPOSE_VERSION="V2"
+               else
+                       echo -e $RED"docker-compose version $tmp is not supported. Only version v2 is supported, pls install"$ERED
+                       exit 1
                fi
        fi
 fi
@@ -2860,15 +2863,15 @@ clean_environment() {
        if [ $RUNMODE == "KUBE" ]; then
                __clean_kube
                if [ $PRE_CLEAN -eq 1 ]; then
-                       echo " Cleaning docker resouces to free up resources, may take time..."
-                       ../common/clean_docker.sh 2>&1 > /dev/null
+                       echo " Cleaning kubernetes resources to free up resources, may take time..."
+                       ../common/clean_kube.sh $KUBECONF 2>&1 > /dev/null
                        echo ""
                fi
        else
                __clean_containers
                if [ $PRE_CLEAN -eq 1 ]; then
-                       echo " Cleaning kubernetes resouces to free up resources, may take time..."
-                       ../common/clean_kube.sh $KUBECONF 2>&1 > /dev/null
+                       echo " Cleaning docker resources to free up resources, may take time..."
+                       ../common/clean_docker.sh 2>&1 > /dev/null
                        echo ""
                fi
        fi
@@ -2972,11 +2975,7 @@ __start_container() {
 
        envsubst < $compose_file > "gen_"$compose_file
        compose_file="gen_"$compose_file
-       if [ $DOCKER_COMPOSE_VERSION == "V1" ]; then
-               docker_compose_cmd="docker-compose"
-       else
-               docker_compose_cmd="docker compose"
-       fi
+       docker_compose_cmd="docker compose"
 
        if [ "$compose_args" == "NODOCKERARGS" ]; then
                $docker_compose_cmd -f $compose_file up -d &> .dockererr
@@ -3056,7 +3055,7 @@ __check_service_start() {
                                #If response is too long, truncate
                                result="...response text too long, omitted"
                        fi
-                       echo -ne " Waiting for {ENTITY} $BOLD${appname}$EBOLD service status on ${3}, result: $result${SAMELINE}"
+                       echo -ne " Waiting for ${ENTITY} $BOLD${appname}$EBOLD service status on ${url}, result: $result${SAMELINE}"
                        echo -ne " The ${ENTITY} $BOLD${appname}$EBOLD$GREEN is alive$EGREEN, responds to service status:$GREEN $result $EGREEN on ${url} after $(($SECONDS-$TSTART)) seconds"
                        a1pmsst=true
                        break