Files
Brad Fitzpatrick 05abd5d73e ssh/tailssh, tstest/natlab/vmtest: expand Tailscale SSH test coverage
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 <[email protected]>
Change-Id: Ie4fffad7e9298b6b77c3ec3a6ae81fd784d182ce
2026-11-20 12:44:01 -08:00
..

natlab

Virtual network lab for integration tests. Tracking issue: https://github.com/tailscale/tailscale/issues/13038

Use the run-natlab-tests GitHub label on PRs to run these tests.

Prerequisites

  • qemu-system-x86_64 and qemu-img. On Debian/Ubuntu: apt install qemu-system-x86 qemu-utils
  • A built gokrazy natlabapp image (auto-built on first run via make -C gokrazy natlab)

KVM is used automatically on Linux when /dev/kvm is readable+writable. Add yourself to the kvm group to avoid QEMU falling back to software emulation.

Running locally

go test ./tstest/natlab/vmtest/ --run-vm-tests -v -timeout=15m

go test's default timeout (10 min) is likely not enough to cover the whole package. You may need to raise it further or disable the timeout entirely (-timeout=0) when running the full suite.

Alternatively, select individual tests with the usual -run.

Matrix testing (early stages)

Many tests can effectively be run across multiple variations. To wire up all these tests programatically and not manually, a tool exists in ./cmd/natlab-test-matrix that will parse the test files in the folder ./tstest/natlab/vmtest and generate a full set of tests to run.

A VariationMap defines variations to be tested. Right now the only variation used is OS image variation, but this can be expanded to NAT, portmapper and so on.