Skip to content
Snippets Groups Projects
Commit 54cf6129 authored by Clara Daia Hilgenberg Daru's avatar Clara Daia Hilgenberg Daru
Browse files

Add quiet mode to test script

Conflicts:
	test/test.sh

Conflicts:
	test/README.md

Conflicts:
	test/README.md
parent c991b6a6
No related branches found
No related tags found
1 merge request!51Merge development to master
...@@ -25,13 +25,15 @@ agent ...@@ -25,13 +25,15 @@ agent
* run all docker images - run the agent inside the images, print the JSON * run all docker images - run the agent inside the images, print the JSON
generated in execution generated in execution
Building the images and the agent may take some time, so you can use the options Building the images and the agent may take some time and through a lot of output, so you can use the options
* `-c` to copy (rsync) the agent into the distribution directories * `-c` to copy (rsync) the agent into the distribution directories
* `-b [IMAGE_NAME]` to build the docker image specified by IMAGE_NAME or all * `-b [IMAGE_NAME]` to build the docker image specified by IMAGE_NAME or all
of them if none specified of them if none specified
* `-r [IMAGE_NAME]` to run the docker image specified by IMAGE_NAME or all * `-r [IMAGE_NAME]` to run the docker image specified by IMAGE_NAME or all
of them if none specified of them if none specified
* `-q` to run in quiet mode: redirect stdout to log.txt during
steps "copy" and "build"
to execute only part of the flow. Of course, running will not work if the images to execute only part of the flow. Of course, running will not work if the images
have not been built once previously. have not been built once previously.
...@@ -45,7 +47,6 @@ Currently tested images are ...@@ -45,7 +47,6 @@ Currently tested images are
* debian * debian
* opensuse * opensuse
Dockerfiles Dockerfiles
------------------- -------------------
......
...@@ -8,6 +8,7 @@ command -v docker >/dev/null 2>&1 || { echo >&2 "It seems docker is not installe ...@@ -8,6 +8,7 @@ command -v docker >/dev/null 2>&1 || { echo >&2 "It seems docker is not installe
# -c - rsync agent directory into image directory # -c - rsync agent directory into image directory
# -b - build only specified image / all images if no argument is provided # -b - build only specified image / all images if no argument is provided
# -r - run only specified image / all images if no argument is provided # -r - run only specified image / all images if no argument is provided
# -q - redirect stdout of rsync and docker build to log.txt file
EXECUTE_ALL=true EXECUTE_ALL=true
RSYNC_AGENT=false RSYNC_AGENT=false
...@@ -62,8 +63,13 @@ do ...@@ -62,8 +63,13 @@ do
fi fi
;; ;;
\?) -q)
echo "Invalid option: $2" >&2 QUIET_MODE=true
shift 1
;;
\?)
echo "Invalid option: $2" >&2
shift shift
;; ;;
esac esac
...@@ -80,6 +86,15 @@ then ...@@ -80,6 +86,15 @@ then
fi fi
# If quiet mode was selected, redirect stdout to log.txt file
if ($QUIET_MODE)
then
# save stdout
exec 5<&1
# redirect
exec 1> log.txt
fi
# rsync # rsync
if ($RSYNC_AGENT) if ($RSYNC_AGENT)
then then
...@@ -119,6 +134,11 @@ then ...@@ -119,6 +134,11 @@ then
fi fi
# If quiet mode was selected, restore stdout before running
if ($QUIET_MODE)
then
exec 1<&5
fi
# run agent into images # run agent into images
if ($RUN) if ($RUN)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment