vms
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
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
- the
kvmmodule to be loaded (modprobe kvm) - the user running these tests must have access to
/dev/kvm(being in thekvmgroup 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 65536The 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¶
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}