aboutsummaryrefslogtreecommitdiff
path: root/test/python
diff options
context:
space:
mode:
authorMatej Vasek <mvasek@redhat.com>2021-02-15 15:08:11 +0100
committerMatej Vasek <mvasek@redhat.com>2021-02-16 12:24:44 +0100
commit714acf32676d4e5f16d997d70958d093c6cc8fa3 (patch)
treeac97d0a2b3c58eb4c7e0c076205ae1a7a72eec91 /test/python
parentac9a048b59ebcbdfd2cb7abb50a97981892bd6b6 (diff)
downloadpodman-714acf32676d4e5f16d997d70958d093c6cc8fa3.tar.gz
podman-714acf32676d4e5f16d997d70958d093c6cc8fa3.tar.bz2
podman-714acf32676d4e5f16d997d70958d093c6cc8fa3.zip
fix create container: handle empty host port
Signed-off-by: Matej Vasek <mvasek@redhat.com>
Diffstat (limited to 'test/python')
-rw-r--r--test/python/docker/test_containers.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/python/docker/test_containers.py b/test/python/docker/test_containers.py
index 5c2a5fef2..337cacd5c 100644
--- a/test/python/docker/test_containers.py
+++ b/test/python/docker/test_containers.py
@@ -86,6 +86,13 @@ class TestContainers(unittest.TestCase):
containers = self.client.containers.list(all=True)
self.assertEqual(len(containers), 2)
+ def test_start_container_with_random_port_bind(self):
+ container = self.client.containers.create(image=constant.ALPINE,
+ name="containerWithRandomBind",
+ ports={'1234/tcp': None})
+ containers = self.client.containers.list(all=True)
+ self.assertTrue(container in containers)
+
def test_stop_container(self):
top = self.client.containers.get(TestContainers.topContainerId)
self.assertEqual(top.status, "running")