mirror of
https://github.com/containers/podman-compose.git
synced 2025-08-09 13:54:59 +02:00
tests/integration: Add test for run
command failure exit code
Test is added to confirm that `run` command forwards non-zero failure exit code. Signed-off-by: Monika Kairaityte <monika@kibit.lt>
This commit is contained in:
@ -51,3 +51,26 @@ class TestComposeBuildFailMulti(unittest.TestCase, RunSubprocessMixin):
|
|||||||
compose_yaml_path(),
|
compose_yaml_path(),
|
||||||
"down",
|
"down",
|
||||||
])
|
])
|
||||||
|
|
||||||
|
def test_run_command_fail(self) -> None:
|
||||||
|
# test that run command is able to return other than "0" return code
|
||||||
|
try:
|
||||||
|
output, error = self.run_subprocess_assert_returncode(
|
||||||
|
[
|
||||||
|
podman_compose_path(),
|
||||||
|
"-f",
|
||||||
|
compose_yaml_path(),
|
||||||
|
"run",
|
||||||
|
"bad",
|
||||||
|
],
|
||||||
|
expected_returncode=125,
|
||||||
|
)
|
||||||
|
self.assertIn("RUN false", str(output))
|
||||||
|
self.assertIn("while running runtime: exit status 1", str(error))
|
||||||
|
finally:
|
||||||
|
self.run_subprocess_assert_returncode([
|
||||||
|
podman_compose_path(),
|
||||||
|
"-f",
|
||||||
|
compose_yaml_path(),
|
||||||
|
"down",
|
||||||
|
])
|
||||||
|
Reference in New Issue
Block a user