NEW 490e2771d live for mosaic-stack, activation 20261020T075800Z-490e2771d3d0, store 3i. W0-W10 pass;
stops at W9 (assistant idle stop, mos-0948) and S2b/B (old chief end rows in the backup, mos-0950).
68 lines
2.9 KiB
Bash
Executable File
68 lines
2.9 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# P4-P6 of agents/sage/work/window-plan/repin-rows-177-185.md (2ea05700b), read only.
|
|
# P4 the tunnel unit, P5 the four REPO scripts against NEW, P6 the 7332 matrix on OLD (matrix-old.txt).
|
|
# usage: p456.sh p4|p5|p6
|
|
set -uo pipefail
|
|
REPO=/mnt/storage/src/mosaic-stack
|
|
WIN=$REPO/agents/darkwing/work/window-rows-177-185
|
|
NEW=490e2771d3d057ab76991e2c7859cd251857e64c
|
|
FILES=(scripts/stack-release.sh scripts/webui-service.sh scripts/bus-service.sh scripts/stack-copy.sh)
|
|
# The plan's <32 letters>: a fixed dummy, not a secret. matrix-new.txt uses the same value.
|
|
PROOF=abcdefghijklmnopqrstuvwxyzabcdef
|
|
|
|
p4() {
|
|
echo "# P4 $(date -u +%FT%TZ)"
|
|
local out; out="$(systemctl --user show mosaic-preview-tunnel.service -p ExecStart -p DropInPaths)"; local rc=$?
|
|
printf '%s\n' "$out"; echo "# exit $rc"
|
|
local specs; specs="$(grep -oE 'R:[^ ;]+' <<<"$out")"
|
|
local n; n="$(grep -c . <<<"$specs")"
|
|
echo "# R: specs ($n): $(tr '\n' ' ' <<<"$specs")"
|
|
local drop; drop="$(sed -n 's/^DropInPaths=//p' <<<"$out")"
|
|
if [[ $rc -eq 0 && $n -eq 1 && "$specs" == "R:0.0.0.0:7332:127.0.0.1:7332" && -z "$drop" ]]; then
|
|
echo "P4 PASS: one R: spec R:0.0.0.0:7332:127.0.0.1:7332, DropInPaths empty"
|
|
else
|
|
echo "P4 FAIL"; return 3
|
|
fi
|
|
}
|
|
|
|
p5() {
|
|
echo "# P5 $(date -u +%FT%TZ); HEAD $(git -C $REPO rev-parse HEAD)"
|
|
git -C $REPO diff --quiet $NEW HEAD -- "${FILES[@]}"; local d=$?
|
|
echo "# git diff --quiet $NEW HEAD -- ${FILES[*]}: exit $d"
|
|
local st; st="$(git -C $REPO status --porcelain -- "${FILES[@]}")"; local s=$?
|
|
echo "# git status --porcelain (exit $s): [${st}]"
|
|
for f in "${FILES[@]}"; do echo "# $f HEAD blob $(git -C $REPO rev-parse HEAD:$f) NEW blob $(git -C $REPO rev-parse $NEW:$f)"; done
|
|
if [[ $d -eq 0 && $s -eq 0 && -z "$st" ]]; then echo "P5 PASS"; else echo "P5 FAIL"; return 3; fi
|
|
}
|
|
|
|
# one matrix line: label, then curl arguments; prints "<label> <code> <error or ok field>"
|
|
req() {
|
|
local label="$1"; shift
|
|
local body; body="$(mktemp -p "${TMPDIR:-/tmp}")"
|
|
local code; code="$(curl -s -m 10 -o "$body" -w '%{http_code}' "$@")"
|
|
local field; field="$(node -e '
|
|
let s = require("fs").readFileSync(process.argv[1], "utf8"), j;
|
|
try { j = JSON.parse(s); } catch { console.log("non-json " + s.length + " bytes"); process.exit(0); }
|
|
console.log(j.error !== undefined ? "error=" + JSON.stringify(j.error) : "ok=" + JSON.stringify(j.ok));
|
|
' "$body")"
|
|
rm -f "$body"
|
|
echo "$label $code $field"
|
|
}
|
|
|
|
p6() {
|
|
req a http://127.0.0.1:7332/healthz
|
|
req b -H 'Host: mosaic.woltje.com' http://127.0.0.1:7332/
|
|
req c -H 'Host: mosaic.woltje.com' -H "X-Mosaic-Proof: $PROOF" http://127.0.0.1:7332/
|
|
req d -H 'X-authentik-username: tester-probe' http://127.0.0.1:7332/
|
|
req e -H 'x-mosaic-tester: 1' http://127.0.0.1:7332/
|
|
req f -H 'X-authentik-username: tester-probe' http://127.0.0.1:7333/
|
|
req g -H "X-Mosaic-Proof: $PROOF" http://127.0.0.1:7333/
|
|
}
|
|
|
|
case "${1:-}" in
|
|
p4) p4 ;;
|
|
p5) p5 ;;
|
|
p6) p6 ;;
|
|
*) echo "usage: p456.sh p4|p5|p6" >&2; exit 2 ;;
|
|
esac
|