summaryrefslogtreecommitdiff
path: root/test/python/docker
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2021-02-03 07:54:12 -0500
committerMatthew Heon <matthew.heon@pm.me>2021-02-08 13:59:12 -0500
commitd620a77c67e6603e72bb6dc08e9a86bbefe8793a (patch)
tree5fea5822d8b526fcf5a2deefb3cc3d38248d089f /test/python/docker
parent7819e49353b58fe87bdb74c33b2d999e3a7b563e (diff)
downloadpodman-d620a77c67e6603e72bb6dc08e9a86bbefe8793a.tar.gz
podman-d620a77c67e6603e72bb6dc08e9a86bbefe8793a.tar.bz2
podman-d620a77c67e6603e72bb6dc08e9a86bbefe8793a.zip
Fix invalid wait condition on kill
When using the compatability tests on kill, the kill function goes into an infinite wait loop taking all of the CPU. This change will use the correct wait function and exit properly. Fixes: https://github.com/containers/podman/issues/9206 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'test/python/docker')
-rw-r--r--test/python/docker/test_containers.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/python/docker/test_containers.py b/test/python/docker/test_containers.py
index 01e049ed4..5c2a5fef2 100644
--- a/test/python/docker/test_containers.py
+++ b/test/python/docker/test_containers.py
@@ -95,6 +95,15 @@ class TestContainers(unittest.TestCase):
top.reload()
self.assertIn(top.status, ("stopped", "exited"))
+ def test_kill_container(self):
+ top = self.client.containers.get(TestContainers.topContainerId)
+ self.assertEqual(top.status, "running")
+
+ # Kill a running container and validate the state
+ top.kill()
+ top.reload()
+ self.assertIn(top.status, ("stopped", "exited"))
+
def test_restart_container(self):
# Validate the container state
top = self.client.containers.get(TestContainers.topContainerId)