mirror of
https://github.com/containers/podman-compose.git
synced 2025-04-21 16:09:04 +02:00
tests/integration: Move test "deps" to corresponding directory
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
This commit is contained in:
parent
4c17ce2434
commit
21b9d385b2
1
tests/integration/deps/__init__.py
Normal file
1
tests/integration/deps/__init__.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
@ -87,6 +87,58 @@ class TestComposeBaseDeps(unittest.TestCase, RunSubprocessMixin):
|
|||||||
"down",
|
"down",
|
||||||
])
|
])
|
||||||
|
|
||||||
|
def test_podman_compose_run(self):
|
||||||
|
"""
|
||||||
|
This will test depends_on as well
|
||||||
|
"""
|
||||||
|
run_cmd = [
|
||||||
|
"coverage",
|
||||||
|
"run",
|
||||||
|
podman_compose_path(),
|
||||||
|
"-f",
|
||||||
|
os.path.join(test_path(), "deps", "docker-compose.yaml"),
|
||||||
|
"run",
|
||||||
|
"--rm",
|
||||||
|
"sleep",
|
||||||
|
"/bin/sh",
|
||||||
|
"-c",
|
||||||
|
"wget -q -O - http://web:8000/hosts",
|
||||||
|
]
|
||||||
|
|
||||||
|
out, _ = self.run_subprocess_assert_returncode(run_cmd)
|
||||||
|
self.assertIn(b"127.0.0.1\tlocalhost", out)
|
||||||
|
|
||||||
|
# Run it again to make sure we can run it twice. I saw an issue where a second run, with
|
||||||
|
# the container left up, would fail
|
||||||
|
run_cmd = [
|
||||||
|
"coverage",
|
||||||
|
"run",
|
||||||
|
podman_compose_path(),
|
||||||
|
"-f",
|
||||||
|
os.path.join(test_path(), "deps", "docker-compose.yaml"),
|
||||||
|
"run",
|
||||||
|
"--rm",
|
||||||
|
"sleep",
|
||||||
|
"/bin/sh",
|
||||||
|
"-c",
|
||||||
|
"wget -q -O - http://web:8000/hosts",
|
||||||
|
]
|
||||||
|
|
||||||
|
out, _ = self.run_subprocess_assert_returncode(run_cmd)
|
||||||
|
self.assertIn(b"127.0.0.1\tlocalhost", out)
|
||||||
|
|
||||||
|
# This leaves a container running. Not sure it's intended, but it matches docker-compose
|
||||||
|
down_cmd = [
|
||||||
|
"coverage",
|
||||||
|
"run",
|
||||||
|
podman_compose_path(),
|
||||||
|
"-f",
|
||||||
|
os.path.join(test_path(), "deps", "docker-compose.yaml"),
|
||||||
|
"down",
|
||||||
|
]
|
||||||
|
|
||||||
|
self.run_subprocess_assert_returncode(down_cmd)
|
||||||
|
|
||||||
|
|
||||||
class TestComposeConditionalDeps(unittest.TestCase, RunSubprocessMixin):
|
class TestComposeConditionalDeps(unittest.TestCase, RunSubprocessMixin):
|
||||||
def test_deps_succeeds(self):
|
def test_deps_succeeds(self):
|
@ -29,58 +29,6 @@ class TestPodmanCompose(unittest.TestCase, RunSubprocessMixin):
|
|||||||
self.run_subprocess_assert_returncode(up_cmd + ["--exit-code-from", "sh1"], 1)
|
self.run_subprocess_assert_returncode(up_cmd + ["--exit-code-from", "sh1"], 1)
|
||||||
self.run_subprocess_assert_returncode(up_cmd + ["--exit-code-from", "sh2"], 2)
|
self.run_subprocess_assert_returncode(up_cmd + ["--exit-code-from", "sh2"], 2)
|
||||||
|
|
||||||
def test_run(self):
|
|
||||||
"""
|
|
||||||
This will test depends_on as well
|
|
||||||
"""
|
|
||||||
run_cmd = [
|
|
||||||
"coverage",
|
|
||||||
"run",
|
|
||||||
podman_compose_path(),
|
|
||||||
"-f",
|
|
||||||
os.path.join(test_path(), "deps", "docker-compose.yaml"),
|
|
||||||
"run",
|
|
||||||
"--rm",
|
|
||||||
"sleep",
|
|
||||||
"/bin/sh",
|
|
||||||
"-c",
|
|
||||||
"wget -q -O - http://web:8000/hosts",
|
|
||||||
]
|
|
||||||
|
|
||||||
out, _ = self.run_subprocess_assert_returncode(run_cmd)
|
|
||||||
self.assertIn(b"127.0.0.1\tlocalhost", out)
|
|
||||||
|
|
||||||
# Run it again to make sure we can run it twice. I saw an issue where a second run, with
|
|
||||||
# the container left up, would fail
|
|
||||||
run_cmd = [
|
|
||||||
"coverage",
|
|
||||||
"run",
|
|
||||||
podman_compose_path(),
|
|
||||||
"-f",
|
|
||||||
os.path.join(test_path(), "deps", "docker-compose.yaml"),
|
|
||||||
"run",
|
|
||||||
"--rm",
|
|
||||||
"sleep",
|
|
||||||
"/bin/sh",
|
|
||||||
"-c",
|
|
||||||
"wget -q -O - http://web:8000/hosts",
|
|
||||||
]
|
|
||||||
|
|
||||||
out, _ = self.run_subprocess_assert_returncode(run_cmd)
|
|
||||||
self.assertIn(b"127.0.0.1\tlocalhost", out)
|
|
||||||
|
|
||||||
# This leaves a container running. Not sure it's intended, but it matches docker-compose
|
|
||||||
down_cmd = [
|
|
||||||
"coverage",
|
|
||||||
"run",
|
|
||||||
podman_compose_path(),
|
|
||||||
"-f",
|
|
||||||
os.path.join(test_path(), "deps", "docker-compose.yaml"),
|
|
||||||
"down",
|
|
||||||
]
|
|
||||||
|
|
||||||
self.run_subprocess_assert_returncode(down_cmd)
|
|
||||||
|
|
||||||
def test_up_with_ports(self):
|
def test_up_with_ports(self):
|
||||||
up_cmd = [
|
up_cmd = [
|
||||||
"coverage",
|
"coverage",
|
||||||
|
Loading…
Reference in New Issue
Block a user