2026-08-15 03:44:00 -03:00
|
|
|
"""Hermes gateway tool-environment and recovery manifest tests."""
|
2026-08-15 03:35:26 -03:00
|
|
|
|
|
|
|
|
from __future__ import annotations
|
|
|
|
|
|
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
|
|
import yaml
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
|
|
|
HERMES = ROOT / "services/hermes"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _deployment() -> dict:
|
|
|
|
|
return yaml.safe_load((HERMES / "agent-deployment.yaml").read_text())
|
|
|
|
|
|
|
|
|
|
|
2026-08-15 03:44:00 -03:00
|
|
|
def test_gateway_loads_tool_environment_before_s6_entrypoint() -> None:
|
2026-08-15 03:35:26 -03:00
|
|
|
pod = _deployment()["spec"]["template"]["spec"]
|
|
|
|
|
init = {item["name"]: item for item in pod["initContainers"]}
|
|
|
|
|
containers = {item["name"]: item for item in pod["containers"]}
|
|
|
|
|
|
|
|
|
|
assert "repair-cassandra-kanban" in init
|
2026-08-15 03:44:00 -03:00
|
|
|
hermes = containers["hermes"]
|
|
|
|
|
assert hermes["command"] == ["/bin/sh", "-ec"]
|
|
|
|
|
startup = hermes["args"][0]
|
|
|
|
|
assert startup.index(". /opt/data/.env") < startup.index("exec /init")
|
|
|
|
|
assert "exec /init /opt/hermes/docker/main-wrapper.sh gateway run" in startup
|