nixpkgs/nixos/lib/testing
Maximilian Bosch a9adfc631a
nixos/test-driver: allow assigning other vsock number ranges
I'm a little annoyed at myself that I only realized this _after_ #392030
got merged. But I realized that if something else is using AF_VSOCK or
you simply have another interactive test running (e.g. by another user
on a larger builder), starting up VMs in the driver fails with

    qemu-system-x86_64: -device vhost-vsock-pci,guest-cid=3: vhost-vsock: unable to set guest cid: Address already in use

Multi-user setups are broken anyways because you usually don't have
permissions to remove the VM state from another user and thus starting
the driver fails with

    PermissionError: [Errno 13] Permission denied: PosixPath('/tmp/vm-state-machine')

but this is something you can work around at least.

I was considering to generate random offsets, but that's not feasible
given we need to know the numbers at eval time to inject them into the
QEMU args. Also, while we could do this via the test-driver, we should
also probe if the vsock numbers are unused making the code even more
complex for a use-case I consider rather uncommon.

Hence the solution is to do

    sshBackdoor.vsockOffset = 23542;

when encountering conflicts.
2025-05-09 11:54:00 +02:00
..
call-test.nix
default.nix nixos/lib/testing: avoid generating darwin VM tests 2025-03-29 19:32:31 +01:00
driver.nix treewide: Format all Nix files 2025-04-01 20:10:43 +02:00
interactive.nix treewide: format all inactive Nix files 2024-12-10 20:26:33 +01:00
legacy.nix treewide: format all inactive Nix files 2024-12-10 20:26:33 +01:00
meta.nix nixos/lib/testing: avoid generating darwin VM tests 2025-03-29 19:32:31 +01:00
name.nix nixos/lib, doc: remove references to mdDoc (#300738) 2024-04-01 16:58:23 -07:00
network.nix treewide: format all inactive Nix files 2024-12-10 20:26:33 +01:00
nixos-test-base.nix treewide: format all inactive Nix files 2024-12-10 20:26:33 +01:00
nodes.nix nixos/test-driver: allow assigning other vsock number ranges 2025-05-09 11:54:00 +02:00
pkgs.nix treewide: format all inactive Nix files 2024-12-10 20:26:33 +01:00
run.nix treewide: format all inactive Nix files 2024-12-10 20:26:33 +01:00
testScript.nix treewide: format all inactive Nix files 2024-12-10 20:26:33 +01:00