@@ -6,13 +6,9 @@ all: test
6
6
7
7
.PHONY : clean
8
8
clean :
9
- -docker rm -f dpy-dind-py2 dpy-dind- py3 dpy-dind-certs dpy-dind-ssl
9
+ -docker rm -f dpy-dind-py3 dpy-dind-certs dpy-dind-ssl
10
10
find -name " __pycache__" | xargs rm -rf
11
11
12
- .PHONY : build
13
- build :
14
- docker build -t docker-sdk-python -f tests/Dockerfile --build-arg PYTHON_VERSION=2.7 --build-arg APT_MIRROR .
15
-
16
12
.PHONY : build-dind-ssh
17
13
build-dind-ssh :
18
14
docker build -t docker-dind-ssh -f tests/Dockerfile-ssh-dind --build-arg ENGINE_VERSION=${TEST_ENGINE_VERSION} --build-arg API_VERSION=${TEST_API_VERSION} --build-arg APT_MIRROR .
@@ -30,20 +26,12 @@ build-dind-certs:
30
26
docker build -t dpy-dind-certs -f tests/Dockerfile-dind-certs .
31
27
32
28
.PHONY : test
33
- test : flake8 unit-test unit-test-py3 integration-dind integration-dind-ssl
34
-
35
- .PHONY : unit-test
36
- unit-test : build
37
- docker run -t --rm docker-sdk-python py.test tests/unit
29
+ test : flake8 unit-test-py3 integration-dind integration-dind-ssl
38
30
39
31
.PHONY : unit-test-py3
40
32
unit-test-py3 : build-py3
41
33
docker run -t --rm docker-sdk-python3 py.test tests/unit
42
34
43
- .PHONY : integration-test
44
- integration-test : build
45
- docker run -t --rm -v /var/run/docker.sock:/var/run/docker.sock docker-sdk-python py.test -v tests/integration/${file}
46
-
47
35
.PHONY : integration-test-py3
48
36
integration-test-py3 : build-py3
49
37
docker run -t --rm -v /var/run/docker.sock:/var/run/docker.sock docker-sdk-python3 py.test -v tests/integration/${file}
@@ -53,16 +41,7 @@ setup-network:
53
41
docker network inspect dpy-tests || docker network create dpy-tests
54
42
55
43
.PHONY : integration-dind
56
- integration-dind : integration-dind-py2 integration-dind-py3
57
-
58
- .PHONY : integration-dind-py2
59
- integration-dind-py2 : build setup-network
60
- docker rm -vf dpy-dind-py2 || :
61
- docker run -d --network dpy-tests --name dpy-dind-py2 --privileged\
62
- docker:${TEST_ENGINE_VERSION} -dind dockerd -H tcp://0.0.0.0:2375 --experimental
63
- docker run -t --rm --env=" DOCKER_HOST=tcp://dpy-dind-py2:2375" --env=" DOCKER_TEST_API_VERSION=${TEST_API_VERSION} " \
64
- --network dpy-tests docker-sdk-python py.test tests/integration/${file}
65
- docker rm -vf dpy-dind-py2
44
+ integration-dind : integration-dind-py3
66
45
67
46
.PHONY : integration-dind-py3
68
47
integration-dind-py3 : build-py3 setup-network
@@ -73,16 +52,6 @@ integration-dind-py3: build-py3 setup-network
73
52
--network dpy-tests docker-sdk-python3 py.test tests/integration/${file}
74
53
docker rm -vf dpy-dind-py3
75
54
76
- .PHONY : integration-ssh-py2
77
- integration-ssh-py2 : build-dind-ssh build setup-network
78
- docker rm -vf dpy-dind-py2 || :
79
- docker run -d --network dpy-tests --name dpy-dind-py2 --privileged\
80
- docker-dind-ssh dockerd --experimental
81
- # start SSH daemon
82
- docker exec dpy-dind-py2 sh -c " /usr/sbin/sshd"
83
- docker run -t --rm --env=" DOCKER_HOST=ssh://dpy-dind-py2" --env=" DOCKER_TEST_API_VERSION=${TEST_API_VERSION} " \
84
- --network dpy-tests docker-sdk-python py.test tests/ssh/${file}
85
- docker rm -vf dpy-dind-py2
86
55
87
56
.PHONY : integration-ssh-py3
88
57
integration-ssh-py3 : build-dind-ssh build-py3 setup-network
@@ -97,7 +66,7 @@ integration-ssh-py3: build-dind-ssh build-py3 setup-network
97
66
98
67
99
68
.PHONY : integration-dind-ssl
100
- integration-dind-ssl : build-dind-certs build build -py3
69
+ integration-dind-ssl : build-dind-certs build-py3
101
70
docker rm -vf dpy-dind-certs dpy-dind-ssl || :
102
71
docker run -d --name dpy-dind-certs dpy-dind-certs
103
72
docker run -d --env=" DOCKER_HOST=tcp://localhost:2375" --env=" DOCKER_TLS_VERIFY=1" \
@@ -106,22 +75,19 @@ integration-dind-ssl: build-dind-certs build build-py3
106
75
docker:${TEST_ENGINE_VERSION} -dind\
107
76
dockerd --tlsverify --tlscacert=/certs/ca.pem --tlscert=/certs/server-cert.pem\
108
77
--tlskey=/certs/server-key.pem -H tcp://0.0.0.0:2375 --experimental
109
- docker run -t --rm --volumes-from dpy-dind-ssl --env=" DOCKER_HOST=tcp://docker:2375" \
110
- --env=" DOCKER_TLS_VERIFY=1" --env=" DOCKER_CERT_PATH=/certs" --env=" DOCKER_TEST_API_VERSION=${TEST_API_VERSION} " \
111
- --network dpy-tests docker-sdk-python py.test tests/integration/${file}
112
78
docker run -t --rm --volumes-from dpy-dind-ssl --env=" DOCKER_HOST=tcp://docker:2375" \
113
79
--env=" DOCKER_TLS_VERIFY=1" --env=" DOCKER_CERT_PATH=/certs" --env=" DOCKER_TEST_API_VERSION=${TEST_API_VERSION} " \
114
80
--network dpy-tests docker-sdk-python3 py.test tests/integration/${file}
115
81
docker rm -vf dpy-dind-ssl dpy-dind-certs
116
82
117
83
.PHONY : flake8
118
- flake8 : build
119
- docker run -t --rm docker-sdk-python flake8 docker tests
84
+ flake8 : build-py3
85
+ docker run -t --rm docker-sdk-python3 flake8 docker tests
120
86
121
87
.PHONY : docs
122
88
docs : build-docs
123
89
docker run --rm -t -v ` pwd` :/src docker-sdk-python-docs sphinx-build docs docs/_build
124
90
125
91
.PHONY : shell
126
- shell : build
127
- docker run -it -v /var/run/docker.sock:/var/run/docker.sock docker-sdk-python python
92
+ shell : build-py3
93
+ docker run -it -v /var/run/docker.sock:/var/run/docker.sock docker-sdk-python3 python
0 commit comments