integration helpers: allow tests to be located in subdirectories.

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
Andrea Luzzardi 2015-05-05 22:11:17 -07:00
parent 9d3dd85cf1
commit 75c54c22a1
2 changed files with 8 additions and 2 deletions

View File

@ -47,7 +47,7 @@ function teardown() {
start_docker 2
swarm_manage
run docker -H ${HOSTS[0]} build -t test $BATS_TEST_DIRNAME/testdata/build
run docker -H ${HOSTS[0]} build -t test $TESTDATA/build
[ "$status" -eq 0 ]
# pull busybox to force the refresh images

View File

@ -1,7 +1,13 @@
#!/bin/bash
# Root directory of integration tests.
INTEGRATION_ROOT=$(dirname "$(readlink -f "$BASH_SOURCE")")
# Test data path.
TESTDATA="${INTEGRATION_ROOT}/testdata"
# Root directory of the repository.
SWARM_ROOT=${SWARM_ROOT:-${BATS_TEST_DIRNAME}/../..}
SWARM_ROOT=${SWARM_ROOT:-$(cd "$INTEGRATION_ROOT/../.."; pwd -P)}
# Path of the Swarm binary.
SWARM_BINARY=${SWARM_BINARY:-${SWARM_ROOT}/swarm}