'``DockerClient.add`` returns a ``Deferred`` that fails with
``AddressInUse`` if the external port of one of the ``PortMap``
instances passed for ``ports`` is already in use on the system by
something other than a Docker container.'

def test_non_docker_port_collision(self):

    address_user = socket.socket()
    self.addCleanup(address_user.close)
    address_user.bind(('', 0))
    used_address = address_user.getsockname()
    name = random_name(self)
    d = self.start_container(name, ports=[PortMap(internal_port=10000, external_port=used_address[1])])
    return self.assertFailure(d, AddressInUse)
