test: resolve server temporary path aliases before containment checks (#1361)

* test: canonicalize temporary server directory

* test: compare resolved server configuration paths

* test: check canonical system-test configuration path

* test: expose path containment through pytest fixture

* test: request containment fixture in server checks

* test: use injected fixture in system path check
This commit is contained in:
Normann
2026-10-11 08:39:16 +02:00
committed by GitHub
parent 090ade790e
commit d072fec3f2
3 changed files with 35 additions and 13 deletions
+10 -1
View File
@@ -526,6 +526,15 @@ def cleanup_eos_eosdash(
assert not running, f"Test server cleanup timed out for PIDs {running}"
@pytest.fixture
def is_in_test_dir() -> Callable[[Path, str], bool]:
"""Check containment after resolving temporary-directory aliases."""
def contains(path: Path, eos_dir: str) -> bool:
return path.resolve().is_relative_to(Path(eos_dir).resolve())
return contains
@contextmanager
def server_base(
xprocess: XProcess,
@@ -565,7 +574,7 @@ def server_base(
eosdash_server = f"http://{eosdash_host}:{eosdash_port}"
eos_tmp_dir = tempfile.TemporaryDirectory()
eos_dir = str(eos_tmp_dir.name)
eos_dir = str(Path(eos_tmp_dir.name).resolve())
eos_general_data_folder_path = str(Path(eos_dir) / "data")
process_name = f"eos-{Path(eos_dir).name}"
owned_processes: list[psutil.Process] = []