mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 14:54:29 +01:00
2438c61255
The test sometimes times out waiting for multi-user.target; this should be more robust.
33 lines
956 B
Nix
33 lines
956 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("sockets.target");
|
|
$client->waitForUnit("dnsmasq");
|
|
|
|
# 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");
|
|
'';
|
|
})
|