summaryrefslogtreecommitdiff
path: root/scripts/docker/helper/run-test.sh
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2017-04-19 10:18:27 +0200
committerdrebs <drebs@leap.se>2017-04-19 11:49:42 +0200
commit40f2cb8b1f07b1346e01ff69b57e14c492f1cd0b (patch)
tree9cab2f54014ffb7a56e1d75fd5ef0a70369afd63 /scripts/docker/helper/run-test.sh
parenta4558ea4874e0de3561f228b41ef0a94a2e4c326 (diff)
[test] remove docker scripts from this repo
Docker scripts are only used for CI and do not need to be in this repository. Beause of that, we decided to moved the docker scripts to a private repository where dockerfiles for other parts of leap also live.
Diffstat (limited to 'scripts/docker/helper/run-test.sh')
-rwxr-xr-xscripts/docker/helper/run-test.sh75
1 files changed, 0 insertions, 75 deletions
diff --git a/scripts/docker/helper/run-test.sh b/scripts/docker/helper/run-test.sh
deleted file mode 100755
index 9b3ec0c9..00000000
--- a/scripts/docker/helper/run-test.sh
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/bin/sh
-
-# Run 2 docker images, one with soledad server and another with a soledad
-# client running a test.
-#
-# As there are many possible, tests, you have to pass an argument to the
-# script saying which test you want to run. Currently, possible values are
-# "connect" and "perf".
-#
-# After launching the server container, the script waits for TIMEOUT seconds
-# for it to come up. If we fail to detect the server, the script exits with
-# nonzero status.
-
-# seconds to wait before giving up waiting from server
-TIMEOUT=20
-
-# parse command
-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
-
-# get script name and path
-script=$(readlink -f "$0")
-scriptpath=$(dirname "${script}")
-
-# run the server
-tempfile=`mktemp -u`
-make run-server CONTAINER_ID_FILE=${tempfile} ${branch}
-
-# wait for server until timeout
-container_id=`cat ${tempfile}`
-server_ip=`${scriptpath}/get-container-ip.sh ${container_id}`
-start=`date +%s`
-elapsed=0
-
-echo "Waiting for soledad server container to come up..."
-
-while [ ${elapsed} -lt ${TIMEOUT} ]; do
- curl -s http://${server_ip}:2424 > /dev/null
- if [ ${?} -eq 0 ]; then
- echo "Soledad server container is up!"
- break
- else
- sleep 1
- fi
- now=`date +%s`
- elapsed=`expr ${now} - ${start}`
-done
-
-# exit with an error code if timed out waiting for server
-if [ ${elapsed} -ge ${TIMEOUT} ]; then
- echo "Error: server unreachable at ${server_ip} after ${TIMEOUT} seconds."
- exit 1
-fi
-
-set -e
-
-# run the test
-make run-client-${test} CONTAINER_ID_FILE=${tempfile} ${branch}
-rm -r ${tempfile}