2019-11-08 16:16:27 +00:00
|
|
|
import ./make-test-python.nix ({ lib, ...} : {
|
2019-05-16 21:42:02 +00: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 16:16:27 +00:00
|
|
|
nameserver.start()
|
|
|
|
nameserver.wait_for_unit("tinydns.service")
|
2021-11-08 17:28:41 +00:00
|
|
|
|
|
|
|
# We query tinydns a few times to trigger the bug:
|
|
|
|
#
|
|
|
|
# nameserver # [ 6.105872] mmap: tinydns (842): VmData 331776 exceed data ulimit 300000. Update limits or use boot option ignore_rlimit_data.
|
|
|
|
#
|
|
|
|
# which was reported in https://github.com/NixOS/nixpkgs/issues/119066.
|
|
|
|
# Without the patch <nixpkgs/pkgs/tools/networking/djbdns/softlimit.patch>
|
|
|
|
# it fails on the 10th iteration.
|
|
|
|
nameserver.succeed(
|
|
|
|
"""
|
2021-11-08 21:35:29 +00:00
|
|
|
for i in {1..100}; do
|
2021-11-08 17:28:41 +00:00
|
|
|
host bla.foo.bar 192.168.1.1 | grep '1\.2\.3\.4'
|
|
|
|
done
|
|
|
|
"""
|
|
|
|
)
|
2019-05-16 21:42:02 +00:00
|
|
|
'';
|
|
|
|
})
|