Skip to content

Commit 13accc2

Browse files
committed
nixos/tests/pdns-recursor: test old-settings
1 parent b71d4f5 commit 13accc2

File tree

2 files changed

+21
-16
lines changed

2 files changed

+21
-16
lines changed

nixos/tests/all-tests.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,7 @@ in
10181018
paperless = handleTest ./paperless.nix { };
10191019
parsedmarc = handleTest ./parsedmarc { };
10201020
password-option-override-ordering = handleTest ./password-option-override-ordering.nix { };
1021-
pdns-recursor = handleTest ./pdns-recursor.nix { };
1021+
pdns-recursor = runTest ./pdns-recursor.nix;
10221022
pds = handleTest ./pds.nix { };
10231023
peerflix = handleTest ./peerflix.nix { };
10241024
peering-manager = handleTest ./web-apps/peering-manager.nix { };

nixos/tests/pdns-recursor.nix

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
1-
import ./make-test-python.nix (
2-
{ pkgs, ... }:
3-
{
4-
name = "powerdns-recursor";
1+
{ lib, pkgs, ... }:
52

6-
nodes.server =
7-
{ ... }:
8-
{
9-
services.pdns-recursor.enable = true;
10-
services.pdns-recursor.exportHosts = true;
11-
networking.hosts."192.0.2.1" = [ "example.com" ];
12-
};
3+
{
4+
name = "powerdns-recursor";
5+
meta.maintainers = with lib.maintainers; [ rnhmjoj ];
136

14-
testScript = ''
7+
nodes.server = {
8+
services.pdns-recursor.enable = true;
9+
services.pdns-recursor.exportHosts = true;
10+
services.pdns-recursor.old-settings.dnssec-log-bogus = true;
11+
networking.hosts."192.0.2.1" = [ "example.com" ];
12+
};
13+
14+
testScript = ''
15+
with subtest("pdns-recursor is running"):
1516
server.wait_for_unit("pdns-recursor")
1617
server.wait_for_open_port(53)
18+
19+
with subtest("can resolve names"):
1720
assert "192.0.2.1" in server.succeed("host example.com localhost")
18-
'';
19-
}
20-
)
21+
22+
with subtest("old-settings have been merged in"):
23+
server.succeed("${lib.getExe pkgs.yq-go} -e .dnssec.log_bogus /etc/pdns-recursor/recursor.yml")
24+
'';
25+
}

0 commit comments

Comments
 (0)