Movatterモバイル変換


[0]ホーム

URL:


vms

package
v1.92.2Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 10, 2025 License:BSD-3-ClauseImports:4Imported by:3

Details

Repository

github.com/tailscale/tailscale

Links

README

End-to-End VM-based Integration Testing

These tests spin up a Tailscale client in a Linux VM and try to connect it totestcontrolserver.

Running

This test currently only runs on Linux.

This test depends on the following command line tools:

This test also requires the following:

  • about 10 GB of temporary storage
  • about 10 GB of cached VM images
  • at least 4 GB of ram for virtual machines
  • hardware virtualization support(KVM) enabled in the BIOS
  • thekvm module to be loaded (modprobe kvm)
  • the user running these tests must have access to/dev/kvm (being in thekvm group should suffice)

The--no-s3 flag is needed to disable downloads from S3, which requirecredentials. However keep in mind that some distributions do not use stable URLsfor each individual image artifact, so there may be spurious test failures as aresult.

If you are usingNix, you can run all of the tests with thecorrect command line tools using this command:

$ nix-shell -p nixos-generators -p openssh -p go -p qemu -p cdrkit --run "go test . --run-vm-tests --v --timeout 30m --no-s3"

Keep the timeout high for the first run, especially if you are not downloadingVM images from S3. The mirrors we pull images from have download rate limits andwill take a while to download.

Because of the hardware requirements of this test, this test will not runwithout the--run-vm-tests flag set.

Other Fun Flags

This test's behavior is customized with command line flags.

Don't Download Images From S3

If you pass the-no-s3 flag togo test, the S3 step will be skipped in favorof downloading the images directly from upstream sources, which may cause thetest to fail in odd places.

Ram Limiting

This test uses a lot of memory. In order to avoid making machines run out ofmemory running this test, a semaphore is used to limit how many megabytes of ramare being used at once. By default this semaphore is set to 4096 MB of ram(about 4 gigabytes). You can customize this with the--ram-limit flag:

$ go test --run-vm-tests --ram-limit 2048$ go test --run-vm-tests --ram-limit 65536

The first example will set the limit to 2048 MB of ram (about 2 gigabytes). Thesecond example will set the limit to 65536 MB of ram (about 65 gigabytes).Please be careful with this flag, improper usage of it is known to cause theLinux out-of-memory killer to engage. Try to keep it within 50-75% of yourmachine's available ram (there is some overhead involved with thevirtualization) to be on the safe side.

Documentation

Overview

Package vms does VM-based integration/functional tests by usingqemu and a bank of pre-made VM images.

Index

Constants

This section is empty.

Variables

View Source
var Distros []Distro = func() []Distro {var result []Distrob, err :=hujson.Standardize([]byte(distroData))if err !=nil {log.Fatalf("error decoding distros: %v", err)}if err :=json.Unmarshal(b, &result); err !=nil {log.Fatalf("error decoding distros: %v", err)}return result}()

Functions

This section is empty.

Types

typeDistro

type Distro struct {Namestring// amazon-linuxURLstring// URL to a qcow2 imageSHA256Sumstring// hex-encoded sha256 sum of contents of URLMemoryMegsint// VM memory in megabytesPackageManagerstring// yum/apt/dnf/zypperInitSystemstring// systemd/openrcHostGeneratedbool// generated image rather than downloaded}

func (*Distro)InstallPre

func (d *Distro) InstallPre()string

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp