summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoffrey F <joffrey@docker.com>2017-08-31 12:22:59 -0700
committerJoffrey F <joffrey@docker.com>2017-11-06 19:20:36 -0800
commitdc5b8bb8c36698960031900abeed64d2603f0e15 (patch)
treee0a42d24f5252dd4eeba80f2eb77e8f704b6ef19
parent8e7395ed68851cf36f40b5d1523a5a607299ae45 (diff)
downloaddocker-py-dc5b8bb8c36698960031900abeed64d2603f0e15.tar.gz
Use unambiguous advertise-addr when initializing a swarm
Signed-off-by: Joffrey F <joffrey@docker.com>
-rw-r--r--Makefile4
-rw-r--r--tests/integration/api_network_test.py4
-rw-r--r--tests/integration/base.py2
-rw-r--r--tests/integration/models_nodes_test.py2
-rw-r--r--tests/integration/models_services_test.py2
-rw-r--r--tests/integration/models_swarm_test.py2
6 files changed, 8 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index c6c6d56..991b93a 100644
--- a/Makefile
+++ b/Makefile
@@ -47,7 +47,7 @@ TEST_ENGINE_VERSION ?= 17.06.0-ce
.PHONY: integration-dind
integration-dind: build build-py3
docker rm -vf dpy-dind || :
- docker run -d --name dpy-dind --privileged dockerswarm/dind:${TEST_ENGINE_VERSION} docker daemon\
+ docker run -d --name dpy-dind --privileged dockerswarm/dind:${TEST_ENGINE_VERSION} dockerd\
-H tcp://0.0.0.0:2375 --experimental
docker run --rm --env="DOCKER_HOST=tcp://docker:2375" --env="DOCKER_TEST_API_VERSION=${TEST_API_VERSION}"\
--link=dpy-dind:docker docker-sdk-python py.test tests/integration
@@ -60,7 +60,7 @@ integration-dind-ssl: build-dind-certs build build-py3
docker run -d --name dpy-dind-certs dpy-dind-certs
docker run -d --env="DOCKER_HOST=tcp://localhost:2375" --env="DOCKER_TLS_VERIFY=1"\
--env="DOCKER_CERT_PATH=/certs" --volumes-from dpy-dind-certs --name dpy-dind-ssl\
- -v /tmp --privileged dockerswarm/dind:${TEST_ENGINE_VERSION} docker daemon --tlsverify\
+ -v /tmp --privileged dockerswarm/dind:${TEST_ENGINE_VERSION} dockerd --tlsverify\
--tlscacert=/certs/ca.pem --tlscert=/certs/server-cert.pem\
--tlskey=/certs/server-key.pem -H tcp://0.0.0.0:2375 --experimental
docker run --rm --volumes-from dpy-dind-ssl --env="DOCKER_HOST=tcp://docker:2375"\
diff --git a/tests/integration/api_network_test.py b/tests/integration/api_network_test.py
index 5439dd7..1cc632f 100644
--- a/tests/integration/api_network_test.py
+++ b/tests/integration/api_network_test.py
@@ -447,14 +447,14 @@ class TestNetworks(BaseAPIIntegrationTest):
@requires_api_version('1.25')
def test_create_network_attachable(self):
- assert self.client.init_swarm('eth0')
+ assert self.init_swarm()
_, net_id = self.create_network(driver='overlay', attachable=True)
net = self.client.inspect_network(net_id)
assert net['Attachable'] is True
@requires_api_version('1.29')
def test_create_network_ingress(self):
- assert self.client.init_swarm('eth0')
+ assert self.init_swarm()
self.client.remove_network('ingress')
_, net_id = self.create_network(driver='overlay', ingress=True)
net = self.client.inspect_network(net_id)
diff --git a/tests/integration/base.py b/tests/integration/base.py
index 3c01689..0c0cd06 100644
--- a/tests/integration/base.py
+++ b/tests/integration/base.py
@@ -110,5 +110,5 @@ class BaseAPIIntegrationTest(BaseIntegrationTest):
def init_swarm(self, **kwargs):
return self.client.init_swarm(
- 'eth0', listen_addr=helpers.swarm_listen_addr(), **kwargs
+ '127.0.0.1', listen_addr=helpers.swarm_listen_addr(), **kwargs
)
diff --git a/tests/integration/models_nodes_test.py b/tests/integration/models_nodes_test.py
index 5823e6b..3c8d48a 100644
--- a/tests/integration/models_nodes_test.py
+++ b/tests/integration/models_nodes_test.py
@@ -15,7 +15,7 @@ class NodesTest(unittest.TestCase):
def test_list_get_update(self):
client = docker.from_env(version=TEST_API_VERSION)
- client.swarm.init('eth0', listen_addr=helpers.swarm_listen_addr())
+ client.swarm.init('127.0.0.1', listen_addr=helpers.swarm_listen_addr())
nodes = client.nodes.list()
assert len(nodes) == 1
assert nodes[0].attrs['Spec']['Role'] == 'manager'
diff --git a/tests/integration/models_services_test.py b/tests/integration/models_services_test.py
index 9b5676d..6b5dab5 100644
--- a/tests/integration/models_services_test.py
+++ b/tests/integration/models_services_test.py
@@ -12,7 +12,7 @@ class ServiceTest(unittest.TestCase):
def setUpClass(cls):
client = docker.from_env(version=TEST_API_VERSION)
helpers.force_leave_swarm(client)
- client.swarm.init('eth0', listen_addr=helpers.swarm_listen_addr())
+ client.swarm.init('127.0.0.1', listen_addr=helpers.swarm_listen_addr())
@classmethod
def tearDownClass(cls):
diff --git a/tests/integration/models_swarm_test.py b/tests/integration/models_swarm_test.py
index e45ff3c..ac18030 100644
--- a/tests/integration/models_swarm_test.py
+++ b/tests/integration/models_swarm_test.py
@@ -16,7 +16,7 @@ class SwarmTest(unittest.TestCase):
def test_init_update_leave(self):
client = docker.from_env(version=TEST_API_VERSION)
client.swarm.init(
- advertise_addr='eth0', snapshot_interval=5000,
+ advertise_addr='127.0.0.1', snapshot_interval=5000,
listen_addr=helpers.swarm_listen_addr()
)
assert client.swarm.attrs['Spec']['Raft']['SnapshotInterval'] == 5000