nixos/tests/unbound: add test to verify control sockets work

This commit is contained in:
Andreas Rammhold 2020-10-23 22:14:28 +02:00
parent a040a8a2e3
commit b67cc6298e
No known key found for this signature in database
GPG Key ID: E432E410B5E48C86

View File

@ -132,6 +132,12 @@ import ./make-test-python.nix ({ pkgs, lib, ... }:
something.local. IN A 3.4.5.6
''}
'';
"unbound-extra3.conf".text = ''
remote-control:
control-enable: yes
control-interface: /run/unbound/unbound.ctl
'';
};
};
@ -243,5 +249,10 @@ import ./make-test-python.nix ({ pkgs, lib, ... }:
local_resolver.succeed("systemctl reload unbound")
r = [("A", "3.4.5.6")]
test(local_resolver, ["::1", "127.0.0.1"], zone="something.local.", records=r)
with subtest("test that we can enable unbound control sockets on the fly"):
local_resolver.succeed("ln -sf /etc/unbound-extra3.conf /etc/unbound/extra3.conf")
local_resolver.succeed("systemctl reload unbound")
local_resolver.succeed("unbound-control list_forwards")
'';
})