From a32dbada18203d90ab94707c364bcde328a64bda Mon Sep 17 00:00:00 2001 From: Arthur Gautier Date: Sun, 6 Oct 2024 03:45:27 +0000 Subject: [PATCH] nixosTests: fixup tests/common/resolver to work with a local resolver When 757a455ddeea43e24bbf3a8258fe5994b4fde10b refactored the zones to go from a list to a map, this broke the tests/common/resolver helper. reproduction: ``` let pkgs = import {}; testConfig = { name = "resolver-repro"; nodes = { acme = { nodes, ... }: { imports = [ (pkgs.path + /nixos/tests/common/acme/server) ]; }; }; testScript = '' ''; }; in pkgs.nixosTest testConfig ``` --- nixos/tests/common/resolver.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nixos/tests/common/resolver.nix b/nixos/tests/common/resolver.nix index 4c3789d0abfaa44..4d1b96a3a497175 100644 --- a/nixos/tests/common/resolver.nix +++ b/nixos/tests/common/resolver.nix @@ -31,10 +31,11 @@ services.bind.forwarders = lib.mkForce []; services.bind.zones = lib.singleton { name = "."; + master = true; file = let addDot = zone: zone + lib.optionalString (!lib.hasSuffix "." zone) "."; mkNsdZoneNames = zones: map addDot (lib.attrNames zones); - mkBindZoneNames = zones: map (zone: addDot zone.name) zones; + mkBindZoneNames = zones: map addDot (lib.attrNames zones); getZones = cfg: mkNsdZoneNames cfg.services.nsd.zones ++ mkBindZoneNames cfg.services.bind.zones;