Files
CosmicClash/server/security/test_compose_manifests.py
T
2026-09-01 17:50:52 +01:00

33 lines
1.1 KiB
Python

from pathlib import Path
import unittest
ROOT = Path(__file__).parents[2]
class ComposeManifestTest(unittest.TestCase):
def test_allocated_fixture_is_independent_of_legacy_smoke(self):
allocated = (ROOT / "compose.allocated-smoke.yml").read_text()
legacy = (ROOT / "compose.phase6-smoke.yml").read_text()
self.assertIn("target: testkit-api", allocated)
self.assertIn('"18080:8080"', allocated)
self.assertNotIn("compose.phase6-smoke.yml", allocated)
self.assertNotIn("18080:8080", legacy)
self.assertNotIn("max-matches", allocated)
def test_allocated_runner_checks_durable_retry_and_shutdown(self):
runner = (ROOT / "scripts/verify_allocated_compose.sh").read_text()
for marker in (
"/v1/servers/compose-server/result",
"compose-result-key-123456",
"result_receipts",
"/v1/servers/compose-server/shutdown",
"SERVER_SHUTDOWN",
"down --volumes --remove-orphans",
):
self.assertIn(marker, runner)
if __name__ == "__main__":
unittest.main()