diff options
Diffstat (limited to 'contrib/python/podman/test')
-rw-r--r-- | contrib/python/podman/test/test_containers.py | 19 | ||||
-rw-r--r-- | contrib/python/podman/test/test_tunnel.py | 14 |
2 files changed, 22 insertions, 11 deletions
diff --git a/contrib/python/podman/test/test_containers.py b/contrib/python/podman/test/test_containers.py index 167aae68b..70221e33d 100644 --- a/contrib/python/podman/test/test_containers.py +++ b/contrib/python/podman/test/test_containers.py @@ -1,6 +1,7 @@ import os import signal import unittest +from pathlib import Path from test.podman_testcase import PodmanTestCase from test.retry_decorator import retry @@ -219,13 +220,19 @@ class TestContainers(PodmanTestCase): self.assertTrue(ctnr.status, 'running') # creating cgoups can be flakey - @retry(podman.libs.errors.ErrorOccurred, tries=16, delay=2, print_=print) + @retry(podman.libs.errors.ErrorOccurred, tries=4, delay=2, print_=print) def test_stats(self): - self.assertTrue(self.alpine_ctnr.running) - - actual = self.alpine_ctnr.stats() - self.assertEqual(self.alpine_ctnr.id, actual.id) - self.assertEqual(self.alpine_ctnr.names, actual.name) + try: + self.assertTrue(self.alpine_ctnr.running) + + actual = self.alpine_ctnr.stats() + self.assertEqual(self.alpine_ctnr.id, actual.id) + self.assertEqual(self.alpine_ctnr.names, actual.name) + except Exception: + info = Path('/proc/self/mountinfo') + with info.open() as fd: + print('{} {}'.format(self.alpine_ctnr.id, info)) + print(fd.read()) def test_logs(self): self.assertTrue(self.alpine_ctnr.running) diff --git a/contrib/python/podman/test/test_tunnel.py b/contrib/python/podman/test/test_tunnel.py index 8ee4b1052..9a33e76cd 100644 --- a/contrib/python/podman/test/test_tunnel.py +++ b/contrib/python/podman/test/test_tunnel.py @@ -1,5 +1,6 @@ from __future__ import absolute_import +import logging import time import unittest from unittest.mock import MagicMock, patch @@ -66,16 +67,19 @@ class TestTunnel(unittest.TestCase): ) tunnel = Tunnel(context).bore() - cmd = [ - 'ssh', - '-fNT', - '-q', + cmd = ['ssh', '-fNT'] + if logging.getLogger().getEffectiveLevel() == logging.DEBUG: + cmd.append('-v') + else: + cmd.append('-q') + + cmd.extend(( '-L', '{}:{}'.format(context.local_socket, context.remote_socket), '-i', context.identity_file, '{}@{}'.format(context.username, context.hostname), - ] + )) mock_finalize.assert_called_once_with(tunnel, tunnel.close) mock_exists.assert_called_once_with(context.local_socket) |