1import ./make-test-python.nix ({ lib, ...} : {
2 name = "tinydns";
3 meta = {
4 maintainers = with lib.maintainers; [ basvandijk ];
5 };
6 nodes = {
7 nameserver = { config, lib, ... } : let
8 ip = (lib.head config.networking.interfaces.eth1.ipv4.addresses).address;
9 in {
10 networking.nameservers = [ ip ];
11 services.tinydns = {
12 enable = true;
13 inherit ip;
14 data = ''
15 .foo.bar:${ip}
16 +.bla.foo.bar:1.2.3.4:300
17 '';
18 };
19 };
20 };
21 testScript = ''
22 nameserver.start()
23 nameserver.wait_for_unit("tinydns.service")
24
25 # We query tinydns a few times to trigger the bug:
26 #
27 # nameserver # [ 6.105872] mmap: tinydns (842): VmData 331776 exceed data ulimit 300000. Update limits or use boot option ignore_rlimit_data.
28 #
29 # which was reported in https://github.com/NixOS/nixpkgs/issues/119066.
30 # Without the patch <nixpkgs/pkgs/tools/networking/djbdns/softlimit.patch>
31 # it fails on the 10th iteration.
32 nameserver.succeed(
33 """
34 for i in {1..100}; do
35 host bla.foo.bar 192.168.1.1 | grep '1\.2\.3\.4'
36 done
37 """
38 )
39 '';
40})