Orchestrata Ultimate › Tests › Reference › kernel › test_pam_enforcer
Tests reference — tests/kernel/test_pam_enforcer.py
Module of tests/kernel, split out because the directory page would be too large.
Prose pending.
tests/kernel/test_pam_enforcer.py
source · 46 tests · 1113 lines
Tests for kernel.pam_enforcer using real Prolog.
Covers: core.paths, kernel.pam_enforcer, governance.escalation_handler/ (package)
| Kind | Name | Line | Description |
|---|---|---|---|
| function | test_pam_enforcer_constructor |
91 | Constructor stores prolog bridge and initializes empty violations. |
| function | test_pam_enforcer_constructor_with_graph |
99 | Constructor stores optional Graph audit client. |
| function | test_get_violations_returns_copy |
110 | get_violations returns a shallow copy of violations. |
| function | test_validate_authority_authorized |
125 | Sender owns target directly — AUTHORIZED. |
| function | test_validate_authority_delegated |
136 | Sender has delegated authority — AUTHORIZED. |
| function | test_validate_authority_denied |
149 | Sender has no authority — DENIED and violation logged. |
| function | test_validate_authority_denied_no_owner |
160 | Denied with no known owner. |
| function | test_check_ownership_valid |
173 | Volk owns component directly — VALID. |
| function | test_check_ownership_delegated |
183 | Volk has active temporary ownership — DELEGATED. |
| function | test_check_ownership_expired |
196 | Temporary ownership has expired — EXPIRED. |
| function | test_check_ownership_invalid |
207 | Volk does not own component — INVALID with actual owner. |
| function | test_enforce_boundary_allowed |
220 | Cross-boundary access allowed — ALLOWED. |
| function | test_enforce_boundary_allowed_no_exception |
230 | Allowed but no exception granted (public component). |
| function | test_enforce_boundary_denied |
241 | Cross-boundary denied — DENIED and violation logged. |
| function | test_check_permission_granted |
257 | Permission exists and is permanent — GRANTED. |
| function | test_check_permission_temporary |
267 | Permission exists with active grant — TEMPORARY_GRANT. |
| function | test_check_permission_denied |
279 | No permission — DENIED and violation logged. |
| function | test_delegate_ownership_success |
294 | Valid owner can delegate resource. |
| function | test_delegate_ownership_failure |
301 | Invalid owner cannot delegate. |
| function | test_grant_temporary_permission |
308 | Grant temporary permission asserts fact. |
| function | test_violation_log_truncation |
320 | Violation log is truncated when it exceeds max size. |
| function | test_log_violation_with_graph |
340 | Violations are forwarded to Graph when configured. |
| function | test_escalation_manager_constructor |
359 | Constructor stores prolog, graph, timeout and empty escalations. |
| function | test_escalation_manager_constructor_with_escalations |
368 | Constructor accepts pre-populated escalations dict. |
| function | test_detect_conflict_required |
394 | Prolog says escalation required — returns Conflict. |
| function | test_detect_conflict_not_required |
410 | Prolog says no escalation — returns None. |
| function | test_get_escalation_path_from_prolog |
474 | Prolog returns a path — parsed into EscalationPath. |
| function | test_get_escalation_path_default |
496 | Prolog returns nothing — falls back to default path. |
| function | test_escalate_creates_escalation |
567 | Escalate creates and stores an EscalationResult. |
| function | test_escalate_with_graph |
592 | Escalation is logged to Graph when configured. |
| function | test_resolve_success |
621 | Resolve updates escalation status to RESOLVED. |
| function | test_resolve_missing_id |
649 | Resolve returns False for unknown escalation ID. |
| function | test_resolve_with_graph |
661 | Resolution is logged to Graph when configured. |
| function | test_timeout_stale |
699 | Stale escalations are timed out. |
| function | test_timeout_stale_ignores_resolved |
720 | Resolved escalations are not timed out. |
| function | test_timeout_stale_with_graph |
744 | Timeouts are logged to Graph when configured. |
| function | test_get_escalation_missing |
779 | get_escalation returns None for unknown ID. |
| function | test_get_all_escalations |
785 | get_all_escalations returns all stored results. |
| function | test_multi_hop_constructor |
808 | Constructor wires pam, prolog, redis, graph and creates handler. |
| function | test_route_escalation_existing |
833 | route_escalation returns first authority when escalation exists. |
| function | test_route_escalation_missing |
852 | route_escalation returns None for missing escalation. |
| function | test_multi_hop_escalate |
865 | multi_hop_escalate delegates to advanced handler. |
| function | test_validate_authority_prolog_exception |
904 | Prolog exception during ownership check is handled gracefully. |
| function | test_check_ownership_prolog_exception |
957 | Prolog exception during ownership check falls back to invalid. |
| function | test_enforce_boundary_prolog_exception |
1010 | Prolog exception during boundary check falls back to denied. |
| function | test_check_permission_prolog_exception |
1063 | Prolog exception during permission check falls back to denied. |