diff --git a/.gitignore b/.gitignore index 6a0e0b93a..3d6d91c80 100644 --- a/.gitignore +++ b/.gitignore @@ -54,3 +54,8 @@ test-driver /shadow-*.tar.* /lib/getdate.c /libsubid/subid.h + +.venv +__pycache__/ +tests/system/artifacts/ +tests/system/pytest.log diff --git a/tests/system/conftest.py b/tests/system/conftest.py new file mode 100644 index 000000000..8ddd63844 --- /dev/null +++ b/tests/system/conftest.py @@ -0,0 +1,18 @@ +# Configuration file for multihost tests. + +from __future__ import annotations + +from pytest_mh import MultihostPlugin + +from framework.config import ShadowMultihostConfig + +# Load additional plugins +pytest_plugins = ( + "pytest_mh", + "pytest_ticket", +) + + +def pytest_plugin_registered(plugin) -> None: + if isinstance(plugin, MultihostPlugin): + plugin.config_class = ShadowMultihostConfig diff --git a/tests/system/mhc.yaml b/tests/system/mhc.yaml new file mode 100644 index 000000000..38107b67d --- /dev/null +++ b/tests/system/mhc.yaml @@ -0,0 +1,12 @@ +provisioned_topologies: +- shadow +domains: +- id: shadow + hosts: + - hostname: shadow.test + role: shadow + conn: + type: podman + container: builder + artifacts: + - /var/log/* \ No newline at end of file diff --git a/tests/system/py.typed b/tests/system/py.typed new file mode 100644 index 000000000..e69de29bb diff --git a/tests/system/pyproject.toml b/tests/system/pyproject.toml new file mode 100644 index 000000000..6e34cc0c2 --- /dev/null +++ b/tests/system/pyproject.toml @@ -0,0 +1,11 @@ +[[tool.mypy.overrides]] +module = "jc.*" +ignore_missing_imports = true + +[tool.isort] +line_length = 119 +profile = "black" +add_imports = "from __future__ import annotations" + +[tool.black] +line-length = 119 diff --git a/tests/system/pytest.ini b/tests/system/pytest.ini new file mode 100644 index 000000000..bedde87c9 --- /dev/null +++ b/tests/system/pytest.ini @@ -0,0 +1,5 @@ +[pytest] +pythonpath = . framework +addopts = --strict-markers +testpaths = tests +ticket_tools = bz,gh,jira diff --git a/tests/system/requirements.txt b/tests/system/requirements.txt new file mode 100644 index 000000000..e526a92be --- /dev/null +++ b/tests/system/requirements.txt @@ -0,0 +1,5 @@ +flaky +jc +pytest +git+https://github.com/next-actions/pytest-mh@1.0.21 +git+https://github.com/next-actions/pytest-ticket diff --git a/tests/system/setup.cfg b/tests/system/setup.cfg new file mode 100644 index 000000000..8a9b800b7 --- /dev/null +++ b/tests/system/setup.cfg @@ -0,0 +1,9 @@ +[flake8] +max-line-length = 119 +ignore = E203,W503 +exclude = .venv + +[pycodestyle] +max-line-length = 119 +ignore = E203,W503 +exclude = .venv