diff options
Diffstat (limited to 'contrib/python/test/test_containers.py')
-rw-r--r-- | contrib/python/test/test_containers.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/contrib/python/test/test_containers.py b/contrib/python/test/test_containers.py index 87d43adb4..ec2dcde03 100644 --- a/contrib/python/test/test_containers.py +++ b/contrib/python/test/test_containers.py @@ -72,14 +72,18 @@ class TestContainers(PodmanTestCase): mock_in.write('echo H"ello, World"; exit\n') mock_in.seek(0, 0) - self.alpine_ctnr.attach( - stdin=mock_in.fileno(), stdout=mock_out.fileno()) + ctnr = self.pclient.images.get(self.alpine_ctnr.image).container( + detach=True, tty=True) + ctnr.attach(stdin=mock_in.fileno(), stdout=mock_out.fileno()) + ctnr.start() mock_out.flush() mock_out.seek(0, 0) output = mock_out.read() self.assertIn('Hello', output) + ctnr.remove(force=True) + def test_processes(self): actual = list(self.alpine_ctnr.processes()) self.assertGreaterEqual(len(actual), 2) @@ -133,8 +137,7 @@ class TestContainers(PodmanTestCase): def test_commit(self): # TODO: Test for STOPSIGNAL when supported by OCI # TODO: Test for message when supported by OCI - details = self.pclient.images.get( - self.alpine_ctnr.inspect().image).inspect() + details = self.pclient.images.get(self.alpine_ctnr.image).inspect() changes = ['ENV=' + i for i in details.containerconfig['env']] changes.append('CMD=/usr/bin/zsh') changes.append('ENTRYPOINT=/bin/sh date') |