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