nixos/tests/pdns-recursor: test a DNS query

This commit is contained in:
rnhmjoj 2022-04-13 17:48:53 +02:00
parent fd480f55df
commit fe27976534
No known key found for this signature in database
GPG key ID: BFBAF4C975F76450

View file

@ -1,12 +1,15 @@
import ./make-test-python.nix ({ pkgs, ... }: { import ./make-test-python.nix ({ pkgs, ... }: {
name = "powerdns"; name = "powerdns-recursor";
nodes.server = { ... }: { nodes.server = { ... }: {
services.pdns-recursor.enable = true; services.pdns-recursor.enable = true;
services.pdns-recursor.exportHosts= true;
networking.hosts."192.0.2.1" = [ "example.com" ];
}; };
testScript = '' testScript = ''
server.wait_for_unit("pdns-recursor") server.wait_for_unit("pdns-recursor")
server.wait_for_open_port("53") server.wait_for_open_port("53")
assert "192.0.2.1" in server.succeed("host example.com localhost")
''; '';
}) })