...
1#!/usr/bin/env bash
2
3# Run the integration tests with multiple versions of the Docker engine
4
5set -e
6set -x
7
8DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
9
10
11if [ "$TMPDIR" != "" ] && [ ! -d "$TMPDIR" ]; then
12 mkdir -p $TMPDIR
13fi
14
15cachedir=`mktemp -t -d golem-cache.XXXXXX`
16trap "rm -rf $cachedir" EXIT
17
18if [ "$1" == "-d" ]; then
19 # Drivers to use for Docker engines the tests are going to create.
20 STORAGE_DRIVER=${STORAGE_DRIVER:-overlay}
21
22 docker daemon --log-level=panic --storage-driver="$STORAGE_DRIVER" &
23 DOCKER_PID=$!
24
25 # Wait for it to become reachable.
26 tries=10
27 until docker version &> /dev/null; do
28 (( tries-- ))
29 if [ $tries -le 0 ]; then
30 echo >&2 "error: daemon failed to start"
31 exit 1
32 fi
33 sleep 1
34 done
35
36 trap "kill $DOCKER_PID" EXIT
37fi
38
39distimage=$(docker build -q $DIR/../..)
40fullversion=$(git describe --match 'v[0-9]*' --dirty='.m' --always)
41distversion=${fullversion:1}
42
43echo "Testing image $distimage with distribution version $distversion"
44
45# Pull needed images before invoking golem to get pull time
46# These images are defined in golem.conf
47time docker pull nginx:1.9
48time docker pull golang:1.6
49time docker pull dmcgowan/token-server:simple
50time docker pull dmcgowan/token-server:oauth
51time docker pull distribution/golem-runner:0.1-bats
52
53time docker pull docker:1.9.1-dind
54time docker pull docker:1.10.3-dind
55time docker pull docker:1.11.1-dind
56time docker pull docker:1.12.3-dind
57time docker pull docker:1.13.0-rc5-dind
58
59golem -cache $cachedir \
60 -i "golem-distribution:latest,$distimage,$distversion" \
61 -i "golem-dind:latest,docker:1.9.1-dind,1.9.1" \
62 -i "golem-dind:latest,docker:1.10.3-dind,1.10.3" \
63 -i "golem-dind:latest,docker:1.11.1-dind,1.11.1" \
64 -i "golem-dind:latest,docker:1.12.3-dind,1.12.3" \
65 -i "golem-dind:latest,docker:1.13.0-rc5-dind,1.13.0" \
66 $DIR
67
View as plain text