Flake runTest with network access

I am using a flake to build some software.

Unfortunately its integration tests require internet access and there’s nothing I can do about that.

I have the tests running in nix flake check -L following something like this example repo: GitHub - Mic92/nixos-test-example

The tests start in the VM that is spun up, and rightfully fail (no internet).

I tried adding nixConfig.sandbox = "relaxed"; in my flake but I have a feeling this does not touch the VM configuration

…How can I modify the above repo example to let the test vm have access to internet? My guess is that I should pass some module to runTest, but I have not figured out what yet

I suspect you have to add __noChroot = true; somewhere in your config. It’s hard to map that to the flakes example you give because it doesn’t use mkDerivation but if you do, inside it is where it goes. See also https://github.com/mcdonc/.nixconfig/blob/6a62abe078a50bebc05dc0a0a528991afd5be80b/videos/debuggingbuilds/script.rst

I already tried sandbox = relaxed and sandbox = false, which seem to set __noChroot = true

They don’t work, and that’s probably because that’s about building the package.
I have to do the same to the checks. Which spawn a qemu VM without network access.

The example in the repo uses runTest, imported from nixpkgs’s /nixos/lib. there is no mention of sandbox or noChroot there.

I believe I need to add something for qemu in the import section you see in nixos-test-example/tests/lib.nix, but those nixos tests setup are a bit complicated and I can’t figure it out