While packaging an NGI project as a service, one of its processes is to resolve domain names, and this requires the test VM to have access to the internet. When I run nix build .#checks.x86_64-linux.projects/Mox/nixos/tests/basic.driverInteractive
it passes all tests as driverinteractive
gives the VM access. However, running nix build .#checks.x86_64-linux.projects/Mox/nixos/tests/basic
fails with errors in DNS resolving.
And most importantly, the CI test at NGI uses nix build .#checks.x86_64-linux.projects/Mox/nixos/tests/basic
so that means it will always fail.
Is there a way to give the qemu test VM access to the internet?
Not without disabling the sandbox. And you really don’t want your tests depending on external DNS working in the first place. You’re probably better off adding another node to the test that runs a mock DNS server the other systems can use to resolve DNS queries.
3 Likes
I get/appreciate the concern about depending on external DNS working. However, if for experiment purposes I want to, how would I got about it? I’ve tried disabling the sandbox before, but it seems some more configs are needed.
You can disable sandbox with --option sandbox false -L --builders ""
but I agree with previous comments that you should find a way of running the test with sandbox enabled.
1 Like