3 . ../common/test_env.sh
7 echo "Test case started as: ${BASH_SOURCE[$i+1]} "$1 $2
9 # Script containing all functions needed for auto testing of test cases
10 # Arg: local [<image-tag>] ]| remote [<image-tag>] ]| remote-remove [<image-tag>]] | manual-container | manual-app
12 STARTED_DFCS="" #DFC app names added to this var to keep track of started container in the script
17 if [[ "$2" =~ ^1.1.* ]]; then
18 echo "This version of auto-test does not support DFC image version of 1.1.X"
24 if [ $# -lt 1 ] || [ $# -gt 2 ]; then
25 echo "Expected arg: local [<image-tag>] ]| remote [<image-tag>] ]| remote-remove [<image-tag>]] | manual-container | manual-app"
27 elif [ $1 == "local" ]; then
28 if [ -z $DFC_LOCAL_IMAGE ]; then
29 echo "DFC_LOCAL_IMAGE not set in test_env"
32 DFC_IMAGE=$DFC_LOCAL_IMAGE":"$IMAGE_TAG
33 elif [ $1 == "remote" ] || [ $1 == "remote-remove" ]; then
34 if [ -z $DFC_REMOTE_IMAGE ]; then
35 echo "DFC_REMOTE_IMAGE not set in test_env"
38 DFC_IMAGE=$DFC_REMOTE_IMAGE":"$IMAGE_TAG
39 elif [ $1 == "manual-container" ] && [ $# -eq 1 ]; then
40 echo "DFC is expected to be started manually, when prompted, as a container with name 'dfc_app'<index> with and index in the range from 0 to '${DFC_MAX_IDX}'"
41 elif [ $1 == "manual-app" ] && [ $# -eq 1 ]; then
42 echo "DFC is expected to be started manually, when prompted, as a java application"
44 echo "Expected arg: local [<image-tag>] ]| remote [<image-tag>] ]| remote-remove [<image-tag>]] | manual-container | manual-app"
48 # Set a description string for the test case
49 if [ -z "$TC_ONELINE_DESCR" ]; then
50 TC_ONELINE_DESCR="<no-description>"
51 echo "No test case description found, TC_ONELINE_DESCR should be set on in the test script , using "$TC_ONELINE_DESCR
54 # Counter for test suites
55 if [ -f .tmp_tcsuite_ctr ]; then
56 tmpval=$(< .tmp_tcsuite_ctr)
58 echo $tmpval > .tmp_tcsuite_ctr
61 # Create a test case id, ATC (Auto Test Case), from the name of the test case script.
62 # FTC1.sh -> ATC == FTC1
63 ATC=$(basename "${BASH_SOURCE[$i+1]}" .sh)
65 # Create the logs dir if not already created in the current dir
66 if [ ! -d "logs" ]; then
72 # Create a log dir for the test case
73 mkdir -p $TESTLOGS/$ATC
75 # Clear the log dir for the test case
76 rm $TESTLOGS/$ATC/*.log &> /dev/null
78 # Log all output from the test case to a TC log
79 TCLOG=$TESTLOGS/$ATC/TC.log
80 exec &> >(tee ${TCLOG})
82 #Variables for counting tests as well as passed and failed tests
88 echo "-------------------------------------------------------------------------------------------------"
89 echo "----------------------------------- Test case: "$ATC
90 echo "----------------------------------- Started: "$(date)
91 echo "-------------------------------------------------------------------------------------------------"
92 echo "-- Description: "$TC_ONELINE_DESCR
93 echo "-------------------------------------------------------------------------------------------------"
94 echo "----------------------------------- Test case setup -----------------------------------"
96 if [ -z "$SIM_GROUP" ]; then
97 SIM_GROUP=$PWD/../simulator-group
98 if [ ! -d $SIM_GROUP ]; then
99 echo "Trying to set env var SIM_GROUP to dir 'simulator-group' in the integration repo, but failed."
100 echo "Please set the SIM_GROUP manually in the test_env.sh"
103 echo "SIM_GROUP auto set to: " $SIM_GROUP
105 elif [ $SIM_GROUP = *simulator_group ]; then
106 echo "Env var SIM_GROUP does not seem to point to dir 'simulator-group' in the integration repo, check test_env.sh"
112 if [ $1 != "manual-container" ] && [ $1 != "manual-app" ]; then
113 echo -e "DFC image tag set to: \033[1m" $IMAGE_TAG"\033[0m"
114 echo "Configured image for DFC app(s) (${1}): "$DFC_IMAGE
115 tmp_im=$(docker images ${DFC_IMAGE} | grep -v REPOSITORY)
117 if [ $1 == "local" ]; then
118 if [ -z "$tmp_im" ]; then
119 echo "Local image (non nexus) "$DFC_IMAGE" does not exist in local registry, need to be built"
122 echo -e "DFC local image: \033[1m"$tmp_im"\033[0m"
123 echo "If the DFC image seem outdated, rebuild the image and run the test again."
125 elif [ $1 == "remote" ] || [ $1 == "remote-remove" ]; then
127 if [ $1 == "remote-remove" ]; then
128 echo "Attempt to stop dfc_app container(s) if running"
129 docker stop $(docker ps -q --filter name=${DFC_APP_BASE}]) &> /dev/null
130 docker rm $(docker ps -q --filter name=${DFC_APP_BASE}) &> /dev/null
131 docker rmi $DFC_IMAGE &> /dev/null
134 if [ -z "$tmp_im" ]; then
135 echo "Pulling DFC image from nexus: "$DFC_IMAGE
136 docker pull $DFC_IMAGE > /dev/null
137 tmp_im=$(docker images ${DFC_IMAGE} | grep -v REPOSITORY)
138 if [ -z "$tmp_im" ]; then
139 echo "Image could not be pulled"
142 echo -e "DFC image: \033[1m"$tmp_im"\033[0m"
144 echo -e "DFC image: \033[1m"$tmp_im"\033[0m"
145 echo "!! If the dfc image seem outdated, consider removing it from your docker registry and run the test again. Or run the script with 'remote-remove'"
154 echo "Building images for the simulators if needed, MR, DR, DR Redir and FTPS simulators"
158 docker build -t drsim_common:latest . &> /dev/null
160 docker build -t mrsim:latest . &> /dev/null
161 cd ../ftps-sftp-server
162 docker build -t ftps_vsftpd:latest -f Dockerfile-ftps . &> /dev/null
167 echo "Local registry images for simulators:"
168 echo "MR simulator " $(docker images | grep mrsim)
169 echo "DR simulator: " $(docker images | grep drsim_common)
170 echo "DR redir simulator: " $(docker images | grep drsim_common)
171 echo "SFTP: " $(docker images | grep atmoz/sftp)
172 echo "FTPS: " $(docker images | grep ftps_vsftpd)
173 echo "Consul: " $(docker images | grep consul)
174 echo "CBS: " $(docker images | grep platform.configbinding.app)
177 #Configure MR sim to use correct host:port for running dfc as an app or as a container
178 #Configure DR sim with correct address for DR redirect simulator
179 if [ $START_ARG == "manual-app" ]; then
180 export SFTP_SIMS=$SFTP_SIMS_LOCALHOST
181 export FTPS_SIMS=$FTPS_SIMS_LOCALHOST
182 export DR_REDIR_SIM="localhost"
185 # export SFTP_SIMS=$SFTP_SIMS_CONTAINER
186 # export FTPS_SIMS=$FTPS_SIMS_CONTAINER
187 # export DR_REDIR_SIM="drsim_redir"
190 echo "----------------------------------- Test case steps -----------------------------------"
192 # Print error info for the call in the parent script (test case). Arg: <error-message-to-print>
193 # Not to be called from test script.
195 echo ${FUNCNAME[1]} " "$1" " ${BASH_SOURCE[$i+2]} " line" ${BASH_LINENO[$i+1]}
197 # Execute curl using the host and variable. Arg: <host and variable-name> [ <flag-to-strip-new-line> ]
198 #<flag-to-strip-new-line> may contain any string, it is just a flag
199 # Returns the variable value (if success) and return code 0 or an error message and return code 1
201 res=$(curl -skw "%{http_code}" $1)
202 http_code="${res:${#res}-3}"
203 if [ ${#res} -eq 3 ]; then
204 echo "<no-response-from-server>"
207 if [ $http_code -lt 200 ] && [ $http_code -gt 299]; then
208 echo "<not found, resp:${http_code}>"
211 if [ $# -eq 2 ]; then
212 echo "${res:0:${#res}-3}" | xargs
214 echo "${res:0:${#res}-3}"
221 # Test a simulator variable value towards target value using an condition operator with an optional timeout.
222 # Arg: <simulator-name> <host> <variable-name> <condition-operator> <target-value> - This test is done
223 # immediately and sets pass or fail depending on the result of comparing variable and target using the operator.
224 # Arg: <simulator-name> <host> <variable-name> <condition-operator> <target-value> <timeout> - This test waits up to the timeout
225 # before setting pass or fail depending on the result of comparing variable and target using the operator.
226 # Not to be called from test script.
229 if [ $# -eq 6 ]; then
230 echo -e "---- ${1} sim test criteria: \033[1m ${3} \033[0m ${4} ${5} within ${6} seconds ----"
236 result="$(__do_curl $2$3)"
238 result=${result//[[:blank:]]/} #Strip blanks
239 duration=$((SECONDS-start))
240 if [ $((ctr%30)) -eq 0 ]; then
241 echo " Result=${result} after ${duration} seconds"
242 for (( i=0; i<=$DFC_MAX_IDX; i++ )); do
243 if [[ $STARTED_DFCS =~ "_"$DFC_APP_BASE$i"_" ]]; then
244 echo " HB ${DFC_APP_BASE}${i}: $(__do_curl http://127.0.0.1:$(($DFC_PORT+$i))/status strip)"
248 echo -ne " Result=${result} after ${duration} seconds\033[0K\r"
251 if [ $retcode -ne 0 ]; then
252 if [ $duration -gt $6 ]; then
254 echo -e "---- \033[31m\033[1mFAIL\033[0m - Target ${3} ${4} ${5} not reached in ${6} seconds, result = ${result} ----"
257 elif [ $4 = "=" ] && [ "$result" -eq $5 ]; then
259 echo -e " Result=${result} after ${duration} seconds\033[0K\r"
260 echo -e "---- \033[32m\033[1mPASS\033[0m - Test criteria met in ${duration} seconds ----"
262 elif [ $4 = ">" ] && [ "$result" -gt $5 ]; then
264 echo -e " Result=${result} after ${duration} seconds\033[0K\r"
265 echo -e "---- \033[32m\033[1mPASS\033[0m - Test criteria met in ${duration} seconds, result = ${result} ----"
267 elif [ $4 = "<" ] && [ "$result" -lt $5 ]; then
269 echo -e " Result=${result} after ${duration} seconds\033[0K\r"
270 echo -e "---- \033[32m\033[1mPASS\033[0m - Test criteria met in ${duration} seconds, result = ${result} ----"
272 elif [ $4 = "contain_str" ] && [[ $result =~ $5 ]]; then
274 echo -e " Result=${result} after ${duration} seconds\033[0K\r"
275 echo -e "---- \033[32m\033[1mPASS\033[0m - Test criteria met in ${duration} seconds, result = ${result} ----"
278 if [ $duration -gt $6 ]; then
280 echo -e "---- \033[31m\033[1mFAIL\033[0m - Target ${3} ${4} ${5} not reached in ${6} seconds, result = ${result} ----"
286 elif [ $# -eq 5 ]; then
287 echo -e "---- ${1} sim test criteria: \033[1m ${3} \033[0m ${4} ${5} ----"
289 result="$(__do_curl $2$3)"
291 result=${result//[[:blank:]]/} #Strip blanks
292 if [ $retcode -ne 0 ]; then
294 echo -e "---- \033[31m\033[1mFAIL\033[0m - Target ${3} ${4} ${5} not reached, result = ${result} ----"
295 elif [ $4 = "=" ] && [ "$result" -eq $5 ]; then
297 echo -e "---- \033[32m\033[1mPASS\033[0m - Test criteria met"
298 elif [ $4 = ">" ] && [ "$result" -gt $5 ]; then
300 echo -e "---- \033[32m\033[1mPASS\033[0m - Test criteria met, result = ${result} ----"
301 elif [ $4 = "<" ] && [ "$result" -lt $5 ]; then
303 echo -e "---- \033[32m\033[1mPASS\033[0m - Test criteria met, result = ${result} ----"
304 elif [ $4 = "contain_str" ] && [[ $result =~ $5 ]]; then
306 echo -e "---- \033[32m\033[1mPASS\033[0m - Test criteria met, result = ${result} ----"
309 echo -e "---- \033[31m\033[1mFAIL\033[0m - Target ${3} ${4} ${5} not reached, result = ${result} ----"
312 echo "Wrong args to __var_test, needs five or six args: <simulator-name> <host> <variable-name> <condition-operator> <target-value> [ <timeout> ]"
316 # Stops a named container
318 if [ $# -ne 1 ]; then
319 echo "__docker_stop need 1 arg <container-name>"
322 tmp=$(docker stop $1 2>/dev/null)
323 if [ -z $tmp ] || [ $tmp != $1 ]; then
324 echo " ${1} container not stopped or not existing"
326 echo " ${1} container stopped"
330 # Starts a named container (that has previously been stopped)
332 if [ $# -ne 1 ]; then
333 echo "__docker_start need 1 arg <container-name>"
336 tmp=$(docker start $1 2>/dev/null)
337 if [ -z $tmp ] || [ $tmp != $1 ]; then
338 echo " ${1} container not started or not existing"
340 echo " ${1} container started"
344 # Removes a named container
346 if [ $# -ne 1 ]; then
347 echo "__docker_rm need 1 arg <container-name>"
350 tmp=$(docker rm $1 2>/dev/null)
351 if [ -z $tmp ] || [ $tmp != $1 ]; then
352 echo " ${1} container not removed or not existing"
354 echo " ${1} container removed"
358 __start_dfc_image() {
361 __print_err "need tow args, <dfc-instance-name> 0.."$$DFC_MAX_IDX
365 if [ $2 -lt 0 ] || [ $2 -gt $DFC_MAX_IDX ]; then
366 __print_err "need two args, <dfc-instance-name> 0.."$DFC_MAX_IDX
370 localport=$(($DFC_PORT + $2))
371 localport_secure=$(($DFC_PORT_SECURE + $2))
373 echo "Creating docker network $DOCKER_SIM_NWNAME, if needed"
375 docker network ls| grep $DOCKER_SIM_NWNAME > /dev/null || docker network create $DOCKER_SIM_NWNAME
377 echo "Starting DFC: " $appname " with ports mapped to " $localport " and " $localport_secure " in docker network "$DOCKER_SIM_NWNAME
379 docker run -d -p $localport":8100" -p $localport_secure":8433" --network=$DOCKER_SIM_NWNAME -e CONSUL_HOST=$CONSUL_HOST -e CONSUL_PORT=$CONSUL_PORT -e CONFIG_BINDING_SERVICE=$CONFIG_BINDING_SERVICE -e HOSTNAME=$appname --name $appname $DFC_IMAGE > /dev/null
383 if [ $(docker inspect --format '{{ .State.Running }}' $appname) ]
385 echo " Image: $(docker inspect --format '{{ .Config.Image }}' ${appname})"
386 echo "DFC container ${appname} running"
393 if ! [ $dfc_started ]; then
394 echo "DFC container ${appname} could not be started"
399 echo "Waiting for DFC ${appname} heartbeat..."
401 result="$(__do_curl http://127.0.0.1:${localport}/heartbeat)"
402 if [ $? -eq 0 ]; then
403 echo "DFC ${appname} responds to heartbeat: " $result
405 result="$(__do_curl http://127.0.0.1:${localport}/actuator/info)"
406 echo "DFC ${appname} image build info: " $result
413 if ! [ $dfc_hb ]; then
414 echo "DFC ${appname} did not respond to heartbeat"
418 # Function for waiting for named container to be started manually.
419 __wait_for_container() {
422 echo "Need one arg: <container-name> <instance-id>"
425 http=$(($DFC_PORT+$2))
426 https=$((DFC_PORT_SECURE+$2))
427 echo "The container is expected to map its ports (8100/8433) to the following port visibile on the host: http port ${http} and https port ${https}"
428 echo "Waiting for container with name '${1}' to be started manually...."
432 if [ $(docker inspect --format '{{ .State.Running }}' $1 2> /dev/null) ]; then
433 echo "Container running: "$1
436 duration=$((SECONDS-start))
437 echo -ne " Waited ${duration} seconds\033[0K\r"
442 echo "Connecting container "$1" to simulator network "$DOCKER_SIM_NWNAME
443 docker network connect $DOCKER_SIM_NWNAME $1
446 #WFunction for waiting for named container to be stopped manually.
447 __wait_for_container_gone() {
450 echo "Need one arg: <container-name>"
453 echo "Disconnecting container "$1" from simulator network "$DOCKER_SIM_NWNAME
454 docker network disconnect $DOCKER_SIM_NWNAME $1
455 echo "Waiting for container with name '${1}' to be stopped manually...."
459 if [ $(docker inspect --format '{{ .State.Running }}' $1 2> /dev/null) ]; then
460 duration=$((SECONDS-start))
461 echo -ne " Waited ${duration} seconds\033[0K\r"
464 echo "Container stopped: "$1
470 #Function for waiting to dfc to be started manually
472 http=$(($DFC_PORT+$2))
473 https=$((DFC_PORT_SECURE+$2))
474 echo "The app is expected to listen to http port ${http} and https port ${https}"
475 echo "The app shall use 'localhost' and '8500' for CONSUL_HOST and CONSUL_PORT."
476 echo "The app shale use 'config-binding-service-localhost' for CONFIG_BINDING_SERVICE"
477 echo "The app shall use ${1} for HOSTNAME."
478 read -p "Press enter to continue when app mapping to ${1} has been manually started"
481 #Function for waiting to dfc to be stopped manually
482 __wait_for_dfc_gone() {
483 read -p "Press enter to continue when when app mapping to ${1} has been manually stopped"
486 #############################################################
487 ############## Functions for auto test scripts ##############
488 #############################################################
490 # Print the env variables needed for the simulators and their setup
492 echo "Simulator settings"
494 echo "MR_GROUPS= "$MR_GROUPS
495 echo "MR_FILE_PREFIX_MAPPING="$MR_FILE_PREFIX_MAPPING
497 echo "DR_FEEDS= "$DR_FEEDS
498 echo "DR_REDIR_SIM= "$DR_REDIR_SIM
499 echo "DR_REDIR_TC= "$DR_REDIR_TC
500 echo "DR_REDIR_FEEDS= "$DR_REDIR_FEEDS
502 echo "NUM_FTPFILES= "$NUM_FTPFILES
503 echo "NUM_PNFS= "$NUM_PNFS
504 echo "FILE_SIZE= "$FILE_SIZE
505 echo "FTP_TYPE= "$FTP_TYPE
506 echo "FTP_FILE_PREFIXES= "$FTP_FILE_PREFIXES
507 echo "NUM_FTP_SERVERS= "$NUM_FTP_SERVERS
508 echo "SFTP_SIMS= "$SFTP_SIMS
509 echo "FTPS_SIMS= "$FTPS_SIMS
513 # Stop and remove all containers including dfc app and simulators
515 echo "Stopping all containers, dfc app(s) and simulators with name prefix 'dfc_'"
516 docker stop $(docker ps -q --filter name=dfc_) &> /dev/null
517 echo "Removing all containers, dfc app and simulators with name prefix 'dfc_'"
518 docker rm $(docker ps -a -q --filter name=dfc_) &> /dev/null
519 echo "Removing unused docker networks with substring 'dfc' in network name"
520 docker network rm $(docker network ls -q --filter name=dfc)
524 # Start all simulators in the simulator group
527 echo "Starting all simulators"
530 $SIM_GROUP/simulators-start.sh
535 # Start the dfc application
539 __print_err "need one arg, <dfc-instance-id>"
543 if [ $1 -lt 0 ] || [ $1 -gt $DFC_MAX_IDX ]; then
544 __print_err "arg should be 0.."$DFC_MAX_IDX
547 appname=$DFC_APP_BASE$1
548 STARTED_DFCS=$STARTED_DFCS"_"$appname"_"
550 if [ $START_ARG == "local" ] || [ $START_ARG == "remote" ] || [ $START_ARG == "remote-remove" ]; then
551 __start_dfc_image $appname $1
552 elif [ $START_ARG == "manual-container" ]; then
553 __wait_for_container $appname $1
554 elif [ $START_ARG == "manual-app" ]; then
555 __wait_for_dfc $appname $1
559 # Configure consul with dfc config, args <app|dmaap> <dfc-instance-id> <json-file-path>
560 # Not intended to be called directly by test scripts.
564 __print_err "need three args, <app|dmaap> <dfc-instance-id> <json-file-path>"
568 if [ $2 -lt 0 ] || [ $2 -gt $DFC_MAX_IDX ]; then
569 __print_err "dfc-instance-id should be 0.."$DFC_MAX_IDX
573 __print_err "json file does not extis: "$3
577 if [ $1 == "app" ]; then
578 appname=$DFC_APP_BASE$2
579 elif [ $1 == "dmaap" ]; then
580 appname=$DFC_APP_BASE$2":dmaap"
582 __print_err "config type should be 'app' or 'dmaap'"
586 echo "Configuring consul for " $appname " from " $3
587 curl -s http://127.0.0.1:${CONSUL_PORT}/v1/kv/${appname}?dc=dc1 -X PUT -H 'Accept: application/json' -H 'Content-Type: application/json' -H 'X-Requested-With: XMLHttpRequest' --data-binary "@"$3 >/dev/null
590 # Configure consul with dfc app config, args <dfc-instance-id> <json-file-path>
591 consul_config_app() {
592 if [ $START_ARG == "manual-app" ]; then
593 echo "Replacing 'mrsim' with 'localhost' in json app config for consul"
594 sed 's/mrsim/localhost/g' $2 > .tmp_app.json
595 __consul_config app $1 .tmp_app.json
597 __consul_config app $1 $2
601 # Configure consul with dfc dmaap config, args <dfc-instance-id> <json-file-path>
602 consul_config_dmaap() {
603 if [ $START_ARG == "manual-app" ]; then
604 echo "Replacing 'drsim' with 'localhost' in json dmaap config for consul"
605 sed 's/drsim/localhost/g' $2 > .tmp_dmaap.json
606 __consul_config dmaap $1 .tmp_dmaap.json
608 __consul_config dmaap $1 $2
612 # Stop and remove the dfc app container
616 __print_err "need one arg, <dfc-instance-id>"
620 if [ $1 -lt 0 ] || [ $1 -gt $DFC_MAX_IDX ]; then
621 __print_err "arg should be 0.."$DFC_MAX_IDX
624 appname=$DFC_APP_BASE$1
626 echo "Killing DFC, instance id: "$1
628 if [ $START_ARG == "local" ] || [ $START_ARG == "remote" ] || [ $START_ARG == "remote-remove" ]; then
629 __docker_stop $appname
631 elif [ $START_ARG == "manual-container" ]; then
632 __wait_for_container_gone $appname
633 elif [ $START_ARG == "manual-app" ]; then
634 __wait_for_dfc_gone $appname
638 # Stop and remove the DR simulator container
640 echo "Killing DR sim"
641 __docker_stop dfc_dr-sim
642 __docker_rm dfc_dr-sim
645 # Stop and remove the DR redir simulator container
647 echo "Killing DR redir sim"
648 __docker_stop dfc_dr-redir-sim
649 __docker_rm dfc_dr-redir-sim
652 # Stop and remove the MR simulator container
654 echo "Killing MR sim"
655 __docker_stop dfc_mr-sim
656 __docker_rm dfc_mr-sim
659 # Stop and remove the SFTP container, arg: <sftp-instance-id>
663 __print_err "need one arg, <sftp-instance-id>"
667 if [ $1 -lt 0 ] || [ $1 -gt $FTP_MAX_IDX ]; then
668 __print_err "arg should be 0.."$FTP_MAX_IDX
673 echo "Killing SFTP, instance id: "$1
675 __docker_stop $appname
679 # Stop SFTP container, arg: <sftp-instance-id>
683 __print_err "need one arg, <sftp-instance-id>"
687 if [ $1 -lt 0 ] || [ $1 -gt $FTP_MAX_IDX ]; then
688 __print_err "arg should be 0.."$FTP_MAX_IDX
693 echo "Stopping SFTP, instance id: "$1
695 __docker_stop $appname
698 # Starts a stopped SFTP container, arg: <sftp-instance-id>
702 __print_err "need one arg, <sftp-instance-id>"
706 if [ $1 -lt 0 ] || [ $1 -gt $FTP_MAX_IDX ]; then
707 __print_err "arg should be 0.."$FTP_MAX_IDX
712 echo "Starting SFTP, instance id: "$1
714 __docker_start $appname
717 # Stop and remove the FTPS container, arg: <ftps-instance-id>
721 __print_err "need one arg, <ftpS-instance-id>"
725 if [ $1 -lt 0 ] || [ $1 -gt $FTP_MAX_IDX ]; then
726 __print_err "arg should be 0.."$FTP_MAX_IDX
731 echo "Killing FTPS, instance id: "$1
733 __docker_stop $appname
737 # Stop FTPS container, arg: <ftps-instance-id>
741 __print_err "need one arg, <ftps-instance-id>"
745 if [ $1 -lt 0 ] || [ $1 -gt $FTP_MAX_IDX ]; then
746 __print_err "arg should be 0.."$FTP_MAX_IDX
751 echo "Stopping FTPS, instance id: "$1
753 __docker_stop $appname
756 # Starts a stopped FTPS container, arg: <ftps-instance-id>
760 __print_err "need one arg, <ftps-instance-id>"
764 if [ $1 -lt 0 ] || [ $1 -gt $FTP_MAX_IDX ]; then
765 __print_err "arg should be 0.."$FTP_MAX_IDX
770 echo "Starting FTPS, instance id: "$1
772 __docker_start $appname
775 # Print a variable value from the MR simulator. Arg: <variable-name>
778 __print_err "need one arg, <sim-param>"
781 echo -e "---- MR sim, \033[1m $1 \033[0m: $(__do_curl http://127.0.0.1:$MR_PORT/$1)"
784 # Print a variable value from the MR https simulator. Arg: <variable-name>
787 __print_err "need one arg, <sim-param>"
790 echo -e "---- MR sim, \033[1m $1 \033[0m: $(__do_curl https://127.0.0.1:$MR_PORT_SECURE/$1)"
793 # Print a variable value from the DR simulator. Arg: <variable-name>
796 __print_err "need one arg, <sim-param>"
799 echo -e "---- DR sim, \033[1m $1 \033[0m: $(__do_curl http://127.0.0.1:$DR_PORT/$1)"
802 # Print a variable value from the DR redir simulator. Arg: <variable-name>
805 __print_err "need one arg, <sim-param>"
808 echo -e "---- DR redir sim, \033[1m $1 \033[0m: $(__do_curl http://127.0.0.1:$DRR_PORT/$1)"
810 # Print a variable value from dfc. Arg: <dfc-instance-id> <variable-name>
813 __print_err "need two args, <dfc-instance-id> <dfc-param>"
816 if [ $1 -lt 0 ] || [ $1 -gt $DFC_MAX_IDX ]; then
817 __print_err "dfc instance id should be in range 0.."DFC_MAX_IDX
820 localport=$(($DFC_PORT + $1))
821 appname=$DFC_APP_BASE$1
822 echo -e "---- DFC $appname, \033[1m $2 \033[0m: $(__do_curl http://127.0.0.1:$localport/$2)"
825 # Read a variable value from MR sim and send to stdout. Arg: <variable-name>
827 echo "$(__do_curl http://127.0.0.1:$MR_PORT/$1)"
830 # Read a variable value from MR https sim and send to stdout. Arg: <variable-name>
832 echo "$(__do_curl https://127.0.0.1:$MR_PORT_SECURE/$1)"
835 # Read a variable value from DR sim and send to stdout. Arg: <variable-name>
837 echo "$(__do_curl http://127.0.0.1:$DR_PORT/$1)"
840 # Read a variable value from DR redir sim and send to stdout. Arg: <variable-name>
842 echo "$(__do_curl http://127.0.0.1:$DRR_PORT/$1)"
846 # Sleep. Arg: <sleep-time-in-sec>
849 __print_err "need one arg, <sleep-time-in-sec>"
852 echo "---- Sleep for " $1 " seconds ----"
854 duration=$((SECONDS-start))
855 while [ $duration -lt $1 ]; do
856 echo -ne " Slept for ${duration} seconds\033[0K\r"
858 duration=$((SECONDS-start))
863 # Sleep and print dfc heartbeat. Arg: <sleep-time-in-sec>
866 __print_err "need one arg, <sleep-time-in-sec>"
869 echo "---- Sleep for " $1 " seconds ----"
872 duration=$((SECONDS-start))
875 while [ $duration -lt $1 ]; do
876 if [ $rows -eq 0 ]; then
880 echo " Slept for ${duration} seconds"
881 if [ $((ctr%30)) -eq 0 ]; then
882 for (( i=0; i<=$DFC_MAX_IDX; i++ )); do
883 if [[ $STARTED_DFCS =~ "_"$DFC_APP_BASE$i"_" ]]; then
885 echo " HB ${DFC_APP_BASE}${i}: $(__do_curl http://127.0.0.1:$(($DFC_PORT+$i))/heartbeat)"
892 duration=$((SECONDS-start))
897 # Tests if a variable value in the MR simulator is equal to a target value and and optional timeout.
898 # Arg: <variable-name> <target-value> - This test set pass or fail depending on if the variable is
899 # equal to the target or not.
900 # Arg: <variable-name> <target-value> <timeout-in-sec> - This test waits up to the timeout seconds
901 # before setting pass or fail depending on if the variable value becomes equal to the target
904 if [ $# -eq 2 ] || [ $# -eq 3 ]; then
905 __var_test "MR" "http://127.0.0.1:$MR_PORT/" $1 "=" $2 $3
907 __print_err "Wrong args to mr_equal, needs two or three args: <sim-param> <target-value> [ timeout ]"
912 if [ $# -eq 2 ] || [ $# -eq 3 ]; then
913 __var_test "MR" "https://127.0.0.1:$MR_PORT_SECURE/" $1 "=" $2 $3
915 __print_err "Wrong args to mr_secure_equal, needs two or three args: <sim-param> <target-value> [ timeout ]"
919 # Tests if a variable value in the MR simulator is greater than a target value and and optional timeout.
920 # Arg: <variable-name> <target-value> - This test set pass or fail depending on if the variable is
921 # greater than the target or not.
922 # Arg: <variable-name> <target-value> <timeout-in-sec> - This test waits up to the timeout seconds
923 # before setting pass or fail depending on if the variable value greater than the target
926 if [ $# -eq 2 ] || [ $# -eq 3 ]; then
927 __var_test "MR" "http://127.0.0.1:$MR_PORT/" $1 ">" $2 $3
929 __print_err "Wrong args to mr_greater, needs two or three args: <sim-param> <target-value> [ timeout ]"
933 mr_secure_greater() {
934 if [ $# -eq 2 ] || [ $# -eq 3 ]; then
935 __var_test "MR" "https://127.0.0.1:$MR_PORT_SECURE/" $1 ">" $2 $3
937 __print_err "Wrong args to mr_secure_greater, needs two or three args: <sim-param> <target-value> [ timeout ]"
941 # Tests if a variable value in the MR simulator is less than a target value and and optional timeout.
942 # Arg: <variable-name> <target-value> - This test set pass or fail depending on if the variable is
943 # less than the target or not.
944 # Arg: <variable-name> <target-value> <timeout-in-sec> - This test waits up to the timeout seconds
945 # before setting pass or fail depending on if the variable value less than the target
948 if [ $# -eq 2 ] || [ $# -eq 3 ]; then
949 __var_test "MR" "http://127.0.0.1:$MR_PORT/" $1 "<" $2 $3
951 __print_err "Wrong args to mr_less, needs two or three args: <sim-param> <target-value> [ timeout ]"
955 if [ $# -eq 2 ] || [ $# -eq 3 ]; then
956 __var_test "MR" "https://127.0.0.1:$MR_PORT_SECURE/" $1 "<" $2 $3
958 __print_err "Wrong args to mr_secure_less, needs two or three args: <sim-param> <target-value> [ timeout ]"
962 # Tests if a variable value in the MR simulator contains the target string and and optional timeout.
963 # Arg: <variable-name> <target-value> - This test set pass or fail depending on if the variable contains
965 # Arg: <variable-name> <target-value> <timeout-in-sec> - This test waits up to the timeout seconds
966 # before setting pass or fail depending on if the variable value contains the target
969 if [ $# -eq 2 ] || [ $# -eq 3 ]; then
970 __var_test "MR" "http://127.0.0.1:$MR_PORT/" $1 "contain_str" $2 $3
972 __print_err "Wrong args to mr_contain_str, needs two or three args: <sim-param> <target-value> [ timeout ]"
975 mr_secure_contain_str() {
976 if [ $# -eq 2 ] || [ $# -eq 3 ]; then
977 __var_test "MR" "https://127.0.0.1:$MR_PORT_SECURE/" $1 "contain_str" $2 $3
979 __print_err "Wrong args to mr_secure_contain_str, needs two or three args: <sim-param> <target-value> [ timeout ]"
983 # Tests if a variable value in the DR simulator is equal to a target value and and optional timeout.
984 # Arg: <variable-name> <target-value> - This test set pass or fail depending on if the variable is
985 # equal to the target or not.
986 # Arg: <variable-name> <target-value> <timeout-in-sec> - This test waits up to the timeout seconds
987 # before setting pass or fail depending on if the variable value becomes equal to the target
990 if [ $# -eq 2 ] || [ $# -eq 3 ]; then
991 __var_test "DR" "http://127.0.0.1:$DR_PORT/" $1 "=" $2 $3
993 __print_err "Wrong args to dr_equal, needs two or three args: <sim-param> <target-value> [ timeout ]"
997 # Tests if a variable value in the DR simulator is greater than a target value and and optional timeout.
998 # Arg: <variable-name> <target-value> - This test set pass or fail depending on if the variable is
999 # greater than the target or not.
1000 # Arg: <variable-name> <target-value> <timeout-in-sec> - This test waits up to the timeout seconds
1001 # before setting pass or fail depending on if the variable value greater than the target
1004 if [ $# -eq 2 ] || [ $# -eq 3 ]; then
1005 __var_test "DR" "http://127.0.0.1:$DR_PORT/" $1 ">" $2 $3
1007 __print_err "Wrong args to dr_greater, needs two or three args: <sim-param> <target-value> [ timeout ]"
1011 # Tests if a variable value in the DR simulator is less than a target value and and optional timeout.
1012 # Arg: <variable-name> <target-value> - This test set pass or fail depending on if the variable is
1013 # less than the target or not.
1014 # Arg: <variable-name> <target-value> <timeout-in-sec> - This test waits up to the timeout seconds
1015 # before setting pass or fail depending on if the variable value less than the target
1018 if [ $# -eq 2 ] || [ $# -eq 3 ]; then
1019 __var_test "DR" "http://127.0.0.1:$DR_PORT/" $1 "<" $2 $3
1021 __print_err "Wrong args to dr_less, needs two or three args: <sim-param> <target-value> [ timeout ]"
1025 # Tests if a variable value in the DR simulator contains the target string and and optional timeout.
1026 # Arg: <variable-name> <target-value> - This test set pass or fail depending on if the variable contains
1027 # the target or not.
1028 # Arg: <variable-name> <target-value> <timeout-in-sec> - This test waits up to the timeout seconds
1029 # before setting pass or fail depending on if the variable value contains the target
1032 if [ $# -eq 2 ] || [ $# -eq 3 ]; then
1033 __var_test "DR" "http://127.0.0.1:$DR_PORT/" $1 "contain_str" $2 $3
1035 __print_err "Wrong args to dr_contain_str, needs two or three args: <sim-param> <target-value> [ timeout ]"
1039 # Tests if a variable value in the DR Redir simulator is equal to a target value and and optional timeout.
1040 # Arg: <variable-name> <target-value> - This test set pass or fail depending on if the variable is
1041 # equal to the target or not.
1042 # Arg: <variable-name> <target-value> <timeout-in-sec> - This test waits up to the timeout seconds
1043 # before setting pass or fail depending on if the variable value becomes equal to the target
1046 if [ $# -eq 2 ] || [ $# -eq 3 ]; then
1047 __var_test "DR REDIR" "http://127.0.0.1:$DRR_PORT/" $1 "=" $2 $3
1049 __print_err "Wrong args to drr_equal, needs two or three args: <sim-param> <target-value> [ timeout ]"
1054 # Tests if a variable value in the DR Redir simulator is greater a target value and and optional timeout.
1055 # Arg: <variable-name> <target-value> - This test set pass or fail depending on if the variable is
1056 # greater the target or not.
1057 # Arg: <variable-name> <target-value> <timeout-in-sec> - This test waits up to the timeout seconds
1058 # before setting pass or fail depending on if the variable value greater than the target
1061 if [ $# -eq 2 ] || [ $# -eq 3 ]; then
1062 __var_test "DR REDIR" "http://127.0.0.1:$DRR_PORT/" $1 ">" $2 $3
1064 __print_err "Wrong args to drr_greater, needs two or three args: <sim-param> <target-value> [ timeout ]"
1068 # Tests if a variable value in the DR Redir simulator is less than a target value and and optional timeout.
1069 # Arg: <variable-name> <target-value> - This test set pass or fail depending on if the variable is
1070 # less than the target or not.
1071 # Arg: <variable-name> <target-value> <timeout-in-sec> - This test waits up to the timeout seconds
1072 # before setting pass or fail depending on if the variable value less than the target
1075 if [ $# -eq 2 ] || [ $# -eq 3 ]; then
1076 __var_test "DR REDIR" "http://127.0.0.1:$DRR_PORT/" $1 "<" $2 $3
1078 __print_err "Wrong args to drr_less, needs two or three args: <sim-param> <target-value> [ timeout ]"
1082 # Tests if a variable value in the DR redir simulator contains the target string and and optional timeout.
1083 # Arg: <variable-name> <target-value> - This test set pass or fail depending on if the variable contains
1084 # the target or not.
1085 # Arg: <variable-name> <target-value> <timeout-in-sec> - This test waits up to the timeout seconds
1086 # before setting pass or fail depending on if the variable value contains the target
1089 if [ $# -eq 2 ] || [ $# -eq 3 ]; then
1090 __var_test "DR REDIR" "http://127.0.0.1:$DRR_PORT/" $1 "contain_str" $2 $3
1092 __print_err "Wrong args to drr_contain_str, needs two or three args: <sim-param> <target-value> [ timeout ]"
1096 #Test if a variable in the DFC contains a substring. Arg: <dfc-index> <variable-name> <substring-in-quotes>
1098 if [ $# -eq 3 ]; then
1099 if [ $1 -lt 0 ] || [ $1 -gt $DFC_MAX_IDX ]; then
1100 __print_err "arg should be 0.."$DFC_MAX_IDX
1103 appname=$DFC_APP_BASE$1
1104 localport=$(($DFC_PORT + $1))
1105 echo -e "---- DFC test criteria: $appname \033[1m ${2} \033[0m contains: ${3} ----"
1107 result="$(__do_curl http://127.0.0.1:$localport/${2})"
1108 if [[ $result =~ $3 ]]; then
1110 echo -e "---- \033[32m\033[1mPASS\033[0m - Test criteria met"
1113 echo -e "---- \033[31m\033[1mFAIL\033[0m - Target '${3}' not reached, result = ${result} ----"
1116 echo "Wrong args to dfc_contain_str, needs three arg: <dfc-index> <dfc-variable> <str>"
1121 # Store all dfc app and simulators log to the test case log dir. All logs gets a prefix to
1122 # separate logs stored at different steps in the test script. Arg: <tc-id> <log-prefix>
1124 if [ $# != 1 ]; then
1125 __print_err "need one arg, <file-prefix>"
1128 echo "Storing all container logs and dfc app log using prefix: "$1
1129 if ! [ $START_ARG == "manual-app" ]; then
1130 for (( i=0; i<=$DFC_MAX_IDX; i++ )); do
1131 appname=$DFC_APP_BASE$i
1132 tmp=$(docker ps | grep $appname)
1133 if ! [ -z "$tmp" ]; then #Only stored logs from running DFC apps
1134 docker cp $appname:/var/log/ONAP/application.log $TESTLOGS/$ATC/${1}_${appname}_application.log
1135 docker logs $appname > $TESTLOGS/$ATC/$1_$appname-docker.log 2>&1
1139 docker logs dfc_mr-sim > $TESTLOGS/$ATC/$1_dfc_mr-sim-docker.log 2>&1
1140 docker logs dfc_dr-sim > $TESTLOGS/$ATC/$1_dfc_dr-sim-docker.log 2>&1
1141 docker logs dfc_dr-redir-sim > $TESTLOGS/$ATC/$1_dfc_dr-redir-sim-docker.log 2>&1
1143 for (( i=0; i<=$FTP_MAX_IDX; i++ )); do
1144 appname=$SFTP_BASE$i
1145 docker logs $appname > $TESTLOGS/$ATC/${1}_${appname}.log 2>&1
1146 appname=$FTPS_BASE$i
1147 docker logs $appname > $TESTLOGS/$ATC/${1}_${appname}.log 2>&1
1150 docker logs dfc_consul > $TESTLOGS/$ATC/$1_consul.log 2>&1
1151 docker logs dfc_cbs > $TESTLOGS/$ATC/$1_cbs.log 2>&1
1153 # Check the dfc application log, for all dfc instances, for WARN and ERR messages and print the count.
1155 for (( i=0; i<=$DFC_MAX_IDX; i++ )); do
1156 appname=$DFC_APP_BASE$i
1157 tmp=$(docker ps | grep $appname)
1158 if ! [ -z "$tmp" ]; then #Only check logs for running dfc_apps
1159 _check_dfc_log $appname
1164 # Check dfc app log for one dfc instance, arg <dfc-app-name>
1166 echo "Checking $1 log $DFC_LOGPATH for WARNINGs and ERRORs"
1167 foundentries=$(docker exec -it $1 grep WARN /var/log/ONAP/application.log | wc -l)
1168 if [ $? -ne 0 ];then
1169 echo " Problem to search $1 log $DFC_LOGPATH"
1171 if [ $foundentries -eq 0 ]; then
1172 echo " No WARN entries found in $1 log $DFC_LOGPATH"
1174 echo -e " Found \033[1m"$foundentries"\033[0m WARN entries in $1 log $DFC_LOGPATH"
1177 foundentries=$(docker exec -it $1 grep ERR $DFC_LOGPATH | wc -l)
1178 if [ $? -ne 0 ];then
1179 echo " Problem to search $1 log $DFC_LOGPATH"
1181 if [ $foundentries -eq 0 ]; then
1182 echo " No ERR entries found in $1 log $DFC_LOGPATH"
1184 echo -e " Found \033[1m"$foundentries"\033[0m ERR entries in $1 log $DFC_LOGPATH"
1191 echo "---- DFC and all sim variables"
1193 for (( i=0; i<=$DFC_MAX_IDX; i++ )); do
1194 appname=$DFC_APP_BASE$i
1195 tmp=$(docker ps | grep $appname)
1196 if ! [ -z "$tmp" ]; then #Only check running dfc_apps
1204 mr_print execution_time
1207 mr_print fileprefixes
1208 mr_print exe_time_first_poll
1209 mr_print groups/exe_time_first_poll
1210 mr_print ctr_requests
1211 mr_print groups/ctr_requests
1212 mr_print ctr_responses
1213 mr_print groups/ctr_responses
1215 mr_print groups/ctr_files
1216 mr_print ctr_unique_files
1217 mr_print groups/ctr_unique_files
1218 mr_print groups/ctr_events
1220 mr_print ctr_unique_PNFs
1221 mr_print groups/ctr_unique_PNFs
1224 dr_print execution_time
1226 dr_print ctr_publish_query
1227 dr_print feeds/ctr_publish_query
1228 dr_print ctr_publish_query_bad_file_prefix
1229 dr_print feeds/ctr_publish_query_bad_file_prefix
1230 dr_print ctr_publish_query_published
1231 dr_print feeds/ctr_publish_query_published
1232 dr_print ctr_publish_query_not_published
1233 dr_print feeds/ctr_publish_query_not_published
1234 dr_print ctr_publish_req
1235 dr_print feeds/ctr_publish_req
1236 dr_print ctr_publish_req_bad_file_prefix
1237 dr_print feeds/ctr_publish_req_bad_file_prefix
1238 dr_print ctr_publish_req_redirect
1239 dr_print feeds/ctr_publish_req_redirect
1240 dr_print ctr_publish_req_published
1241 dr_print feeds/ctr_publish_req_published
1242 dr_print ctr_published_files
1243 dr_print feeds/ctr_published_files
1244 dr_print ctr_double_publish
1245 dr_print feeds/ctr_double_publish
1248 drr_print execution_time
1250 drr_print ctr_publish_requests
1251 drr_print feeds/ctr_publish_requests
1252 drr_print ctr_publish_requests_bad_file_prefix
1253 drr_print feeds/ctr_publish_requests_bad_file_prefix
1254 drr_print ctr_publish_responses
1255 drr_print feeds/ctr_publish_responses
1256 drr_print dwl_volume
1257 drr_print feeds/dwl_volume
1258 drr_print time_lastpublish
1259 drr_print feeds/time_lastpublish
1262 # Print the test result
1266 duration=$((TCTEST_END-TCTEST_START))
1268 echo "-------------------------------------------------------------------------------------------------"
1269 echo "------------------------------------- Test case: "$ATC
1270 echo "------------------------------------- Ended: "$(date)
1271 echo "-------------------------------------------------------------------------------------------------"
1272 echo "-- Description: "$TC_ONELINE_DESCR
1273 echo "-- Execution time: " $duration " seconds"
1274 echo "-------------------------------------------------------------------------------------------------"
1275 echo "------------------------------------- RESULTS"
1279 total=$((RES_PASS+RES_FAIL))
1280 if [ $RES_TEST -eq 0 ]; then
1281 echo -e "\033[1mNo tests seem to have executed. Check the script....\033[0m"
1282 echo -e "\033[31m\033[1m ___ ___ ___ ___ ___ _____ ___ _ ___ _ _ _ ___ ___ \033[0m"
1283 echo -e "\033[31m\033[1m/ __|/ __| _ \_ _| _ \_ _| | __/_\ |_ _| | | | | | _ \ __|\033[0m"
1284 echo -e "\033[31m\033[1m\__ \ (__| /| || _/ | | | _/ _ \ | || |_| |_| | / _| \033[0m"
1285 echo -e "\033[31m\033[1m|___/\___|_|_\___|_| |_| |_/_/ \_\___|____\___/|_|_\___|\033[0m"
1286 elif [ $total != $RES_TEST ]; then
1287 echo -e "\033[1mTotal number of tests does not match the sum of passed and failed tests. Check the script....\033[0m"
1288 echo -e "\033[31m\033[1m ___ ___ ___ ___ ___ _____ ___ _ ___ _ _ _ ___ ___ \033[0m"
1289 echo -e "\033[31m\033[1m/ __|/ __| _ \_ _| _ \_ _| | __/_\ |_ _| | | | | | _ \ __|\033[0m"
1290 echo -e "\033[31m\033[1m\__ \ (__| /| || _/ | | | _/ _ \ | || |_| |_| | / _| \033[0m"
1291 echo -e "\033[31m\033[1m|___/\___|_|_\___|_| |_| |_/_/ \_\___|____\___/|_|_\___|\033[0m"
1292 elif [ $RES_PASS = $RES_TEST ]; then
1293 echo -e "All tests \033[32m\033[1mPASS\033[0m"
1294 echo -e "\033[32m\033[1m ___ _ ___ ___ \033[0m"
1295 echo -e "\033[32m\033[1m | _ \/_\ / __/ __| \033[0m"
1296 echo -e "\033[32m\033[1m | _/ _ \\__ \__ \\ \033[0m"
1297 echo -e "\033[32m\033[1m |_|/_/ \_\___/___/ \033[0m"
1300 # Update test suite counter
1301 if [ -f .tmp_tcsuite_pass_ctr ]; then
1302 tmpval=$(< .tmp_tcsuite_pass_ctr)
1304 echo $tmpval > .tmp_tcsuite_pass_ctr
1306 if [ -f .tmp_tcsuite_pass ]; then
1307 echo " - "$ATC " -- "$TC_ONELINE_DESCR" Execution time: "$duration" seconds" >> .tmp_tcsuite_pass
1310 echo -e "One or more tests with status \033[31m\033[1mFAIL\033[0m "
1311 echo -e "\033[31m\033[1m ___ _ ___ _ \033[0m"
1312 echo -e "\033[31m\033[1m | __/_\ |_ _| | \033[0m"
1313 echo -e "\033[31m\033[1m | _/ _ \ | || |__ \033[0m"
1314 echo -e "\033[31m\033[1m |_/_/ \_\___|____|\033[0m"
1316 # Update test suite counter
1317 if [ -f .tmp_tcsuite_fail_ctr ]; then
1318 tmpval=$(< .tmp_tcsuite_fail_ctr)
1320 echo $tmpval > .tmp_tcsuite_fail_ctr
1322 if [ -f .tmp_tcsuite_fail ]; then
1323 echo " - "$ATC " -- "$TC_ONELINE_DESCR" Execution time: "$duration" seconds" >> .tmp_tcsuite_fail
1327 echo "++++ Number of tests: "$RES_TEST
1328 echo "++++ Number of passed tests: "$RES_PASS
1329 echo "++++ Number of failed tests: "$RES_FAIL
1330 echo "------------------------------------- Test case complete ---------------------------------"
1331 echo "-------------------------------------------------------------------------------------------------"