Update test scripts to support a1-interface with https

Issue-ID: NONRTRIC-218
Signed-off-by: ecaiyanlinux <martin.c.yan@est.tech>
Change-Id: I7f8c6eaf1deccadbdfe0a80cab7a06d4f3e18b3a
diff --git a/test/common/testcase_common.sh b/test/common/testcase_common.sh
index 28c65d2..57344fb 100755
--- a/test/common/testcase_common.sh
+++ b/test/common/testcase_common.sh
@@ -63,7 +63,7 @@
 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 @@
 # (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 @@
 	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 @@
 	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 ""
 }