From 9f80ec548e79e1fbfa7adab27a0e50b3fdbb6ba9 Mon Sep 17 00:00:00 2001 From: Joffrey F Date: Wed, 1 Nov 2017 14:26:29 -0700 Subject: [PATCH] Miscellaneous test fixes Signed-off-by: Joffrey F --- tests/acceptance/cli_test.py | 8 +++++++- tests/integration/service_test.py | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/acceptance/cli_test.py b/tests/acceptance/cli_test.py index 8ba43b00f..bba2238e7 100644 --- a/tests/acceptance/cli_test.py +++ b/tests/acceptance/cli_test.py @@ -851,7 +851,13 @@ class CLITestCase(DockerClientTestCase): volumes = self.project.volumes.volumes assert 'data' in volumes volume = volumes['data'] - assert volume.exists() + + # The code below is a Swarm-compatible equivalent to volume.exists() + remote_volumes = [ + v for v in self.client.volumes().get('Volumes', []) + if v['Name'].split('/')[-1] == volume.full_name + ] + assert len(remote_volumes) > 0 @v2_only() def test_up_no_ansi(self): diff --git a/tests/integration/service_test.py b/tests/integration/service_test.py index 84b54fe41..3ddf991b3 100644 --- a/tests/integration/service_test.py +++ b/tests/integration/service_test.py @@ -788,7 +788,7 @@ class ServiceTest(DockerClientTestCase): net_container = self.client.create_container( 'busybox', 'top', host_config=self.client.create_host_config( - extra_hosts={'google.local': '8.8.8.8'} + extra_hosts={'google.local': '127.0.0.1'} ), name='composetest_build_network' )