Commit a32dbada authored by Arthur Gautier's avatar Arthur Gautier
Browse files

nixosTests: fixup tests/common/resolver to work with a local resolver

When 757a455d refactored the zones to go
from a list to a map, this broke the tests/common/resolver helper.

reproduction:
```
let
  pkgs = import <nixpkgs> {};

  testConfig = {
    name = "resolver-repro";
    nodes = {
      acme = { nodes, ... }: {
        imports = [ (pkgs.path + /nixos/tests/common/acme/server) ];
      };
    };

    testScript = ''
    '';
  };
in pkgs.nixosTest testConfig
```
parent 1c2278ee
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;