macOS login forks the command and always exits 0, so Tailscale SSH
commands run as root on macOS always reported exit status 0. Run login
as a child instead, with a /bin/sh wrapper that writes the command's
exit status to a temp file, and exit with that status.
Also add a macOS job to the ssh-integrationtest workflow, which would
have caught this, and fix the integration tests that assumed /proc or
Linux stty output.
Fixes#18256
Change-Id: I694595f92edb41109d50018d6c221826eef5d0b8
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
Add Docker integration tests for TCP and Unix forwarding, pty size,
resize and modes, session env, envknobs, x11 rejection, session
teardown, SessionDuration, policy changes and RuleExpires on active
sessions, Shutdown, host keys and utmp, and run every integrationtest
test in the Dockerfile. Extend the vmtest SSH tests to use real
OpenSSH clients across the tailnet for pty, sftp/scp, agent and port
forwarding, AcceptEnv, ControlMaster, large transfers, banners, user
mapping, revocation, check mode (via a new testcontrol handler),
recording, and the tailscale ssh CLI. Fix make sshintegrationtest,
which only ever tested one image and always exited 0, and trigger the
workflow on go.mod changes and a schedule.
Updates #13038
Updates tailscale/corp#50380
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
Change-Id: Ie4fffad7e9298b6b77c3ec3a6ae81fd784d182ce