Files
aios/tests/aios_v2_candidate/test_v2r1c6_release_consistency.py
T

40 lines
1.7 KiB
Python

from __future__ import annotations
import json
from pathlib import Path
ROOT = Path(__file__).parents[2]
def test_version_and_candidate_binding():
assert (ROOT / "VERSION").read_text(encoding="utf-8").strip() == "V2R1C7"
metadata = json.loads((ROOT / "versions/V2R1C6.json").read_text(encoding="utf-8"))
assert metadata["version"] == "V2R1C6"
assert metadata["base_oid"] == "a33e2593967a180c89d44454350ccaeaf3f79b25"
assert metadata["candidate_branch"] == "agent/v2r1c6-mainline-reconciliation-20260806"
assert metadata["production_deployed"] is False
def test_release_invariants_are_frozen():
metadata = json.loads((ROOT / "versions/V2R1C6.json").read_text(encoding="utf-8"))
assert metadata["tag_created"] is False
assert metadata["baseline_changed"] is False
rollback = json.loads((ROOT / "deploy/aios-v2/v2r1c6-rollback.json").read_text(encoding="utf-8"))
assert rollback["previous_tag_oid"] == "9e65bd59baea392294c0f253046d3ab116f63145"
assert rollback["previous_target_oid"] == "aa60e891547abd7e215af7cf2bf3f21fd23541da"
def test_artifact_digest_is_bound():
from conftest import load_module
privacy = load_module("active-runtime/app/v2r1c6_privacy_tools.py")
metadata = json.loads((ROOT / "versions/V2R1C6.json").read_text(encoding="utf-8"))
assert privacy.sha256_file(ROOT / metadata["artifact_path"]) == metadata["artifact_sha256"]
def test_systemd_candidate_is_loopback_and_write_disabled():
service = (ROOT / "deploy/aios-v2/systemd/aios-v2r1c6-production.service").read_text(encoding="utf-8")
assert "IPAddressAllow=localhost" in service
assert "AIOS_GITOPS_WRITES_ENABLED=false" in service
assert "NoNewPrivileges=true" in service
assert "ProtectSystem=strict" in service