feat: stabilize fnos lan delivery flow

This commit is contained in:
kris
2026-03-27 13:49:30 +08:00
parent 32bc94f924
commit b35d653610
10 changed files with 667 additions and 14 deletions

View File

@@ -228,6 +228,42 @@ class ProductionBaselineTests(unittest.TestCase):
self.assertEqual(payload["account"]["username"], ctx["username"])
self.assertEqual(payload["mode"], "auto")
def test_repo_contains_fnos_lan_stack_deploy_entrypoint(self) -> None:
script_path = ROOT / "scripts" / "deploy_fnos_storyforge_lan_stack.sh"
self.assertTrue(script_path.exists(), str(script_path))
content = script_path.read_text(encoding="utf-8")
self.assertIn("deploy_fnos_cutvideo_tunnel.sh", content)
self.assertIn("deploy_fnos_storyforge_collector.sh", content)
self.assertIn("deploy_fnos_storyforge_web.sh", content)
def test_repo_contains_fnos_lan_smoke_script(self) -> None:
script_path = ROOT / "scripts" / "smoke_fnos_storyforge_lan.sh"
self.assertTrue(script_path.exists(), str(script_path))
content = script_path.read_text(encoding="utf-8")
for expected in [
"/healthz",
"/v2/auth/auto-session",
"/v2/integrations/health",
"/api/bootstrap",
"19181",
]:
self.assertIn(expected, content)
def test_healthz_exposes_lan_routing_summary(self) -> None:
response = self.client.get("/healthz")
self.assertEqual(response.status_code, 200, response.text)
payload = response.json()
self.assertIn("lanRouting", payload)
self.assertIn("cutvideoRouteMode", payload["lanRouting"])
self.assertIn("cutvideoBaseUrl", payload["lanRouting"])
def test_collector_deploy_script_exposes_health_retry_controls(self) -> None:
script_path = ROOT / "scripts" / "deploy_fnos_storyforge_collector.sh"
content = script_path.read_text(encoding="utf-8")
self.assertIn("COLLECTOR_HEALTH_RETRY_ATTEMPTS", content)
self.assertIn("COLLECTOR_HEALTH_RETRY_SLEEP_SEC", content)
self.assertNotIn("$(_attempt)", content)
def test_database_uses_wal_and_busy_timeout(self) -> None:
conn = self.core.db.connect()
try: