Exercise packaged runtime topology
This commit is contained in:
@@ -3,9 +3,11 @@ from __future__ import annotations
|
||||
import importlib.util
|
||||
import json
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
import unittest
|
||||
from unittest.mock import patch
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
@@ -52,6 +54,28 @@ class RuntimeImageSmokeTests(unittest.TestCase):
|
||||
with self.assertRaisesRegex(MODULE.SmokeError, "exact sha256"):
|
||||
MODULE.platform_image(path, "linux/arm64", "API")
|
||||
|
||||
def test_readiness_fails_immediately_when_container_exits(self) -> None:
|
||||
exited = subprocess.CompletedProcess([], 0, "false\n", "")
|
||||
logs = subprocess.CompletedProcess([], 0, "fatal startup error\n", "")
|
||||
with patch.object(MODULE, "_run", side_effect=(exited, logs)):
|
||||
with self.assertRaisesRegex(
|
||||
MODULE.SmokeError,
|
||||
"container exited before readiness: fatal startup error",
|
||||
):
|
||||
MODULE._wait_for(
|
||||
"WebUI",
|
||||
lambda: self.fail("probe must not run for an exited container"),
|
||||
timeout=60,
|
||||
container="web",
|
||||
)
|
||||
|
||||
def test_smoke_supplies_the_packaged_web_upstream_and_schema_contract(self) -> None:
|
||||
source = SCRIPT.read_text(encoding="utf-8")
|
||||
|
||||
self.assertIn('"--network-alias",\n "load-balancer"', source)
|
||||
self.assertIn("'core_system_settings'", source)
|
||||
self.assertIn("'core_runtime_nodes'", source)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user