summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJoffrey F <joffrey@docker.com>2017-08-31 12:22:59 -0700
committerJoffrey F <joffrey@docker.com>2017-08-31 12:22:59 -0700
commit43cd5336a5458432230f86d605b4f8a14121c6bf (patch)
tree2bd8a87bf3af18a43c24ba3d867e5090f33e034b /tests
parent89195146adde47181156b0c204c72b790c69cf85 (diff)
downloaddocker-py-fix-advertise-addr.tar.gz
Use unambiguous advertise-addr when initializing a swarmfix-advertise-addr
Signed-off-by: Joffrey F <joffrey@docker.com>
Diffstat (limited to 'tests')
-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
5 files changed, 6 insertions, 6 deletions
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