a73x

7d56f0e2

test: sun_path refusals pinned in e2e; already-running pin carries the new clause

a73x   2026-08-10 18:37

Commit message
test: sun_path refusals pinned in e2e; already-running pin carries the new clause

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

test/e2e.sh
Old New
@@ -490,7 +490,20 @@ grep -q "transport command failed before a session started" "$OUT.dead" || {
490 grep -q "is muxd installed on the host" "$OUT.dead" && { 490 grep -q "is muxd installed on the host" "$OUT.dead" && {
491 echo "e2e FAIL: old lostMsg wording still emitted alongside the new pin" 491 echo "e2e FAIL: old lostMsg wording still emitted alongside the new pin"
492 cat "$OUT.dead"; exit 1; } 492 cat "$OUT.dead"; exit 1; }
493 rm -f "$OUT.dead" 493
494 # M13 spec amendment: a socket path past sun_path's 107 usable bytes is
495 # refused by name in both binaries, before either acts on it — the failure
496 # it replaced was a 2s poll ending in "daemon did not answer", a timeout
497 # story about a path that was doomed at parse.
498 LONGSOCK="/tmp/$(printf 'a%.0s' $(seq 1 110)).sock"
499 "$MUXD" dump --sock "$LONGSOCK" > "$OUT.long" 2>&1 && { echo "e2e FAIL: muxd accepted long sock"; exit 1; }
500 grep -q "muxd: socket path too long" "$OUT.long" || { echo "e2e FAIL:"; cat "$OUT.long"; exit 1; }
501 "$MUX" --sock "$LONGSOCK" > "$OUT.longc" 2>&1 && { echo "e2e FAIL: mux accepted long sock"; exit 1; }
502 grep -q "mux: socket path too long" "$OUT.longc" || { echo "e2e FAIL:"; cat "$OUT.longc"; exit 1; }
503 grep -q "daemon did not answer" "$OUT.longc" && { echo "e2e FAIL: still the timeout story"; cat "$OUT.longc"; exit 1; }
504 "$MUXD" --version --sock "$LONGSOCK" >/dev/null 2>&1 || { echo "e2e FAIL: --version refused over sock length"; exit 1; }
505
506 rm -f "$OUT.dead" "$OUT.long" "$OUT.longc"
494 507
495 # --- M7: aborting a reconnect exits cleanly. The client establishes a real 508 # --- M7: aborting a reconnect exits cleanly. The client establishes a real
496 # session (so reconnect is allowed), its daemon is then killed under it, and 509 # session (so reconnect is allowed), its daemon is then killed under it, and
@@ -1122,7 +1135,7 @@ LPERMS=$(stat -c %a "$MUXLOG")
1122 1135
1123 # Rerun: silent no-op beyond the already-running line, exit 0, same daemon. 1136 # Rerun: silent no-op beyond the already-running line, exit 0, same daemon.
1124 "$MUXD" start --sock "$SOCK8" 2> "$OUT.start2" 1137 "$MUXD" start --sock "$SOCK8" 2> "$OUT.start2"
1125 grep -q "already running on $SOCK8" "$OUT.start2" || { 1138 grep -q "already running on $SOCK8 (stop it first with \`muxd stop --sock $SOCK8\`" "$OUT.start2" || {
1126 echo "e2e FAIL: rerun did not say already running"; cat "$OUT.start2"; exit 1; } 1139 echo "e2e FAIL: rerun did not say already running"; cat "$OUT.start2"; exit 1; }
1127 "$MUXD" dump --sock "$SOCK8" | grep -q "start-works" || { 1140 "$MUXD" dump --sock "$SOCK8" | grep -q "start-works" || {
1128 echo "e2e FAIL: rerun replaced the daemon (marker gone)"; exit 1; } 1141 echo "e2e FAIL: rerun replaced the daemon (marker gone)"; exit 1; }