]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
tests: basic configuration
authorIker Pedrosa <ipedrosa@redhat.com>
Fri, 8 Nov 2024 12:46:51 +0000 (13:46 +0100)
committerSerge Hallyn <serge@hallyn.com>
Sat, 11 Jan 2025 02:21:07 +0000 (20:21 -0600)
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
.gitignore
tests/system/conftest.py [new file with mode: 0644]
tests/system/mhc.yaml [new file with mode: 0644]
tests/system/py.typed [new file with mode: 0644]
tests/system/pyproject.toml [new file with mode: 0644]
tests/system/pytest.ini [new file with mode: 0644]
tests/system/requirements.txt [new file with mode: 0644]
tests/system/setup.cfg [new file with mode: 0644]

index 6a0e0b93ade28dc54121e486f11f395ba74cfe55..3d6d91c80c4edb34557c2b507f5d00664a8ef092 100644 (file)
@@ -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 (file)
index 0000000..8ddd638
--- /dev/null
@@ -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 (file)
index 0000000..38107b6
--- /dev/null
@@ -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 (file)
index 0000000..e69de29
diff --git a/tests/system/pyproject.toml b/tests/system/pyproject.toml
new file mode 100644 (file)
index 0000000..6e34cc0
--- /dev/null
@@ -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 (file)
index 0000000..bedde87
--- /dev/null
@@ -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 (file)
index 0000000..e526a92
--- /dev/null
@@ -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 (file)
index 0000000..8a9b800
--- /dev/null
@@ -0,0 +1,9 @@
+[flake8]
+max-line-length = 119
+ignore = E203,W503
+exclude = .venv
+
+[pycodestyle]
+max-line-length = 119
+ignore = E203,W503
+exclude = .venv