@@ -6,13 +6,9 @@ all: test
66
77.PHONY : clean
88clean :
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
1010 find -name " __pycache__" | xargs rm -rf
1111
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-
1612.PHONY : build-dind-ssh
1713build-dind-ssh :
1814 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:
3026 docker build -t dpy-dind-certs -f tests/Dockerfile-dind-certs .
3127
3228.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
3830
3931.PHONY : unit-test-py3
4032unit-test-py3 : build-py3
4133 docker run -t --rm docker-sdk-python3 py.test tests/unit
4234
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-
4735.PHONY : integration-test-py3
4836integration-test-py3 : build-py3
4937 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:
5341 docker network inspect dpy-tests || docker network create dpy-tests
5442
5543.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
6645
6746.PHONY : integration-dind-py3
6847integration-dind-py3 : build-py3 setup-network
@@ -73,16 +52,6 @@ integration-dind-py3: build-py3 setup-network
7352 --network dpy-tests docker-sdk-python3 py.test tests/integration/${file}
7453 docker rm -vf dpy-dind-py3
7554
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
8655
8756.PHONY : integration-ssh-py3
8857integration-ssh-py3 : build-dind-ssh build-py3 setup-network
@@ -97,7 +66,7 @@ integration-ssh-py3: build-dind-ssh build-py3 setup-network
9766
9867
9968.PHONY : integration-dind-ssl
100- integration-dind-ssl : build-dind-certs build build -py3
69+ integration-dind-ssl : build-dind-certs build-py3
10170 docker rm -vf dpy-dind-certs dpy-dind-ssl || :
10271 docker run -d --name dpy-dind-certs dpy-dind-certs
10372 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
10675 docker:${TEST_ENGINE_VERSION} -dind\
10776 dockerd --tlsverify --tlscacert=/certs/ca.pem --tlscert=/certs/server-cert.pem\
10877 --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}
11278 docker run -t --rm --volumes-from dpy-dind-ssl --env=" DOCKER_HOST=tcp://docker:2375" \
11379 --env=" DOCKER_TLS_VERIFY=1" --env=" DOCKER_CERT_PATH=/certs" --env=" DOCKER_TEST_API_VERSION=${TEST_API_VERSION} " \
11480 --network dpy-tests docker-sdk-python3 py.test tests/integration/${file}
11581 docker rm -vf dpy-dind-ssl dpy-dind-certs
11682
11783.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
12086
12187.PHONY : docs
12288docs : build-docs
12389 docker run --rm -t -v ` pwd` :/src docker-sdk-python-docs sphinx-build docs docs/_build
12490
12591.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