mirror of
https://github.com/containers/podman-compose.git
synced 2025-05-01 04:44:43 +02:00
- Change compose-up to create then start container to enforce dependency condition check - Skip running compose-down when there are no active containers - Skip dependency health check to avoid compose-up hang for podman prior to 4.6.0, which doesn't support --condition healthy - Add relevant integration test case - Relax the pylint rules for test code Signed-off-by: Justin Zhang <schnell18@gmail.com>
47 lines
1.3 KiB
Python
47 lines
1.3 KiB
Python
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
|
|
import os
|
|
import unittest
|
|
|
|
from tests.integration.test_utils import RunSubprocessMixin
|
|
from tests.integration.test_utils import podman_compose_path
|
|
from tests.integration.test_utils import test_path
|
|
|
|
|
|
class TestFilesystem(unittest.TestCase, RunSubprocessMixin):
|
|
def test_compose_symlink(self):
|
|
"""The context of podman-compose.yml should come from the same directory as the file even
|
|
if it is a symlink
|
|
"""
|
|
|
|
compose_path = os.path.join(test_path(), "filesystem/compose_symlink/docker-compose.yml")
|
|
|
|
try:
|
|
self.run_subprocess_assert_returncode([
|
|
podman_compose_path(),
|
|
"-f",
|
|
compose_path,
|
|
"up",
|
|
"-d",
|
|
"container1",
|
|
])
|
|
|
|
out, _ = self.run_subprocess_assert_returncode([
|
|
podman_compose_path(),
|
|
"-f",
|
|
compose_path,
|
|
"logs",
|
|
"container1",
|
|
])
|
|
|
|
self.assertEqual(out, b'data_compose_symlink\n')
|
|
|
|
finally:
|
|
out, _ = self.run_subprocess_assert_returncode([
|
|
podman_compose_path(),
|
|
"-f",
|
|
compose_path,
|
|
"down",
|
|
])
|