From 1a24cde608eaadb75b540043643786f01ac9eae4 Mon Sep 17 00:00:00 2001 From: Povilas Kanapickas Date: Fri, 8 Mar 2024 15:49:00 +0200 Subject: [PATCH] tests: Properly tear down containers in extends_w_file_subdir test podman rmi does not guarantee that the container itself is shut down. Signed-off-by: Povilas Kanapickas --- tests/test_podman_compose.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/tests/test_podman_compose.py b/tests/test_podman_compose.py index 0d3800b..999e2aa 100644 --- a/tests/test_podman_compose.py +++ b/tests/test_podman_compose.py @@ -51,20 +51,25 @@ class TestPodmanCompose(unittest.TestCase, RunSubprocessMixin): '{{.Image}}', ] - command_down = [ - "podman", - "rmi", - "--force", - "localhost/subdir_test:me", - "docker.io/library/busybox", - ] - self.run_subprocess_assert_returncode(command_up) # check container was created and exists out, _ = self.run_subprocess_assert_returncode(command_check_container) self.assertEqual(out, b'localhost/subdir_test:me\n') # cleanup test image(tags) - self.run_subprocess_assert_returncode(command_down) + self.run_subprocess_assert_returncode([ + str(main_path.joinpath("podman_compose.py")), + "-f", + str(main_path.joinpath("tests", "extends_w_file_subdir", "docker-compose.yml")), + "down", + ]) + + self.run_subprocess_assert_returncode([ + "podman", + "rmi", + "--force", + "localhost/subdir_test:me", + ]) + # check container did not exists anymore out, _ = self.run_subprocess_assert_returncode(command_check_container) self.assertEqual(out, b'')