2019-11-08 19:16:27 +03:00
|
|
|
import ./make-test-python.nix ({ lib, ...} : {
|
2019-05-17 00:42:02 +03:00
|
|
|
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 = ''
|
2019-11-08 19:16:27 +03:00
|
|
|
nameserver.start()
|
|
|
|
nameserver.wait_for_unit("tinydns.service")
|
|
|
|
nameserver.succeed("host bla.foo.bar | grep '1\.2\.3\.4'")
|
2019-05-17 00:42:02 +03:00
|
|
|
'';
|
|
|
|
})
|