diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 6809992f579d..3dd822f01045 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -408,7 +408,7 @@ in dhparams = runTest ./dhparams.nix; disable-installer-tools = runTest ./disable-installer-tools.nix; discourse = runTest ./discourse.nix; - dnscrypt-proxy2 = handleTestOn [ "x86_64-linux" ] ./dnscrypt-proxy2.nix { }; + dnscrypt-proxy2 = runTestOn [ "x86_64-linux" ] ./dnscrypt-proxy2.nix; dnsdist = import ./dnsdist.nix { inherit pkgs runTest; }; doas = runTest ./doas.nix; docker = runTestOn [ "aarch64-linux" "x86_64-linux" ] ./docker.nix; diff --git a/nixos/tests/dnscrypt-proxy2.nix b/nixos/tests/dnscrypt-proxy2.nix index eca17dfc7839..125cd463b0fe 100644 --- a/nixos/tests/dnscrypt-proxy2.nix +++ b/nixos/tests/dnscrypt-proxy2.nix @@ -1,42 +1,38 @@ -import ./make-test-python.nix ( - { pkgs, ... }: - let - localProxyPort = 43; - in - { - name = "dnscrypt-proxy2"; - meta = with pkgs.lib.maintainers; { - maintainers = [ joachifm ]; - }; +{ lib, ... }: +let + localProxyPort = 43; +in +{ + name = "dnscrypt-proxy2"; + meta.maintainers = with lib.maintainers; [ joachifm ]; - nodes = { - # A client running the recommended setup: DNSCrypt proxy as a forwarder - # for a caching DNS client. - client = - { ... }: - { - security.apparmor.enable = true; + nodes = { + # A client running the recommended setup: DNSCrypt proxy as a forwarder + # for a caching DNS client. + client = + { ... }: + { + security.apparmor.enable = true; - services.dnscrypt-proxy2.enable = true; - services.dnscrypt-proxy2.settings = { - listen_addresses = [ "127.0.0.1:${toString localProxyPort}" ]; - sources.public-resolvers = { - urls = [ "https://download.dnscrypt.info/resolvers-list/v2/public-resolvers.md" ]; - cache_file = "public-resolvers.md"; - minisign_key = "RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3"; - refresh_delay = 72; - }; + services.dnscrypt-proxy2.enable = true; + services.dnscrypt-proxy2.settings = { + listen_addresses = [ "127.0.0.1:${toString localProxyPort}" ]; + sources.public-resolvers = { + urls = [ "https://download.dnscrypt.info/resolvers-list/v2/public-resolvers.md" ]; + cache_file = "public-resolvers.md"; + minisign_key = "RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3"; + refresh_delay = 72; }; - - services.dnsmasq.enable = true; - services.dnsmasq.settings.server = [ "127.0.0.1#${toString localProxyPort}" ]; }; - }; - testScript = '' - client.wait_for_unit("dnsmasq") - client.wait_for_unit("dnscrypt-proxy2") - client.wait_until_succeeds("ss --numeric --udp --listening | grep -q ${toString localProxyPort}") - ''; - } -) + services.dnsmasq.enable = true; + services.dnsmasq.settings.server = [ "127.0.0.1#${toString localProxyPort}" ]; + }; + }; + + testScript = '' + client.wait_for_unit("dnsmasq") + client.wait_for_unit("dnscrypt-proxy2") + client.wait_until_succeeds("ss --numeric --udp --listening | grep -q ${toString localProxyPort}") + ''; +}