On error print daemon logs

Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
Daniel Nephin 2015-10-28 12:40:59 -04:00
parent bbc76e6034
commit 8306405340
1 changed files with 9 additions and 4 deletions

View File

@ -28,10 +28,15 @@ for version in $DOCKER_VERSIONS; do
>&2 echo "Running tests against Docker $version" >&2 echo "Running tests against Docker $version"
daemon_container="compose-dind-$version-$BUILD_NUMBER" daemon_container="compose-dind-$version-$BUILD_NUMBER"
trap "docker rm -vf $daemon_container" EXIT
# TODO: remove when we stop testing against 1.7.x function on_exit() {
daemon=$([[ "$version" == "1.7"* ]] && echo "-d" || echo "daemon") if [[ "$?" != "0" ]]; then
docker logs "$daemon_container"
fi
docker rm -vf "$daemon_container"
}
trap "on_exit" EXIT
docker run \ docker run \
-d \ -d \
@ -39,7 +44,7 @@ for version in $DOCKER_VERSIONS; do
--privileged \ --privileged \
--volume="/var/lib/docker" \ --volume="/var/lib/docker" \
dockerswarm/dind:$version \ dockerswarm/dind:$version \
docker $daemon -H tcp://0.0.0.0:2375 $DOCKER_DAEMON_ARGS \ docker daemon -H tcp://0.0.0.0:2375 $DOCKER_DAEMON_ARGS \
docker run \ docker run \
--rm \ --rm \