Skip to content

Commit 0d24c41

Browse files
committed
tests/integration: Automate 'env-tests' manual test
Signed-off-by: Monika Kairaityte <[email protected]>
1 parent 585d344 commit 0d24c41

File tree

2 files changed

+38
-5
lines changed

2 files changed

+38
-5
lines changed

tests/integration/env-tests/README.md

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
3+
import os
4+
import unittest
5+
6+
from tests.integration.test_podman_compose import podman_compose_path
7+
from tests.integration.test_podman_compose import test_path
8+
from tests.integration.test_utils import RunSubprocessMixin
9+
10+
11+
def compose_yaml_path():
12+
return os.path.join(os.path.join(test_path(), "env-tests"), "container-compose.yml")
13+
14+
15+
class TestComposeEnv(unittest.TestCase, RunSubprocessMixin):
16+
"""Test that inline environment variable overrides environment variable from compose file."""
17+
18+
def test_env(self):
19+
try:
20+
output, _ = self.run_subprocess_assert_returncode([
21+
podman_compose_path(),
22+
"-f",
23+
compose_yaml_path(),
24+
"run",
25+
"-l",
26+
"monkey",
27+
"-e",
28+
"ZZVAR1=myval2",
29+
"env-test",
30+
])
31+
self.assertIn("ZZVAR1='myval2'", str(output))
32+
finally:
33+
self.run_subprocess_assert_returncode([
34+
podman_compose_path(),
35+
"-f",
36+
compose_yaml_path(),
37+
"down",
38+
])

0 commit comments

Comments
 (0)