summaryrefslogtreecommitdiff
path: root/scripts/docker/helper
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2016-06-12 13:26:34 -0300
committerdrebs <drebs@leap.se>2016-06-22 17:51:18 -0300
commite433353b877f9cfc735b4368d92b80d091264c65 (patch)
tree04d2c34b15ff5ac04d60fb8f06b22963547a01fd /scripts/docker/helper
parent2c5f5e886a2be8100ef27816adf81ef6cef1545a (diff)
[test] add commit/branch checkout to docker test running script
Diffstat (limited to 'scripts/docker/helper')
-rwxr-xr-xscripts/docker/helper/run-test.sh12
1 files changed, 8 insertions, 4 deletions
diff --git a/scripts/docker/helper/run-test.sh b/scripts/docker/helper/run-test.sh
index c3bdd00c..9b3ec0c9 100755
--- a/scripts/docker/helper/run-test.sh
+++ b/scripts/docker/helper/run-test.sh
@@ -15,18 +15,22 @@
TIMEOUT=20
# parse command
-if [ ${#} -ne 1 ]; then
+if [ ${#} -lt 1 -o ${#} -gt 2 ]; then
echo "Usage: ${0} perf|bootstrap"
exit 1
fi
test=${1}
-
if [ "${test}" != "perf" -a "${test}" != "bootstrap" ]; then
echo "Usage: ${0} perf|bootstrap"
exit 1
fi
+branch=""
+if [ ${#} -eq 2 ]; then
+ branch="SOLEDAD_BRANCH=${2}"
+fi
+
# make sure the image is up to date
make image
@@ -36,7 +40,7 @@ scriptpath=$(dirname "${script}")
# run the server
tempfile=`mktemp -u`
-make run-server CONTAINER_ID_FILE=${tempfile}
+make run-server CONTAINER_ID_FILE=${tempfile} ${branch}
# wait for server until timeout
container_id=`cat ${tempfile}`
@@ -67,5 +71,5 @@ fi
set -e
# run the test
-make run-client-${test} CONTAINER_ID_FILE=${tempfile}
+make run-client-${test} CONTAINER_ID_FILE=${tempfile} ${branch}
rm -r ${tempfile}