diff --git a/test/integration/affinities.bats b/test/integration/affinities.bats index b5fccff09a..c905a8af83 100644 --- a/test/integration/affinities.bats +++ b/test/integration/affinities.bats @@ -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 diff --git a/test/integration/helpers.bash b/test/integration/helpers.bash index 76e85a7798..20263dc39a 100644 --- a/test/integration/helpers.bash +++ b/test/integration/helpers.bash @@ -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}