From 71fdb6931436e98259dcb65dbcd1f656c1b2d194 Mon Sep 17 00:00:00 2001 From: Bas van Dijk Date: Thu, 16 May 2019 23:42:02 +0200 Subject: [PATCH] nixos: add test for tinydns --- nixos/tests/all-tests.nix | 1 + nixos/tests/tinydns.nix | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 nixos/tests/tinydns.nix 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'"); + ''; +})