nixpkgs/nixos/tests/dnscrypt-proxy.nix
Joachim Fasting 19492185fa nixos/tests: implement dnscrypt-proxy test
This test verifies that the daemon actually activates upon a
user-initiated ping, when using the recommended configuration.
2016-03-11 11:35:09 +01:00

33 lines
930 B
Nix

import ./make-test.nix ({ pkgs, ... }: {
name = "dnscrypt-proxy";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ joachifm ];
};
nodes = {
# A client running the recommended setup: DNSCrypt proxy as a forwarder
# for a caching DNS client.
client =
{ config, pkgs, ... }:
let localProxyPort = 43; in
{
security.apparmor.enable = true;
services.dnscrypt-proxy.enable = true;
services.dnscrypt-proxy.localPort = localProxyPort;
services.dnsmasq.enable = true;
services.dnsmasq.servers = [ "127.0.0.1#${toString localProxyPort}" ];
};
};
testScript = ''
$client->start;
$client->waitForUnit("multi-user.target");
# The daemon is socket activated; sending a single ping should activate it.
$client->execute("${pkgs.iputils}/bin/ping -c1 example.com");
$client->succeed("systemctl is-active dnscrypt-proxy.service");
'';
})