berth updates

This commit is contained in:
2026-09-14 07:28:50 -03:00
parent a9df70cde0
commit 974679a432
6 changed files with 161 additions and 35 deletions

View File

@@ -169,6 +169,32 @@ check "generated output is ignored" "yes" \
check "key material is ignored" "yes" \
"$(cd .. && git check-ignore -q ctrl/.secrets/vpn/any.key && echo yes || echo no)"
note "capture and the checks that read it — three bugs found by running, 2026-09-14"
# 1. A placed service's upstream is DERIVED (✖ B9). Anything reading the raw
# `upstream` field sees "" and skips it — which is how vpn.sh's bindings
# invariant, the "my configurations broke" detector, went quiet the day
# placement landed while still printing OK. Vacuous passes are the failure
# mode this whole file exists to catch.
check "a placed service resolves to a real upstream" "10.8.0.2:3000" \
"$(bash -c 'source ./lib/config.sh; source ./lib/estate.sh; load_config >/dev/null;
service_upstream "" local nrft 3000')"
check "bindings actually inspects a service" "1" \
"$(bash ./vpn.sh check 2>/dev/null | grep -c 'no service currently has an overlay address' \
| awk '{print 1-$1}')"
# 2. A listen port belongs to a PEER. The roaming peer's is an ephemeral source
# port; writing it to the overlay renames the port the firewall rule is
# checked against — silently, since both are plausible integers.
check "a roaming peer's port is not the overlay's port" "51820" \
"$(python3 -c 'import json;print(json.load(open("../estate/mcrn.json"))["vpn"]["overlays"]["estate"]["listen_port"])')"
# 3. _status is always non-empty — capture rewrites it rather than clearing it —
# so a warning gated on "is it set" can never turn off, including after the
# capture it asks for. Gate on the structure instead.
check "the capture warning clears once keys are in" "0" \
"$(bash ./check.sh 2>/dev/null | grep -c 'public keys not captured')"
note "every STALE entry has a check here"
# Not "$0": line 15 cd's into this script's directory, so a relative $0 no