mirror of
https://github.com/tailscale/tailscale.git
synced 2026-11-24 02:31:18 -08:00
Add vmtests that boot pairs of gokrazy VMs whose tailscale and tailscaled are minimal builds and check that IP traffic flows between them over WireGuard, so we notice if a minimal build stops doing its one job: build_dist.sh --extra-small (direct path through NATs), that minus NAT traversal (DERP across NATs, direct on a shared LAN), and DERP-only. They found that "tailscale up" built with ts_omit_ipnbus returned before calling Start or EditPrefs, making it a no-op. Fix that, and have it wait for the Running state by polling tailscaled's status instead of watching the IPN bus, so scripts can rely on it as with normal builds. The extra-small feature list moves to featuretags.ExtraSmall so build_dist.sh (via a new "featuretags --extra-small") and vmtest share it. The gokrazy builder gains --output and --go-build-tags flags to build the variant images, and natlabprep --gokrazy prebuilds them all for CI. Updates #13038 Updates #12614 Signed-off-by: Brad Fitzpatrick <[email protected]> Change-Id: I0caa2c7b3adf2399da09b6d07a942f1dc34e8486
37 lines
1004 B
Go
37 lines
1004 B
Go
// Copyright (c) Tailscale Inc & contributors
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
// The natlabprep tool warms the local natlab vmtest cache by downloading
|
|
// every cloud VM image natlab can boot and, with --gokrazy, building every
|
|
// gokrazy image. It is intended for CI prep steps so a subsequent test run
|
|
// does not pay the per-image download or build cost.
|
|
package main
|
|
|
|
import (
|
|
"context"
|
|
"flag"
|
|
"log"
|
|
|
|
"tailscale.com/tstest/natlab/vmtest"
|
|
)
|
|
|
|
var gokrazy = flag.Bool("gokrazy", false, "also build the gokrazy images (requires make and qemu-img)")
|
|
|
|
func main() {
|
|
flag.Parse()
|
|
ctx := context.Background()
|
|
for _, img := range vmtest.CloudImages() {
|
|
log.Printf("ensuring %s ...", img.Name)
|
|
if err := vmtest.EnsureImage(ctx, img); err != nil {
|
|
log.Fatalf("ensuring %s: %v", img.Name, err)
|
|
}
|
|
}
|
|
if *gokrazy {
|
|
for _, img := range vmtest.GokrazyImages() {
|
|
if err := vmtest.BuildGokrazyImage(ctx, img); err != nil {
|
|
log.Fatalf("building %s: %v", img.Name, err)
|
|
}
|
|
}
|
|
}
|
|
}
|