diff options
author | drebs <drebs@leap.se> | 2016-06-10 18:07:27 -0300 |
---|---|---|
committer | drebs <drebs@leap.se> | 2016-06-22 17:51:18 -0300 |
commit | e14f17247ce03f1c49cab3c944039ff9aba84f64 (patch) | |
tree | aebc6803ce0b43f5d3407b3f30abd8a294d0fb93 | |
parent | 449aaefa3a95df6f5700b645d6113458f7fde015 (diff) |
[test] improve docker run-test script
-rwxr-xr-x | scripts/docker/helper/run-test.sh | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/scripts/docker/helper/run-test.sh b/scripts/docker/helper/run-test.sh index 0a2d6b6b..1b0e3db7 100755 --- a/scripts/docker/helper/run-test.sh +++ b/scripts/docker/helper/run-test.sh @@ -14,14 +14,19 @@ # seconds to wait before giving up waiting from server TIMEOUT=20 -# get a test +# parse command if [ ${#} -ne 1 ]; then - "Usage: ${0} [perf|connect]" + echo "Usage: ${0} perf|connect" exit 1 fi test=${1} +if [ "${1}" != "perf" -a "${1}" != "perf" ]; then + echo "Usage: ${0} perf|connect" + exit 1 +fi + # make sure the image is up to date make image @@ -33,11 +38,9 @@ scriptpath=$(dirname "${script}") tempfile=`mktemp -u` make run-server CONTAINER_ID_FILE=${tempfile} -# get server container info +# wait for server until timeout container_id=`cat ${tempfile}` server_ip=`${scriptpath}/get-container-ip.sh ${container_id}` - -# wait for server until timeout start=`date +%s` elapsed=0 @@ -63,10 +66,6 @@ fi set -e -# run the client -if [ "${test}" = "connect" ]; then - make run-client-test CONTAINER_ID_FILE=${tempfile} -elif [ "${test}" = "perf" ]; then - make run-perf-test CONTAINER_ID_FILE=${tempfile} - make cp-perf-result CONTAINER_ID_FILE=${tempfile} -fi +# run the test +make run-${test}-test CONTAINER_ID_FILE=${tempfile} +rm -r ${tempfile} |