Skip to content

Commit

Permalink
tests/integration: Automate 'env-tests' manual test
Browse files Browse the repository at this point in the history
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
  • Loading branch information
mokibit committed Jul 20, 2024
1 parent d0a2a44 commit 255da76
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 5 deletions.
5 changes: 0 additions & 5 deletions tests/integration/env-tests/README.md

This file was deleted.

40 changes: 40 additions & 0 deletions tests/integration/test_podman_compose_env.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# 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():
""" "Returns the path to the compose file used for this test module"""
base_path = os.path.join(test_path(), "env-tests")
return os.path.join(base_path, "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",
])

0 comments on commit 255da76

Please sign in to comment.