summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-07-16 11:43:44 -0400
committerGitHub <noreply@github.com>2021-07-16 11:43:44 -0400
commit1961769edfc7f0af8f727cb03bde0af13785726a (patch)
tree25bac8a0225381fd72636c04b167cfa52c53f766 /test
parent3ef124b03f1599645c4a5d71ccd90dc66d2cfe5c (diff)
parentbe51173ed39c2d16205b0469287b5d6a7271c2c5 (diff)
downloadpodman-1961769edfc7f0af8f727cb03bde0af13785726a.tar.gz
podman-1961769edfc7f0af8f727cb03bde0af13785726a.tar.bz2
podman-1961769edfc7f0af8f727cb03bde0af13785726a.zip
Merge pull request #10950 from edsantiago/python_flake_fix
APIv2 (python) tests: fix flake
Diffstat (limited to 'test')
-rw-r--r--test/python/docker/__init__.py2
-rw-r--r--test/python/docker/compat/test_containers.py9
2 files changed, 5 insertions, 6 deletions
diff --git a/test/python/docker/__init__.py b/test/python/docker/__init__.py
index 59b7987f4..f75185192 100644
--- a/test/python/docker/__init__.py
+++ b/test/python/docker/__init__.py
@@ -27,7 +27,7 @@ class Podman(object):
# No support for tmpfs (/tmp) or extfs (/var/tmp)
# self.cmd.append("--storage-driver=overlay")
- if os.getenv("DEBUG"):
+ if os.getenv("PODMAN_PYTHON_TEST_DEBUG"):
self.cmd.append("--log-level=debug")
self.cmd.append("--syslog=true")
diff --git a/test/python/docker/compat/test_containers.py b/test/python/docker/compat/test_containers.py
index 9fcdf49ea..1ad1e7f15 100644
--- a/test/python/docker/compat/test_containers.py
+++ b/test/python/docker/compat/test_containers.py
@@ -140,7 +140,7 @@ class TestContainers(unittest.TestCase):
def test_remove_container_without_force(self):
# Validate current container count
- self.assertTrue(len(self.client.containers.list()), 1)
+ self.assertEqual(len(self.client.containers.list()), 1)
# Remove running container should throw error
top = self.client.containers.get(TestContainers.topContainerId)
@@ -206,7 +206,6 @@ class TestContainers(unittest.TestCase):
self.assertEqual(len(ctnrs), 1)
def test_copy_to_container(self):
- self.skipTest("FIXME: #10948 - test is broken")
ctr: Optional[Container] = None
try:
test_file_content = b"Hello World!"
@@ -230,11 +229,11 @@ class TestContainers(unittest.TestCase):
ret, out = ctr.exec_run(["stat", "-c", "%u:%g", "/tmp/a.txt"])
self.assertEqual(ret, 0)
- self.assertTrue(out.startswith(b'1042:1043'), "assert correct uid/gid")
+ self.assertEqual(out.rstrip(), b'1042:1043', "UID/GID of copied file")
ret, out = ctr.exec_run(["cat", "/tmp/a.txt"])
self.assertEqual(ret, 0)
- self.assertTrue(out.startswith(test_file_content), "assert file content")
+ self.assertEqual(out.rstrip(), test_file_content, "Content of copied file")
finally:
if ctr is not None:
ctr.stop()
@@ -251,4 +250,4 @@ class TestContainers(unittest.TestCase):
volumes=["test_mount_preexisting_dir_vol:/workspace"])
ctr.start()
ret, out = ctr.exec_run(["stat", "-c", "%u:%g", "/workspace"])
- self.assertTrue(out.startswith(b'1042:1043'), "assert correct uid/gid")
+ self.assertEqual(out.rstrip(), b'1042:1043', "UID/GID set in dockerfile")