diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index d495b2fa6333..7ac6aba4ab3b 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -236,6 +236,7 @@ in pdns-recursor = handleTest ./pdns-recursor.nix {}; taskserver = handleTest ./taskserver.nix {}; telegraf = handleTest ./telegraf.nix {}; + tinydns = handleTest ./tinydns.nix {}; tomcat = handleTest ./tomcat.nix {}; tor = handleTest ./tor.nix {}; transmission = handleTest ./transmission.nix {}; diff --git a/nixos/tests/tinydns.nix b/nixos/tests/tinydns.nix new file mode 100644 index 000000000000..cb7ee0c5fb5e --- /dev/null +++ b/nixos/tests/tinydns.nix @@ -0,0 +1,26 @@ +import ./make-test.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->waitForUnit("tinydns.service"); + $nameserver->succeed("host bla.foo.bar | grep '1\.2\.3\.4'"); + ''; +})