@@ -3,7 +3,7 @@ all: test
3
3
4
4
.PHONY : clean
5
5
clean :
6
- -docker rm -vf dpy-dind
6
+ -docker rm -f dpy-dind-py2 dpy-dind-py3 dpy-dind-certs dpy-dind-ssl
7
7
find -name " __pycache__" | xargs rm -rf
8
8
9
9
.PHONY : build
@@ -27,57 +27,73 @@ test: flake8 unit-test unit-test-py3 integration-dind integration-dind-ssl
27
27
28
28
.PHONY : unit-test
29
29
unit-test : build
30
- docker run --rm docker-sdk-python py.test tests/unit
30
+ docker run -t - -rm docker-sdk-python py.test tests/unit
31
31
32
32
.PHONY : unit-test-py3
33
33
unit-test-py3 : build-py3
34
- docker run --rm docker-sdk-python3 py.test tests/unit
34
+ docker run -t - -rm docker-sdk-python3 py.test tests/unit
35
35
36
36
.PHONY : integration-test
37
37
integration-test : build
38
- docker run -- rm -v /var/run/docker.sock:/var/run/docker.sock docker-sdk-python py.test tests/integration/${file}
38
+ docker run -t -- rm -v /var/run/docker.sock:/var/run/docker.sock docker-sdk-python py.test -v tests/integration/${file}
39
39
40
40
.PHONY : integration-test-py3
41
41
integration-test-py3 : build-py3
42
- docker run --rm -v /var/run/docker.sock:/var/run/docker.sock docker-sdk-python3 py.test tests/integration/${file}
42
+ docker run -t - -rm -v /var/run/docker.sock:/var/run/docker.sock docker-sdk-python3 py.test tests/integration/${file}
43
43
44
- TEST_API_VERSION ?= 1.30
45
- TEST_ENGINE_VERSION ?= 17.06.0-ce
44
+ TEST_API_VERSION ?= 1.35
45
+ TEST_ENGINE_VERSION ?= 17.12.0-ce
46
+
47
+ .PHONY : setup-network
48
+ setup-network :
49
+ docker network inspect dpy-tests || docker network create dpy-tests
46
50
47
51
.PHONY : integration-dind
48
- integration-dind : build build-py3
49
- docker rm -vf dpy-dind || :
50
- docker run -d --name dpy-dind --privileged dockerswarm/dind:${TEST_ENGINE_VERSION} dockerd\
51
- -H tcp://0.0.0.0:2375 --experimental
52
- docker run --rm --env=" DOCKER_HOST=tcp://docker:2375" --env=" DOCKER_TEST_API_VERSION=${TEST_API_VERSION} " \
53
- --link=dpy-dind:docker docker-sdk-python py.test tests/integration
54
- docker run --rm --env=" DOCKER_HOST=tcp://docker:2375" --env=" DOCKER_TEST_API_VERSION=${TEST_API_VERSION} " \
55
- --link=dpy-dind:docker docker-sdk-python3 py.test tests/integration
56
- docker rm -vf dpy-dind
52
+ integration-dind : integration-dind-py2 integration-dind-py3
53
+
54
+ .PHONY : integration-dind-py2
55
+ integration-dind-py2 : build setup-network
56
+ docker rm -vf dpy-dind-py2 || :
57
+ docker run -d --network dpy-tests --name dpy-dind-py2 --privileged\
58
+ dockerswarm/dind:${TEST_ENGINE_VERSION} dockerd -H tcp://0.0.0.0:2375 --experimental
59
+ docker run -t --rm --env=" DOCKER_HOST=tcp://dpy-dind-py2:2375" --env=" DOCKER_TEST_API_VERSION=${TEST_API_VERSION} " \
60
+ --network dpy-tests docker-sdk-python py.test tests/integration
61
+ docker rm -vf dpy-dind-py2
62
+
63
+ .PHONY : integration-dind-py3
64
+ integration-dind-py3 : build-py3 setup-network
65
+ docker rm -vf dpy-dind-py3 || :
66
+ docker run -d --network dpy-tests --name dpy-dind-py3 --privileged\
67
+ dockerswarm/dind:${TEST_ENGINE_VERSION} dockerd -H tcp://0.0.0.0:2375 --experimental
68
+ docker run -t --rm --env=" DOCKER_HOST=tcp://dpy-dind-py3:2375" --env=" DOCKER_TEST_API_VERSION=${TEST_API_VERSION} " \
69
+ --network dpy-tests docker-sdk-python3 py.test tests/integration
70
+ docker rm -vf dpy-dind-py3
57
71
58
72
.PHONY : integration-dind-ssl
59
73
integration-dind-ssl : build-dind-certs build build-py3
74
+ docker rm -vf dpy-dind-certs dpy-dind-ssl || :
60
75
docker run -d --name dpy-dind-certs dpy-dind-certs
61
76
docker run -d --env=" DOCKER_HOST=tcp://localhost:2375" --env=" DOCKER_TLS_VERIFY=1" \
62
77
--env=" DOCKER_CERT_PATH=/certs" --volumes-from dpy-dind-certs --name dpy-dind-ssl\
63
- -v /tmp --privileged dockerswarm/dind:${TEST_ENGINE_VERSION} dockerd --tlsverify\
64
- --tlscacert=/certs/ca.pem --tlscert=/certs/server-cert.pem\
78
+ --network dpy-tests --network-alias docker -v /tmp --privileged\
79
+ dockerswarm/dind:${TEST_ENGINE_VERSION} \
80
+ dockerd --tlsverify --tlscacert=/certs/ca.pem --tlscert=/certs/server-cert.pem\
65
81
--tlskey=/certs/server-key.pem -H tcp://0.0.0.0:2375 --experimental
66
- docker run --rm --volumes-from dpy-dind-ssl --env=" DOCKER_HOST=tcp://docker:2375" \
82
+ docker run -t - -rm --volumes-from dpy-dind-ssl --env=" DOCKER_HOST=tcp://docker:2375" \
67
83
--env=" DOCKER_TLS_VERIFY=1" --env=" DOCKER_CERT_PATH=/certs" --env=" DOCKER_TEST_API_VERSION=${TEST_API_VERSION} " \
68
- --link= dpy-dind-ssl:docker docker-sdk-python py.test tests/integration
69
- docker run --rm --volumes-from dpy-dind-ssl --env=" DOCKER_HOST=tcp://docker:2375" \
84
+ --network dpy-tests docker-sdk-python py.test tests/integration
85
+ docker run -t - -rm --volumes-from dpy-dind-ssl --env=" DOCKER_HOST=tcp://docker:2375" \
70
86
--env=" DOCKER_TLS_VERIFY=1" --env=" DOCKER_CERT_PATH=/certs" --env=" DOCKER_TEST_API_VERSION=${TEST_API_VERSION} " \
71
- --link= dpy-dind-ssl:docker docker-sdk-python3 py.test tests/integration
87
+ --network dpy-tests docker-sdk-python3 py.test tests/integration
72
88
docker rm -vf dpy-dind-ssl dpy-dind-certs
73
89
74
90
.PHONY : flake8
75
91
flake8 : build
76
- docker run --rm docker-sdk-python flake8 docker tests
92
+ docker run -t - -rm docker-sdk-python flake8 docker tests
77
93
78
94
.PHONY : docs
79
95
docs : build-docs
80
- docker run --rm -it -v ` pwd` :/src docker-sdk-python-docs sphinx-build docs docs/_build
96
+ docker run --rm -t -v ` pwd` :/src docker-sdk-python-docs sphinx-build docs docs/_build
81
97
82
98
.PHONY : shell
83
99
shell : build
0 commit comments