-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Milestone
Description
Because test_create_check_duplicate
does not add its network to tmp_networks
, it does not get removed. After you do this 9 times, the subnet of the last one clashes with the hard-coded subnet of some other tests.
Symptoms:
~/.../github.com/docker/docker-py$ docker run --env="DOCKER_HOST=tcp://docker:2375" --link=dpy-dind:docker docker-py py.test tests/integration/network_test.py
============================= test session starts ==============================
platform linux2 -- Python 2.7.11 -- py-1.4.31 -- pytest-2.7.2
rootdir: /home/docker-py, inifile: pytest.ini
plugins: cov
collected 14 items
tests/integration/network_test.py ........F.....
=================================== FAILURES ===================================
______________ TestNetworks.test_create_network_with_ipam_config _______________
tests/integration/network_test.py:60: in test_create_network_with_ipam_config
"c": "172.28.1.7",
tests/integration/network_test.py:15: in create_network
net_id = self.client.create_network(net_name, *args, **kwargs)['Id']
docker/utils/decorators.py:35: in wrapper
return f(self, *args, **kwargs)
docker/api/network.py:38: in create_network
return self._result(res, json=True)
docker/client.py:158: in _result
self._raise_for_status(response)
docker/client.py:154: in _raise_for_status
raise errors.APIError(e, response, explanation=explanation)
E APIError: 409 Client Error: Conflict ("cannot create network br-dc61b1db8337 (7b2f21e55a56fb4154dd19bebb45c8df037a09678c4a6bccdab3c16b8bf07a7f): conflicts with network dc61b1db833763e703457496bb3217406aeedf3afe8fd750ee21aba11a9f9a59 (br-dc61b1db8337): networks have overlapping IPv4")
===================== 1 failed, 13 passed in 7.76 seconds ======================
Here is the overlapping network:
$ docker network inspect dc61b1db833763e703457496bb3217406aeedf3afe8fd750ee21aba11a9f9a59
[
{
"Name": "dockerpy226972",
"Id": "dc61b1db833763e703457496bb3217406aeedf3afe8fd750ee21aba11a9f9a59",
"Scope": "local",
"Driver": "bridge",
"IPAM": {
"Driver": "default",
"Config": [
{
"Subnet": "172.28.0.0/16",
"Gateway": "172.28.0.1/16"
}
]
},
"Containers": {},
"Options": {}
}
]
Here we can see that running the test many times has created lots of them:
$ docker network ls
NETWORK ID NAME DRIVER
5e0177f6c3f2 dockerpy141491 bridge
950801e0a554 dockerpy671862 bridge
0f597023e885 dockerpy996320 bridge
5a4b36f1e4d9 dockerpy140252 bridge
dc61b1db8337 dockerpy226972 bridge
be7192368018 dockerpy908156 bridge
cf27cf9007ef none null
426bcd88339a host host
601318eb5c9b bridge bridge
2f30a9567069 dockerpy163039 bridge
023125dd8627 dockerpy744708 bridge
af00edb1498a dockerpy158611 bridge
docker-py version: master
docker version: 1.10.3
python version: 2.7.6
Metadata
Metadata
Assignees
Labels
No labels