nix-vm-test
nix-vm-test copied to clipboard
Support for multiple VMs
Is your feature request related to a problem? Please describe.
The current solution supports a single VM.
For scenarios where integration tests span across multiple VMs, it would be helpful to spin them all up inside the test environment and have a network layer over which they can communicate with each other.
Describe the solution you'd like
Something similar to the NixOS VM tests where each instance is keyed by its hostname.
Describe alternatives you've considered
Additional context
I think we're not far from being able to do this. What's missing is configuring the vlans inside the VMs, which is a bit more annoying to do here than it is with NixOS.
The VLAN can be configured semi-trivially the same way we configure DHCP there:
- Debian (networkd): https://github.com/numtide/nixos-test-anywhere/blob/82eba13d6d0f7460a182f57f541a0cfe14728cb7/debian/default.nix#L65
- Fedora (networkd): https://github.com/numtide/nixos-test-anywhere/blob/82eba13d6d0f7460a182f57f541a0cfe14728cb7/fedora/default.nix#L98
- Ubuntu (netplan): https://github.com/numtide/nixos-test-anywhere/blob/82eba13d6d0f7460a182f57f541a0cfe14728cb7/ubuntu/default.nix#L67
I think the "difficult" thing here is to come up with a decent interface for the end user without making the single machine setup more complex than it currently is.