summaryrefslogtreecommitdiff
path: root/scripts/docker
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2016-06-10 14:38:10 -0300
committerdrebs <drebs@leap.se>2016-06-22 17:51:17 -0300
commit5703d30d1789caa5705ed66f98a5b2f2dda78475 (patch)
tree210c3da7a9d8fa41d4b9b5e7b203da003df775f7 /scripts/docker
parent6c90ea9ea4ecdb58aa70a755f05a03598ce664f6 (diff)
[test] update docker image before test
Diffstat (limited to 'scripts/docker')
-rwxr-xr-xscripts/docker/helper/run-test.sh19
1 files changed, 12 insertions, 7 deletions
diff --git a/scripts/docker/helper/run-test.sh b/scripts/docker/helper/run-test.sh
index 5fd6e4f0..0a2d6b6b 100755
--- a/scripts/docker/helper/run-test.sh
+++ b/scripts/docker/helper/run-test.sh
@@ -20,11 +20,14 @@ if [ ${#} -ne 1 ]; then
exit 1
fi
-TEST=${1}
+test=${1}
+
+# make sure the image is up to date
+make image
# get script name and path
-SCRIPT=$(readlink -f "$0")
-SCRIPTPATH=$(dirname "$SCRIPT")
+script=$(readlink -f "$0")
+scriptpath=$(dirname "${script}")
# run the server
tempfile=`mktemp -u`
@@ -32,7 +35,7 @@ make run-server CONTAINER_ID_FILE=${tempfile}
# get server container info
container_id=`cat ${tempfile}`
-server_ip=`${SCRIPTPATH}/get-container-ip.sh ${container_id}`
+server_ip=`${scriptpath}/get-container-ip.sh ${container_id}`
# wait for server until timeout
start=`date +%s`
@@ -41,7 +44,7 @@ elapsed=0
echo "Waiting for soledad server container to come up..."
while [ ${elapsed} -lt ${TIMEOUT} ]; do
- result=`curl -s http://${server_ip}:2424`
+ curl -s http://${server_ip}:2424 > /dev/null
if [ ${?} -eq 0 ]; then
echo "Soledad server container is up!"
break
@@ -58,10 +61,12 @@ if [ ${elapsed} -ge ${TIMEOUT} ]; then
exit 1
fi
+set -e
+
# run the client
-if [ "${TEST}" = "connect" ]; then
+if [ "${test}" = "connect" ]; then
make run-client-test CONTAINER_ID_FILE=${tempfile}
-elif [ "${TEST}" = "perf" ]; then
+elif [ "${test}" = "perf" ]; then
make run-perf-test CONTAINER_ID_FILE=${tempfile}
make cp-perf-result CONTAINER_ID_FILE=${tempfile}
fi