2 Commits
Author SHA1 Message Date
Kristoffer Dalby 12fcb2217b ssh/tailssh: test exit-status frame ordering and stderr drain
Added before the fix so CI records the failure. Frame order is asserted
off the session interface rather than through a client, so it holds on
any GOOS instead of depending on how a particular client reacts.

Measured on CI against this commit, no fix yet:

  TestExitStatusPrecedesEOF   FAIL on darwin, linux/amd64 and the
        privileged linux job, 10/10 retries, classified permanent:
        got [eof exit-status], want [exit-status eof close]
  TestExitCodePassthrough     PASS on both
  TestStderrTailNotTruncated  PASS on both (guards a 2022 fix)

The ordering assertion is the only thing that pins this bug. Exit-code
assertions do not: OpenSSH 10.2p1 on darwin reads the pending
exit-status request after EOF just as linux does, so the wrong frame
order is invisible to the client's exit status over the direct-exec
path. The exit-status loss reported in #18256 comes from
/usr/bin/login -pq in the incubator path, which is a separate defect.

Updates #18256

Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
2026-07-30 10:18:00 +02:00
Kristoffer Dalby ea3f83216b ssh/tailssh: add exit-status test harness
Extract the in-process SSH server harness out of tailssh_test.go into
tailssh_exitcodes_test.go so the exit-status tests can share it, and add
the integrationtest-tagged exit-code suite (Go and OpenSSH clients).

Updates #18256

Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
2026-07-30 10:18:00 +02:00