about summary refs log tree commit diff
path: root/nixos/tests/tinydns.nix
diff options
context:
space:
mode:
authorBas van Dijk <v.dijk.bas@gmail.com>2019-05-16 23:42:02 +0200
committerBas van Dijk <v.dijk.bas@gmail.com>2019-05-16 23:46:17 +0200
commit71fdb6931436e98259dcb65dbcd1f656c1b2d194 (patch)
treee9d5db63e7c0dd3025355abf5d9a2715e587a214 /nixos/tests/tinydns.nix
parentbc9df0f66110039e495b6debe3a6cda4a1bb0fed (diff)
downloadnixlib-71fdb6931436e98259dcb65dbcd1f656c1b2d194.tar
nixlib-71fdb6931436e98259dcb65dbcd1f656c1b2d194.tar.gz
nixlib-71fdb6931436e98259dcb65dbcd1f656c1b2d194.tar.bz2
nixlib-71fdb6931436e98259dcb65dbcd1f656c1b2d194.tar.lz
nixlib-71fdb6931436e98259dcb65dbcd1f656c1b2d194.tar.xz
nixlib-71fdb6931436e98259dcb65dbcd1f656c1b2d194.tar.zst
nixlib-71fdb6931436e98259dcb65dbcd1f656c1b2d194.zip
nixos: add test for tinydns
Diffstat (limited to 'nixos/tests/tinydns.nix')
-rw-r--r--nixos/tests/tinydns.nix26
1 files changed, 26 insertions, 0 deletions
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'");
+  '';
+})