Files
awoooi/scripts/reboot-recovery/tests/test_post_start_quick_check_contract.py
Your Name 709825a89f
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / build-and-deploy (push) Has been cancelled
CD Pipeline / post-deploy-checks (push) Has been cancelled
CD Pipeline / tests (push) Has been cancelled
fix(recovery): bound post reboot summary readbacks
2026-06-30 20:22:51 +08:00

33 lines
1.3 KiB
Python

from __future__ import annotations
from pathlib import Path
ROOT = Path(__file__).resolve().parents[3]
SCRIPT = ROOT / "scripts" / "reboot-recovery" / "post-start-quick-check.sh"
def test_post_start_self_checks_can_run_locally_on_110() -> None:
text = SCRIPT.read_text(encoding="utf-8")
assert "is_local_target()" in text
assert 'ips="$(local_ip_list)"' in text
assert 'local_ip_list | grep' not in text
assert 'bash -lc "$command"' in text
assert 'SSH_COMMAND_TIMEOUT_SECONDS="${SSH_COMMAND_TIMEOUT_SECONDS:-25}"' in text
assert "printf -v quoted_command '%q' \"$command\"" in text
assert '-o ConnectionAttempts=1' in text
assert '-o ServerAliveInterval=5' in text
assert '-o ServerAliveCountMax=1' in text
assert '-o NumberOfPasswordPrompts=0' in text
assert "timeout ${SSH_COMMAND_TIMEOUT_SECONDS}s bash -lc ${quoted_command}" in text
def test_runner_pressure_is_capacity_evidence_after_routes_recover() -> None:
text = SCRIPT.read_text(encoding="utf-8")
assert "service_route_recovered()" in text
assert "capacity_or_runner_issue()" in text
assert "cold-start non-route blockers retained as capacity/freshness evidence" in text
assert 'capacity_or_runner_issue "110 host pressure gate is blocking"' in text