mirror of
https://github.com/containers/podman-compose.git
synced 2024-11-25 09:23:31 +01:00
tests/integration: Automate 'env-tests' manual test
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
This commit is contained in:
parent
585d344d0a
commit
0d24c41afb
@ -1,5 +0,0 @@
|
|||||||
running the following command should give myval2
|
|
||||||
|
|
||||||
```
|
|
||||||
podman_compose run -l monkey -e ZZVAR1=myval2 env-test
|
|
||||||
```
|
|
38
tests/integration/test_podman_compose_env.py
Normal file
38
tests/integration/test_podman_compose_env.py
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
# SPDX-License-Identifier: GPL-2.0
|
||||||
|
|
||||||
|
import os
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
from tests.integration.test_podman_compose import podman_compose_path
|
||||||
|
from tests.integration.test_podman_compose import test_path
|
||||||
|
from tests.integration.test_utils import RunSubprocessMixin
|
||||||
|
|
||||||
|
|
||||||
|
def compose_yaml_path():
|
||||||
|
return os.path.join(os.path.join(test_path(), "env-tests"), "container-compose.yml")
|
||||||
|
|
||||||
|
|
||||||
|
class TestComposeEnv(unittest.TestCase, RunSubprocessMixin):
|
||||||
|
"""Test that inline environment variable overrides environment variable from compose file."""
|
||||||
|
|
||||||
|
def test_env(self):
|
||||||
|
try:
|
||||||
|
output, _ = self.run_subprocess_assert_returncode([
|
||||||
|
podman_compose_path(),
|
||||||
|
"-f",
|
||||||
|
compose_yaml_path(),
|
||||||
|
"run",
|
||||||
|
"-l",
|
||||||
|
"monkey",
|
||||||
|
"-e",
|
||||||
|
"ZZVAR1=myval2",
|
||||||
|
"env-test",
|
||||||
|
])
|
||||||
|
self.assertIn("ZZVAR1='myval2'", str(output))
|
||||||
|
finally:
|
||||||
|
self.run_subprocess_assert_returncode([
|
||||||
|
podman_compose_path(),
|
||||||
|
"-f",
|
||||||
|
compose_yaml_path(),
|
||||||
|
"down",
|
||||||
|
])
|
Loading…
Reference in New Issue
Block a user