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

@@ -192,7 +192,7 @@ class TestListJails:
fail2ban log.
"""
# Reset the capability cache to test detection.
jail_service._backend_cmd_supported = None
await jail_service._reset_backend_capability_cache()
responses = {
"status": _make_global_status("sshd"),
@@ -217,7 +217,7 @@ class TestListJails:
async def test_backend_idle_commands_supported(self) -> None:
"""list_jails detects and sends backend/idle commands when supported."""
# Reset the capability cache to test detection.
jail_service._backend_cmd_supported = None
await jail_service._reset_backend_capability_cache()
responses = {
"status": _make_global_status("sshd"),
@@ -243,7 +243,7 @@ class TestListJails:
async def test_backend_idle_commands_cached_after_first_probe(self) -> None:
"""list_jails caches capability result and reuses it across polling cycles."""
# Reset the capability cache.
jail_service._backend_cmd_supported = None
await jail_service._reset_backend_capability_cache()
responses = {
"status": _make_global_status("sshd, nginx"),