1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-18 02:46:28 +00:00
nixpkgs/nixos/tests/tinydns.nix
2019-11-08 17:26:34 +01:00

27 lines
666 B
Nix

import ./make-test-python.nix ({ lib, ...} : {
name = "tinydns";
meta = {
maintainers = with lib.maintainers; [ basvandijk ];
};
nodes = {
nameserver = { config, lib, ... } : let
ip = (lib.head config.networking.interfaces.eth1.ipv4.addresses).address;
in {
networking.nameservers = [ ip ];
services.tinydns = {
enable = true;
inherit ip;
data = ''
.foo.bar:${ip}
+.bla.foo.bar:1.2.3.4:300
'';
};
};
};
testScript = ''
nameserver.start()
nameserver.wait_for_unit("tinydns.service")
nameserver.succeed("host bla.foo.bar | grep '1\.2\.3\.4'")
'';
})