+ # Create a table of the images used in the script - from local repo
+ echo -e $BOLD"Local docker registry images used in this test script"$EBOLD
+
+ docker_tmp_file=./tmp/.docker-images-table
+ format_string="{{.Repository}}\\t{{.Tag}}\\t{{.CreatedSince}}\\t{{.Size}}\\t{{.CreatedAt}}"
+ echo -e "Application\tRepository\tTag\tCreated since\tSize\tCreated at" > $docker_tmp_file
+
+ for imagename in $APP_SHORT_NAMES; do
+ __check_included_image $imagename
+ if [ $? -eq 0 ]; then
+ # Only print image data if image repo is null, or if image repo is set and image is local
+ print_image_data=0
+ if [ -z "$IMAGE_REPO_ADR" ]; then
+ print_image_data=1
+ else
+ __check_image_local_build $imagename
+ if [ $? -eq 0 ]; then
+ print_image_data=1
+ fi
+ fi
+ if [ $print_image_data -eq 1 ]; then
+ # A function name is created from the app short name
+ # for example app short name 'MR' -> produce the function
+ # name __MR_imagebuild
+ # This function is called and is expected to exist in the imported
+ # file for the mr test functions
+ # The resulting function impl shall build the imagee
+ function_pointer="__"$imagename"_image_data"
+ $function_pointer "$format_string" $docker_tmp_file
+ fi
+ fi
+ done
+
+ column -t -s $'\t' $docker_tmp_file | indent1
+
+ echo ""
+
+ if [ ! -z "$IMAGE_REPO_ADR" ]; then
+
+ # Create a table of the images used in the script - from remote repo
+ echo -e $BOLD"Remote repo images used in this test script"$EBOLD
+ echo -e $YELLOW"-- Note: These image will be pulled when the container starts. Images not managed by the test engine --"$EYELLOW
+
+ docker_tmp_file=./tmp/.docker-images-table
+ format_string="{{.Repository}}\\t{{.Tag}}"
+ echo -e "Application\tRepository\tTag" > $docker_tmp_file
+
+ for imagename in $APP_SHORT_NAMES; do
+ __check_included_image $imagename
+ if [ $? -eq 0 ]; then
+ # Only print image data if image repo is null, or if image repo is set and image is local
+ __check_image_local_build $imagename
+ if [ $? -ne 0 ]; then
+ # A function name is created from the app short name
+ # for example app short name 'MR' -> produce the function
+ # name __MR_imagebuild
+ # This function is called and is expected to exist in the imported
+ # file for the mr test functions
+ # The resulting function impl shall build the imagee
+ function_pointer="__"$imagename"_image_data"
+ $function_pointer "$format_string" $docker_tmp_file
+ fi
+ fi
+ done
+
+ column -t -s $'\t' $docker_tmp_file | indent1
+
+ echo ""
+ fi
+
+ if [ $RUNMODE == "KUBE" ]; then
+
+ echo "================================================================================="
+ echo "================================================================================="
+
+ if [ -z "$IMAGE_REPO_ADR" ]; then
+ echo -e $YELLOW" The image pull policy is set to 'Never' - assuming a local image repo is available for all images"$EYELLOW
+ echo -e " This setting only works on single node clusters on the local machine"
+ echo -e " It does not work with multi-node clusters or remote clusters. "
+ export KUBE_IMAGE_PULL_POLICY="Never"
+ else
+ echo -e $YELLOW" The image pull policy is set to 'Always'"$EYELLOW
+ echo -e " This setting work on local clusters, multi-node clusters and remote cluster. "
+ echo -e " Only locally built images are managed. Remote images are always pulled from remote repos"
+ echo -e " Pulling remote snapshot or staging images my in some case result in pulling newer image versions outside the control of the test engine"
+ export KUBE_IMAGE_PULL_POLICY="Always"
+ fi
+ CLUSTER_IP=$(kubectl config view -o jsonpath={.clusters[0].cluster.server} | awk -F[/:] '{print $4}')
+ echo -e $YELLOW" The cluster hostname/ip is: $CLUSTER_IP"$EYELLOW
+
+ echo "================================================================================="
+ echo "================================================================================="
+ echo ""
+ fi
+
+ echo -e $BOLD"======================================================="$EBOLD
+ echo -e $BOLD"== Common test setup completed - test script begins =="$EBOLD
+ echo -e $BOLD"======================================================="$EBOLD
+ echo ""
+
+}
+
+# Function to print the test result, shall be the last cmd in a test script
+# args: -
+# (Function for test scripts)
+print_result() {
+
+ TCTEST_END=$SECONDS
+ duration=$((TCTEST_END-TCTEST_START))
+
+ echo "-------------------------------------------------------------------------------------------------"