tailscale/tstest/integration/vms
Josh Soref d4811f11a0 all: fix spelling mistakes
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-09-29 13:36:13 -07:00
..
gen tstest/integration/vms: codegen for top level tests (#2441) 2021-07-16 15:25:16 -04:00
derive_bindhost_test.go all: convert more code to use net/netip directly 2022-07-25 21:53:49 -07:00
distros_test.go tstest/integration/vms: move build tags from linux to !windows 2021-09-01 11:38:18 -07:00
distros.go tstest/integration/vms: use hujson.Standardize instead of hujson.Unmarshal (#4520) 2022-05-06 14:16:10 -07:00
distros.hujson tstest/integration/vms: test on stable nixos (21.11) 2022-04-11 12:54:56 -07:00
dns_tester.go all: gofmt 2021-10-07 12:18:31 -07:00
doc.go tstest/integration: add experimental integration test (#1966) 2021-05-26 14:10:10 -04:00
harness_test.go all: convert more code to use net/netip directly 2022-07-25 21:53:49 -07:00
nixos_test.go all: fix spelling mistakes 2022-09-29 13:36:13 -07:00
opensuse_leap_15_1_test.go tstest/integration/vms: move build tags from linux to !windows 2021-09-01 11:38:18 -07:00
README.md tstest/integration/vms: test on stable nixos (21.11) 2022-04-11 12:54:56 -07:00
regex_flag_test.go tstest/integration/vms: regex-match distros using a flag (#2021) 2021-05-31 13:23:38 -04:00
regex_flag.go tstest/integration/vms: regex-match distros using a flag (#2021) 2021-05-31 13:23:38 -04:00
runner.nix all: fix spelling mistakes 2021-10-12 21:23:14 -07:00
squid.conf tstest/integration/vms: smoke test derphttp through mitm proxies 2022-04-12 13:24:29 -07:00
top_level_test.go all: fix spelling mistakes 2022-09-29 13:36:13 -07:00
udp_tester.go all: gofmt with Go 1.17 2021-08-05 15:54:00 -07:00
vm_setup_test.go tstest/integration/vms: smoke test derphttp through mitm proxies 2022-04-12 13:24:29 -07:00
vms_steps_test.go all: convert more code to use net/netip directly 2022-07-25 21:53:49 -07:00
vms_test.go all: convert more code to use net/netip directly 2022-07-25 21:53:49 -07:00

End-to-End VM-based Integration Testing

This test spins up a bunch of common linux distributions and then tries to get them to connect to a testcontrol server.

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 kvm module to be loaded (modprobe kvm)
  • the user running these tests must have access to /dev/kvm (being in the kvm group should suffice)

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

If you are using Nix, you can run all of the tests with the correct 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 downloading VM images from S3. The mirrors we pull images from have download rate limits and will take a while to download.

Because of the hardware requirements of this test, this test will not run without 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 to go test, the S3 step will be skipped in favor of downloading the images directly from upstream sources, which may cause the test to fail in odd places.

Distribution Picking

This test runs on a large number of distributions. By default it tries to run everything, which may or may not be ideal for you. If you only want to test a subset of distributions, you can use the --distro-regex flag to match a subset of distributions using a regular expression such as like this:

$ go test -run-vm-tests -distro-regex centos

This would run all tests on all versions of CentOS.

$ go test -run-vm-tests -distro-regex '(debian|ubuntu)'

This would run all tests on all versions of Debian and Ubuntu.

Ram Limiting

This test uses a lot of memory. In order to avoid making machines run out of memory running this test, a semaphore is used to limit how many megabytes of ram are 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). The second 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 the Linux out-of-memory killer to engage. Try to keep it within 50-75% of your machine's available ram (there is some overhead involved with the virtualization) to be on the safe side.