8ac5e011d6
GitOrigin-RevId: 2c3273caa153ee8eb5786bc8141b85b859e7efd7
26 lines
678 B
Nix
26 lines
678 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 192.168.1.1 | grep '1\.2\.3\.4'")
|
|
'';
|
|
})
|