summary refs log tree commit diff
diff options
context:
space:
mode:
authorworldofpeace <worldofpeace@protonmail.ch>2020-02-01 18:59:02 -0500
committerworldofpeace <worldofpeace@protonmail.ch>2020-02-02 21:51:19 -0500
commit4c3166b0065b950db7719013fd193609896c2867 (patch)
treeebf9c7b266e0b07bd18c924fb8f07e41c19d1faf
parent915060d03f1a9f98e934cd779af90e3273ff91e3 (diff)
downloadnixpkgs-4c3166b0065b950db7719013fd193609896c2867.tar
nixpkgs-4c3166b0065b950db7719013fd193609896c2867.tar.gz
nixpkgs-4c3166b0065b950db7719013fd193609896c2867.tar.bz2
nixpkgs-4c3166b0065b950db7719013fd193609896c2867.tar.lz
nixpkgs-4c3166b0065b950db7719013fd193609896c2867.tar.xz
nixpkgs-4c3166b0065b950db7719013fd193609896c2867.tar.zst
nixpkgs-4c3166b0065b950db7719013fd193609896c2867.zip
nixosTests.dnscrypt-proxy2: init
This removes the old dnscrypt-proxy test.
-rw-r--r--nixos/tests/all-tests.nix2
-rw-r--r--nixos/tests/dnscrypt-proxy2.nix (renamed from nixos/tests/dnscrypt-proxy.nix)23
2 files changed, 13 insertions, 12 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index 282d31005f0..e9440a4ebb7 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -65,7 +65,7 @@ in
   couchdb = handleTest ./couchdb.nix {};
   deluge = handleTest ./deluge.nix {};
   dhparams = handleTest ./dhparams.nix {};
-  dnscrypt-proxy = handleTestOn ["x86_64-linux"] ./dnscrypt-proxy.nix {};
+  dnscrypt-proxy2 = handleTestOn ["x86_64-linux"] ./dnscrypt-proxy2.nix {};
   docker = handleTestOn ["x86_64-linux"] ./docker.nix {};
   docker-containers = handleTestOn ["x86_64-linux"] ./docker-containers.nix {};
   docker-edge = handleTestOn ["x86_64-linux"] ./docker-edge.nix {};
diff --git a/nixos/tests/dnscrypt-proxy.nix b/nixos/tests/dnscrypt-proxy2.nix
index 98153d5c904..b614d912a9f 100644
--- a/nixos/tests/dnscrypt-proxy.nix
+++ b/nixos/tests/dnscrypt-proxy2.nix
@@ -1,5 +1,5 @@
 import ./make-test-python.nix ({ pkgs, ... }: {
-  name = "dnscrypt-proxy";
+  name = "dnscrypt-proxy2";
   meta = with pkgs.stdenv.lib.maintainers; {
     maintainers = [ joachifm ];
   };
@@ -13,9 +13,16 @@ import ./make-test-python.nix ({ pkgs, ... }: {
     {
       security.apparmor.enable = true;
 
-      services.dnscrypt-proxy.enable = true;
-      services.dnscrypt-proxy.localPort = localProxyPort;
-      services.dnscrypt-proxy.extraArgs = [ "-X libdcplugin_example.so" ];
+      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.servers = [ "127.0.0.1#${toString localProxyPort}" ];
@@ -24,12 +31,6 @@ import ./make-test-python.nix ({ pkgs, ... }: {
 
   testScript = ''
     client.wait_for_unit("dnsmasq")
-
-    # The daemon is socket activated; sending a single ping should activate it.
-    client.fail("systemctl is-active dnscrypt-proxy")
-    client.execute(
-        "${pkgs.iputils}/bin/ping -c1 example.com"
-    )
-    client.wait_until_succeeds("systemctl is-active dnscrypt-proxy")
+    client.wait_for_unit("dnscrypt-proxy2")
   '';
 })