Debian Codegraph @

tests/integration/filesystem/test_podman_compose_filesystem.py

raw symbols SCIP
1 # SPDX-License-Identifier: GPL-2.0
2
3
4 import os
5 import unittest
6
7 from tests.integration.test_utils import RunSubprocessMixin
8 from tests.integration.test_utils import podman_compose_path
9 from tests.integration.test_utils import test_path
10
11
12 class TestFilesystem(unittest.TestCase, RunSubprocessMixin):
13 def test_compose_symlink(self) -> None:
14 """The context of podman-compose.yml should come from the same directory as the file even
15 if it is a symlink
16 """
17
18 compose_path = os.path.join(test_path(), "filesystem/compose_symlink/docker-compose.yml")
19
20 try:
21 self.run_subprocess_assert_returncode([
22 podman_compose_path(),
23 "-f",
24 compose_path,
25 "up",
26 "-d",
27 "container1",
28 ])
29
30 out, _ = self.run_subprocess_assert_returncode([
31 podman_compose_path(),
32 "-f",
33 compose_path,
34 "logs",
35 "--no-log-prefix",
36 "--no-color",
37 "container1",
38 ])
39
40 self.assertEqual(out, b'data_compose_symlink\n')
41
42 finally:
43 out, _ = self.run_subprocess_assert_returncode([
44 podman_compose_path(),
45 "-f",
46 compose_path,
47 "down",
48 ])