X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Fcommon%2Ftestcase_common.sh;h=57344fb25cf6ba97f2b2cad62012f39a7955d88c;hb=99a769b52cf20bca4803320df819af0133330baa;hp=28c65d2681733ab1245eedf1c225325a2da56a74;hpb=70e878f1b5a558baaaa5ab5885a039ed96c9f8d5;p=nonrtric.git diff --git a/test/common/testcase_common.sh b/test/common/testcase_common.sh index 28c65d26..57344fb2 100755 --- a/test/common/testcase_common.sh +++ b/test/common/testcase_common.sh @@ -63,7 +63,7 @@ G3_COUNT=0 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="./fakedir" #Fake dir so that the sim container does not find any cert +export RIC_SIM_CERT_MOUNT_DIR="./cert" export MR_HTTPX="http" export MR_PORT=$MR_INTERNAL_PORT @@ -715,10 +715,8 @@ __print_err() { # (Not for test scripts) __find_sim_port() { name=$1" " #Space appended to prevent matching 10 if 1 is desired.... - cmdstr="docker ps --filter name=${name} --format \"{{.Names}} {{.Ports}}\" | grep '${name}' | sed s/0.0.0.0:// | cut -f 2 -d ' ' | cut -f 1 -d '-'" - cmdstr="docker ps --filter name=${name} --format \"{{.Names}} {{.Ports}}\" | grep '${name}' | cut -f 3 -d ',' | sed s/0.0.0.0:// | cut -f 2 -d ' ' | cut -f 1 -d '-'" - - res=$(eval $cmdstr) + cmdstr="docker inspect --format='{{(index (index .NetworkSettings.Ports \"$RIC_SIM_PORT/tcp\") 0).HostPort}}' ${name}" + res=$(eval $cmdstr) if [[ "$res" =~ ^[0-9]+$ ]]; then echo $res else @@ -1079,7 +1077,6 @@ use_simulator_http() { 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="./fakedir" #Fake dir so that the sim container does not find any cert echo "" } @@ -1088,7 +1085,6 @@ use_simulator_https() { export RIC_SIM_HTTPX="https" export RIC_SIM_LOCALHOST=$RIC_SIM_HTTPX"://localhost:" export RIC_SIM_PORT=$RIC_SIM_INTERNAL_SECURE_PORT - export RIC_SIM_CERT_MOUNT_DIR="./cert" echo "" }