From a35aff28951de3a0682d97eb226ad8aade52626b Mon Sep 17 00:00:00 2001 From: Francois Marier Date: Mon, 21 Sep 2026 13:45:47 -0700 Subject: [PATCH] tstest/natlab: move running instructions to a README Updates #cleanup Change-Id: I9580fbfeeef2edf0c678c8ab1ec70131fd20f0b5 Signed-off-by: Francois Marier --- tstest/natlab/README.md | 28 ++++++++++++++++++++++++++++ tstest/natlab/vmtest/vmtest.go | 8 +------- 2 files changed, 29 insertions(+), 7 deletions(-) create mode 100644 tstest/natlab/README.md diff --git a/tstest/natlab/README.md b/tstest/natlab/README.md new file mode 100644 index 000000000..7a6305582 --- /dev/null +++ b/tstest/natlab/README.md @@ -0,0 +1,28 @@ +# 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=15 +``` + +`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`. diff --git a/tstest/natlab/vmtest/vmtest.go b/tstest/natlab/vmtest/vmtest.go index b2b30953a..69a46ca71 100644 --- a/tstest/natlab/vmtest/vmtest.go +++ b/tstest/natlab/vmtest/vmtest.go @@ -6,13 +6,7 @@ // network infrastructure. It supports mixed OS types (gokrazy, Ubuntu, Debian) // and multi-NIC configurations for scenarios like subnet routing. // -// Prerequisites: -// - qemu-system-x86_64 (KVM is used automatically on Linux when /dev/kvm is accessible) -// - A built gokrazy natlabapp image (auto-built on first run via "make natlab" in gokrazy/) -// -// Run tests with: -// -// go test ./tstest/natlab/vmtest/ --run-vm-tests -v +// See tstest/natlab/README.md for prerequisites and how to run. package vmtest import (