2015-05-28 05:36:24 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
|
|
|
|
|
|
|
|
# Root directory of Distribution
|
|
|
|
DISTRIBUTION_ROOT=$(cd ../..; pwd -P)
|
|
|
|
|
2015-05-28 22:28:50 +00:00
|
|
|
volumeMount=""
|
|
|
|
if [ "$DOCKER_VOLUME" != "" ]; then
|
|
|
|
volumeMount="-v ${DOCKER_VOLUME}:/var/lib/docker"
|
|
|
|
fi
|
|
|
|
|
2015-06-03 17:18:02 +00:00
|
|
|
dockerMount=""
|
|
|
|
if [ "$DOCKER_BINARY" != "" ]; then
|
|
|
|
dockerMount="-v ${DOCKER_BINARY}:/usr/local/bin/docker"
|
|
|
|
fi
|
|
|
|
|
2015-05-28 05:36:24 +00:00
|
|
|
# Image containing the integration tests environment.
|
|
|
|
INTEGRATION_IMAGE=${INTEGRATION_IMAGE:-distribution/docker-integration}
|
|
|
|
|
|
|
|
# Make sure we upgrade the integration environment.
|
2015-05-28 22:55:04 +00:00
|
|
|
docker pull $INTEGRATION_IMAGE
|
2015-05-28 05:36:24 +00:00
|
|
|
|
|
|
|
# Start the integration tests in a Docker container.
|
2015-08-04 20:28:03 +00:00
|
|
|
docker run --rm -t --privileged $volumeMount $dockerMount \
|
2015-05-28 05:36:24 +00:00
|
|
|
-v ${DISTRIBUTION_ROOT}:/go/src/github.com/docker/distribution \
|
2015-06-03 17:18:02 +00:00
|
|
|
-e "STORAGE_DRIVER=$DOCKER_GRAPHDRIVER" \
|
2015-05-28 05:36:24 +00:00
|
|
|
-e "EXEC_DRIVER=$EXEC_DRIVER" \
|
|
|
|
${INTEGRATION_IMAGE} \
|
2015-08-04 20:28:03 +00:00
|
|
|
./test_runner.sh "$@"
|