vimto is a virtual machine testing orchestrator for the Go toolchain. It allows you to easily run Go unit tests using a specific Linux kernel.
# With .vimto.toml in place:
vimto -- go test .
# Otherwise:
vimto -kernel /path/to/vmlinuz -- go test .The tests are executed inside an ephemeral VM, with an execution environment which mimics the host.
It's possible to obtain the kernel from a container image.
vimto -kernel example.org/reg/image:tag -- go test .Finally, you can also use a path to a directory:
vimto -kernel /path/to/dir -- go test .vimto expects the kernel to be at /boot/vmlinuz for containers and directories.
See also Container format.
Install using the Go toolchain:
CGO_ENABLED=0 go install lmb.io/vimto@latestvimto reads a configuration file .vimto.toml in TOML format, either from the current directory or from the root of the git repository enclosing the current directory.
All available options and their values are in testdata/default.toml.
- Networking
- Interactive shell sessions
- Cross-arch tests (running
arm64onamd64host for example)
- An
amd64orarm64host running Linux - A recent version of
qemu(8.1.3 is known to work) - A Linux kernel with the necessary configuration (>= 4.9 is known to work)
- KVM (optional, see VIMTO_DISABLE_KVM)
Here is a non-exhaustive list of required Linux options:
CONFIG_9P_FS=yCONFIG_DEVTMPFS=yCONFIG_NET_9P_VIRTIO=yCONFIG_NET_9P=yCONFIG_NET_CORE=yCONFIG_OVERLAY_FS=yCONFIG_PCI=yCONFIG_SYSFS=yCONFIG_TMPFS=yCONFIG_TTY=yCONFIG_UNIX=yCONFIG_UNIX98_PTYS=yCONFIG_VIRTIO_CONSOLE=yCONFIG_VIRTIO_MMIO=yCONFIG_VIRTIO_NET=yCONFIG_VIRTIO_PCI=yCONFIG_VIRTIO=yCONFIG_VT=y
