Merge pull request #61604 from basvandijk/tinydns-nixos-test

nixos: add test for tinydns
This commit is contained in:
Bas van Dijk 2019-05-17 01:48:40 +02:00 committed by GitHub
commit 240ae5eb87
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 0 deletions

View file

@ -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 {};

26
nixos/tests/tinydns.nix Normal file
View file

@ -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'");
'';
})