fix(windows99): accept scoped vmx alias confirmations
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 1m14s
CD Pipeline / post-deploy-checks (push) Has been cancelled
CD Pipeline / build-and-deploy (push) Has been cancelled
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 1m14s
CD Pipeline / post-deploy-checks (push) Has been cancelled
CD Pipeline / build-and-deploy (push) Has been cancelled
This commit is contained in:
@@ -313,6 +313,77 @@ def test_windows99_candidate_confirmation_validator_accepts_redacted_packet() ->
|
||||
assert payload["operation_boundaries"]["vm_power_change_performed"] is False
|
||||
|
||||
|
||||
def test_windows99_candidate_confirmation_accepts_scoped_missing_alias_subset() -> None:
|
||||
repair_package = build_windows99_vmx_source_repair_package(
|
||||
_scorecard(),
|
||||
generated_at="2026-07-03T11:21:00+08:00",
|
||||
)
|
||||
locator = build_windows99_vmx_source_locator_readback(
|
||||
_scorecard(),
|
||||
repair_package=repair_package,
|
||||
collector_receipt={
|
||||
"schema_version": "windows99_vmx_source_locator_receipt_v1",
|
||||
"collector_readback_present": True,
|
||||
"target_host_alias": "99",
|
||||
"target_vm_aliases": ["111"],
|
||||
"expected_vmx_path_present_count": 0,
|
||||
"candidate_source_count": 8,
|
||||
"candidate_source_fingerprint_count": 0,
|
||||
"alias_hint_candidate_count": 0,
|
||||
"identity_metadata_read": True,
|
||||
"bounded_identity_metadata_only": True,
|
||||
"identity_target_hint_count": 0,
|
||||
"identity_unassigned_ubuntu_candidate_count": 1,
|
||||
"locate_status": (
|
||||
"single_identity_unassigned_ubuntu_candidate_requires_confirmation"
|
||||
),
|
||||
},
|
||||
)
|
||||
locator["target_vm_aliases"] = ["111", "112", "120", "121", "188"]
|
||||
locator["missing_vmx_aliases"] = ["111", "112", "120", "121", "188"]
|
||||
|
||||
payload = validate_windows99_vmx_source_candidate_confirmation_packet(
|
||||
{
|
||||
"schema_version": "windows99_vmx_source_candidate_confirmation_packet_v1",
|
||||
"target_host_alias": "99",
|
||||
"target_vm_aliases": ["111"],
|
||||
"candidate_identity_kind": "verified_backup_path_fingerprint",
|
||||
"candidate_identity_evidence_ref": (
|
||||
"backup://awoooi/windows99/redacted-fingerprint-111"
|
||||
),
|
||||
"candidate_match_count": 1,
|
||||
"redacted_metadata_only": True,
|
||||
"bounded_identity_metadata_only": True,
|
||||
"path_fingerprint_only": True,
|
||||
"raw_path_output": False,
|
||||
"secret_value_read": False,
|
||||
"remote_write_performed": False,
|
||||
"host_reboot_performed": False,
|
||||
"vm_power_change_performed": False,
|
||||
"windows_registry_apply_performed": False,
|
||||
"scheduled_task_write_performed": False,
|
||||
"apply_requested": False,
|
||||
"vm_power_change_requested": False,
|
||||
},
|
||||
locator_readback=locator,
|
||||
)
|
||||
|
||||
assert payload["accepted"] is True
|
||||
assert payload["target_vm_aliases"] == ["111", "112", "120", "121", "188"]
|
||||
assert payload["missing_vmx_aliases"] == ["111", "112", "120", "121", "188"]
|
||||
assert payload["submitted_target_vm_aliases"] == ["111"]
|
||||
assert payload["validated_target_vm_aliases"] == ["111"]
|
||||
assert payload["rejected_fields"] == []
|
||||
plan = payload["projected_scoped_relink_dry_run_plan"]
|
||||
assert plan["ready"] is True
|
||||
assert plan["plan_id"] == "windows99-vmx-source-relink-dry-run-111"
|
||||
assert plan["target_selector"]["vm_aliases"] == ["111"]
|
||||
assert plan["target_selector"]["missing_vmx_aliases"] == ["111"]
|
||||
assert plan["apply_allowed_by_this_plan"] is False
|
||||
assert plan["remote_write_performed"] is False
|
||||
assert plan["vm_power_change_performed"] is False
|
||||
|
||||
|
||||
def test_windows99_candidate_confirmation_validator_rejects_sensitive_payload() -> None:
|
||||
locator = build_windows99_vmx_source_locator_readback(
|
||||
_scorecard(),
|
||||
|
||||
Reference in New Issue
Block a user