...
1# Docker Registry Integration Testing
2
3These integration tests cover interactions between registry clients such as
4the docker daemon and the registry server. All tests can be run using the
5[golem integration test runner](https://github.com/docker/golem)
6
7The integration tests configure components using docker compose
8(see docker-compose.yaml) and the runner can be using the golem
9configuration file (see golem.conf).
10
11## Running integration tests
12
13### Run using multiversion script
14
15The integration tests in the `contrib/docker-integration` directory can be simply
16run by executing the run script `./run_multiversion.sh`. If there is no running
17daemon to connect to, run as `./run_multiversion.sh -d`.
18
19This command will build the distribution image from the locally checked out
20version and run against multiple versions of docker defined in the script. To
21run a specific version of the registry or docker, Golem will need to be
22executed manually.
23
24### Run manually using Golem
25
26Using the golem tool directly allows running against multiple versions of
27the registry and docker. Running against multiple versions of the registry
28can be useful for testing changes in the docker daemon which are not
29covered by the default run script.
30
31#### Installing Golem
32
33Golem is distributed as an executable binary which can be installed from
34the [release page](https://github.com/docker/golem/releases/tag/v0.1).
35
36#### Running golem with docker
37
38Additionally golem can be run as a docker image requiring no additional
39installation.
40
41`docker run --privileged -v "$GOPATH/src/github.com/docker/distribution/contrib/docker-integration:/test" -w /test distribution/golem golem -rundaemon .`
42
43#### Golem custom images
44
45Golem tests version of software by defining the docker image to test.
46
47Run with registry 2.2.1 and docker 1.10.3
48
49`golem -i golem-dind:latest,docker:1.10.3-dind,1.10.3 -i golem-distribution:latest,registry:2.2.1 .`
50
51
52#### Use golem caching for developing tests
53
54Golem allows caching image configuration to reduce test start up time.
55Using this cache will allow tests with the same set of images to start
56up quickly. This can be useful when developing tests and needing the
57test to run quickly. If there are changes which effect the image (such as
58building a new registry image), then startup time will be slower.
59
60Run this command multiple times and after the first time test runs
61should start much quicker.
62`golem -cache ~/.cache/docker/golem -i golem-dind:latest,docker:1.10.3-dind,1.10.3 -i golem-distribution:latest,registry:2.2.1 .`
63
View as plain text