tests: LLM unit integrity, sudo-password leak guard, deploy LLM coverage

New seams (written first, red against the pre-merge tree):
- llm_units.bats: every scripts/*.service unit points at files that
  exist in this repo (the merged checkout path), env files included
- llm_secrets.bats: the live sudo password is never tracked (the
  vllmScripts AGENTS.md once documented it)
- deployment_flow.bats: deploy.sh must restart the LLM services on
  both targets and health-check both endpoints (7770, 52625)
- helpers.bash: has_no_leaked_sudo_pw (two-part assembly, same
  pattern as the gitea check)
This commit is contained in:
Frank committed 2026-08-22 15:49:44 -07:00
1 parent 02f92386f8
commit 8001132744
4 files changed
+131 -1

No files matched your search

+23 -1
View File
@@ -1,7 +1,8 @@
#!/usr/bin/env bats
# Seam: target reachability and deployment flow integrity.
# These tests assert the deployment contract copied from vllmScripts:
# These tests assert the deployment contract of the unified repo:
# - a deploy.sh exists and accepts <dankclaw|dankserver> and --dry-run
# - deploy.sh covers both the podman stack and the LLM fleet services
# - every host referenced in the repo is reachable over SSH (dank@host)
# - the local git remote is configured before deploy is attempted
# Reachability tests are SKIPPED when the target is unreachable so the suite
@@ -53,6 +54,27 @@ load helpers
grep -q 'podman restart caddy' "$REPO_ROOT/scripts/deploy.sh"
}
# The unified deploy.sh must manage the LLM fleet services on both hosts:
# frank-default-small (dankserver, :7770) and frank-default-large (dankclaw,
# :52625). A deploy that only restarts the podman stack leaves the LLM
# units pointing at the retired vllmScripts checkout.
@test "deploy.sh restarts the LLM services on both targets" {
grep -q 'frank-default-small' "$REPO_ROOT/scripts/deploy.sh"
grep -q 'frank-default-large' "$REPO_ROOT/scripts/deploy.sh"
}
@test "deploy.sh health-checks both LLM endpoints" {
grep -qE '7770' "$REPO_ROOT/scripts/deploy.sh"
grep -qE '52625' "$REPO_ROOT/scripts/deploy.sh"
}
@test "deploy.sh pulls on the merged checkout on both targets" {
# Both targets run the whole stack (podman + LLM) from one checkout.
local count
count=$(grep -c '/home/dank/serverAppConfigs' "$REPO_ROOT/scripts/deploy.sh")
[ "$count" -ge 2 ]
}
@test "deploy.sh Caddyfile render survives a slash-bearing bcrypt hash" {
local hash='$2a$14$dndiQ9EaycJv0w3Gp2oAYO/xH6O9x2ZRhMLJdCxrgi9rMn1te9D/spy'
local rendered