fix(iwooos): prioritize Wazuh posture claim
Some checks failed
CD Pipeline / select-latest-carrier (push) Successful in 1m0s
CD Pipeline / workflow-shape (push) Successful in 1s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 1m22s
CD Pipeline / revalidate-deploy-carrier (push) Successful in 30s
CD Pipeline / revalidate-post-deploy-carrier (push) Has been cancelled
CD Pipeline / post-deploy-checks (push) Has been cancelled
CD Pipeline / build-and-deploy (push) Has been cancelled

This commit is contained in:
Your Name
2026-07-22 17:25:42 +08:00
parent fd92134e60
commit 3ba45f5efd
2 changed files with 33 additions and 12 deletions

View File

@@ -3295,6 +3295,11 @@ async def test_execution_broker_stdin_replay_never_enters_apply(
"claim_stale_pending_check_modes",
no_claims,
)
monkeypatch.setattr(
service,
"claim_pending_check_modes",
no_claims,
)
monkeypatch.setattr(
service,
"claim_stdin_boundary_failed_check_modes",
@@ -4139,15 +4144,27 @@ def test_ansible_claim_query_limits_recent_candidate_backlog() -> None:
def test_ansible_claim_query_honors_bounded_execution_priority_before_fifo() -> None:
source = inspect.getsource(claim_pending_check_modes)
assert "P0-03-WAZUH-MANAGER-POSTURE" in source
assert "candidate.input ->> 'work_item_id' LIKE 'P0-%'" in source
assert "alert_webhook_controlled_router" in source
assert "ELSE 30" in source
assert "candidate.input ->> 'execution_priority'" in source
assert "LEAST(" in source
assert "100" in source
assert source.index("P0-03-WAZUH-MANAGER-POSTURE") < source.index(
"candidate.input ->> 'work_item_id' LIKE 'P0-%'"
)
assert source.index("execution_priority") < source.index("candidate.created_at ASC")
def test_broker_claims_fresh_p0_before_general_replay_lanes() -> None:
source = inspect.getsource(run_pending_check_modes_once)
assert source.index("fresh_claims = (") < source.index("reclaimed_claims = (")
assert "limit=min(1, remaining_limit)" in source
assert source.index("*fresh_claims,") < source.index("*reclaimed_claims,")
def test_ansible_transport_blocker_detects_repair_forced_command_denial() -> None:
blockers = detect_ansible_transport_blockers(
"fatal: host unreachable REPAIR_DENIED:invalid_command",