Add backend capability cache reset helper for jail service tests

This commit is contained in:
2026-04-14 10:24:14 +02:00
parent 41a67d52ab
commit cee5372690
3 changed files with 17 additions and 3 deletions

View File

@@ -248,6 +248,18 @@ async def _check_backend_cmd_supported(
return _backend_cmd_supported
async def _reset_backend_capability_cache() -> None:
"""Reset the cached backend/idle capability detection state.
This helper is intended for test isolation and for any scenario where the
cached probe result must be invalidated before the next detection attempt.
"""
global _backend_cmd_supported
async with _backend_cmd_lock:
_backend_cmd_supported = None
# ---------------------------------------------------------------------------
# Public API — Jail listing & detail
# ---------------------------------------------------------------------------