X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Fcommon%2Ftestcase_common.sh;h=3f5970ca3f26c35c5a4035fdf8da25b050f5a868;hb=a6696f0efafd7341924258c937cdcafddff97772;hp=83889f1f6d88049788fa37e146b2228f4d09fec0;hpb=d54225bda3988891296f86807168fc204f88676e;p=nonrtric.git diff --git a/test/common/testcase_common.sh b/test/common/testcase_common.sh index 83889f1f..3f5970ca 100755 --- a/test/common/testcase_common.sh +++ b/test/common/testcase_common.sh @@ -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 __ #V2 names replicated containers -- -DOCKER_COMPOSE_VERSION="V1" +DOCKER_COMPOSE_VERSION="V2" # Name of target platform, if set by start cmd IMAGE_TARGET_PLATFORM="" @@ -1175,6 +1175,16 @@ if [ $? -ne 0 ] || [ -z "$tmp" ]; then fi echo " python3 is installed and using version: $(python3 --version)" +tmp=$(type jq) +if [ $? -ne 0 ]; then + echo -e $RED"command utility jq (cmd-line json processor) is not installed"$ERED + exit 1 +fi +tmp=$(type envsubst) +if [ $? -ne 0 ]; then + echo -e $RED"command utility envsubst (env var substitution in files) is not installed"$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 @@ -1186,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 @@ -1261,7 +1274,6 @@ echo -e "Application\tApp short name\tImage\ttag\ttag-switch" > $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: __check_and_create_image_var() { - echo $@ if [ $# -ne 7 ]; then echo "Expected arg: " ((IMAGE_ERR++)) @@ -2963,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