Merge pull request #2298 from dnephin/update_networking_test_for_rc4

Fix networking tests to work with new API in engine rc4
This commit is contained in:
Daniel Nephin 2015-11-02 15:10:17 -05:00
commit 3738da09e2
4 changed files with 10 additions and 9 deletions

View File

@ -8,7 +8,7 @@ VENV=/code/.tox/py27
mkdir -p `pwd`/dist
chmod 777 `pwd`/dist
$VENV/bin/pip install -r requirements-build.txt
$VENV/bin/pip install -q -r requirements-build.txt
su -c "$VENV/bin/pyinstaller docker-compose.spec" user
mv dist/docker-compose $TARGET
$TARGET version

View File

@ -31,7 +31,7 @@ for version in $DOCKER_VERSIONS; do
function on_exit() {
if [[ "$?" != "0" ]]; then
docker logs "$daemon_container"
docker logs "$daemon_container" 2>&1 | tail -n 100
fi
docker rm -vf "$daemon_container"
}
@ -45,6 +45,7 @@ for version in $DOCKER_VERSIONS; do
--volume="/var/lib/docker" \
dockerswarm/dind:$version \
docker daemon -H tcp://0.0.0.0:2375 $DOCKER_DAEMON_ARGS \
2>&1 | tail -n 10
docker run \
--rm \

View File

@ -215,17 +215,17 @@ class CLITestCase(DockerClientTestCase):
networks = client.networks(names=[self.project.name])
for n in networks:
self.addCleanup(client.remove_network, n['id'])
self.addCleanup(client.remove_network, n['Id'])
self.assertEqual(len(networks), 1)
self.assertEqual(networks[0]['driver'], 'bridge')
self.assertEqual(networks[0]['Driver'], 'bridge')
network = client.inspect_network(networks[0]['id'])
self.assertEqual(len(network['containers']), len(services))
network = client.inspect_network(networks[0]['Id'])
self.assertEqual(len(network['Containers']), len(services))
for service in services:
containers = service.containers()
self.assertEqual(len(containers), 1)
self.assertIn(containers[0].id, network['containers'])
self.assertIn(containers[0].id, network['Containers'])
self.assertEqual(containers[0].get('Config.Hostname'), service.name)
web_container = self.project.get_service('web').containers()[0]
@ -518,7 +518,7 @@ class CLITestCase(DockerClientTestCase):
container, = service.containers(stopped=True, one_off=True)
networks = client.networks(names=[self.project.name])
for n in networks:
self.addCleanup(client.remove_network, n['id'])
self.addCleanup(client.remove_network, n['Id'])
self.assertEqual(len(networks), 1)
self.assertEqual(container.human_readable_command, u'true')

View File

@ -111,7 +111,7 @@ class ProjectTest(DockerClientTestCase):
network_name = 'network_does_exist'
project = Project(network_name, [], client)
client.create_network(network_name)
assert project.get_network()['name'] == network_name
assert project.get_network()['Name'] == network_name
def test_net_from_service(self):
project = Project.from_dicts(