Test env updates
[nonrtric.git] / test / common / ricsimulator_api_functions.sh
index c82be76..0df800f 100644 (file)
@@ -34,13 +34,17 @@ __RICSIM_imagesetup() {
 # <pull-policy-original> Shall be used for images that does not allow overriding
 # Both var may contain: 'remote', 'remote-remove' or 'local'
 __RICSIM_imagepull() {
-       __check_and_pull_image $1 "$RIC_SIM_DISPLAY_NAME" $RIC_SIM_PREFIX"_"$RIC_SIM_BASE $RIC_SIM_IMAGE
+       __check_and_pull_image $1 "$RIC_SIM_DISPLAY_NAME" $RIC_SIM_PREFIX"_"$RIC_SIM_BASE RIC_SIM_IMAGE
 }
 
 # Generate a string for each included image using the app display name and a docker images format string
+# If a custom image repo is used then also the source image from the local repo is listed
 # arg: <docker-images-format-string> <file-to-append>
 __RICSIM_image_data() {
        echo -e "$RIC_SIM_DISPLAY_NAME\t$(docker images --format $1 $RIC_SIM_IMAGE)" >>   $2
+       if [ ! -z "$RIC_SIM_IMAGE_SOURCE" ]; then
+               echo -e "-- source image --\t$(docker images --format $1 $RIC_SIM_IMAGE_SOURCE)" >>   $2
+       fi
 }
 
 # Scale kubernetes resources to zero
@@ -310,7 +314,7 @@ __find_sim_port() {
 __find_sim_host() {
        if [ $RUNMODE == "KUBE" ]; then
                ricname=$(echo "$1" | tr '_' '-')
-               for timeout in {1..60}; do
+               for timeout in {1..500}; do   # long waiting time needed in case of starting large number of sims
                        host=$(kubectl get pod $ricname  -n $KUBE_NONRTRIC_NAMESPACE -o jsonpath='{.status.podIP}' 2> /dev/null)
                        if [ ! -z "$host" ]; then
                                echo $RIC_SIM_HTTPX"://"$host":"$RIC_SIM_PORT
@@ -346,8 +350,12 @@ __execute_curl_to_sim() {
        echo ${FUNCNAME[1]} "line: "${BASH_LINENO[1]} >> $HTTPLOG
        proxyflag=""
        if [ $RUNMODE == "KUBE" ]; then
-               if [ ! -z "$CLUSTER_KUBE_PROXY_NODEPORT" ]; then
-                       proxyflag=" --proxy http://localhost:$CLUSTER_KUBE_PROXY_NODEPORT"
+               if [ ! -z "$KUBE_PROXY_PATH" ]; then
+                       if [ $KUBE_PROXY_HTTPX == "http" ]; then
+                               proxyflag=" --proxy $KUBE_PROXY_PATH"
+                       else
+                               proxyflag=" --proxy-insecure --proxy $KUBE_PROXY_PATH"
+                       fi
                fi
        fi
        echo " CMD: $2 $proxyflag" >> $HTTPLOG
@@ -471,7 +479,7 @@ sim_post_delete_instances() {
 # (Function for test scripts)
 sim_post_delete_all() {
        __log_conf_start $@
-       if [ $# -ne 3 ]; then
+       if [ $# -ne 2 ]; then
                __print_err "<response-code> <numericic-id>" $@
                return 1
        fi