From e14f17247ce03f1c49cab3c944039ff9aba84f64 Mon Sep 17 00:00:00 2001 From: drebs Date: Fri, 10 Jun 2016 18:07:27 -0300 Subject: [test] improve docker run-test script --- scripts/docker/helper/run-test.sh | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'scripts') 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} -- cgit v1.2.3