From a1cb6e5a88b607ef18feedee5d9b6ac952173d9d Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Wed, 13 Apr 2022 21:52:31 +0200 Subject: [PATCH] nixos/tests/ncdns: fix test 1. Add another wait_for_unit("pdns-recursor") (this is needed when DNSSEC is disabled) 2. Make everything IPv6 --- nixos/tests/ncdns.nix | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/nixos/tests/ncdns.nix b/nixos/tests/ncdns.nix index 50193676f34f..5099d697e035 100644 --- a/nixos/tests/ncdns.nix +++ b/nixos/tests/ncdns.nix @@ -29,10 +29,10 @@ in }; nodes.server = { ... }: { - networking.nameservers = [ "127.0.0.1" ]; + networking.nameservers = [ "::1" ]; services.namecoind.rpc = { - address = "127.0.0.1"; + address = "::1"; user = "namecoin"; password = "secret"; port = 8332; @@ -45,7 +45,7 @@ in script = '' while true; do echo -e "HTTP/1.1 200 OK\n\n $(<${fakeReply})\n" \ - | ${pkgs.netcat}/bin/nc -N -l 127.0.0.1 8332 + | ${pkgs.netcat}/bin/nc -N -l ::1 8332 done ''; }; @@ -58,14 +58,10 @@ in identity.address = "1.0.0.1"; }; - services.pdns-recursor = { - enable = true; - dns.allowFrom = [ "127.0.0.0/8" ]; - resolveNamecoin = true; - }; + services.pdns-recursor.enable = true; + services.pdns-recursor.resolveNamecoin = true; environment.systemPackages = [ pkgs.dnsutils ]; - }; testScript = @@ -91,6 +87,7 @@ in assert "example.com" in server.succeed("dig SOA @localhost -p 5333 bit") with subtest("bit. zone forwarding works"): + server.wait_for_unit("pdns-recursor") assert "1.2.3.4" in server.succeed("host test.bit") ''; })