summary refs log tree commit diff
diff options
context:
space:
mode:
authorTom Fitzhenry <tom@tom-fitzhenry.me.uk>2022-10-24 10:09:53 +1100
committerTom Fitzhenry <tom@tom-fitzhenry.me.uk>2022-10-24 10:11:02 +1100
commit98d2540aefd570dc7aeab3ce386d8809dc5fd8c2 (patch)
treed3a8e608384ac0d3b6002bcf094de1186d8bbb20
parent95aeaf83c247b8f5aa561684317ecd860476fcd6 (diff)
downloadnixpkgs-98d2540aefd570dc7aeab3ce386d8809dc5fd8c2.tar
nixpkgs-98d2540aefd570dc7aeab3ce386d8809dc5fd8c2.tar.gz
nixpkgs-98d2540aefd570dc7aeab3ce386d8809dc5fd8c2.tar.bz2
nixpkgs-98d2540aefd570dc7aeab3ce386d8809dc5fd8c2.tar.lz
nixpkgs-98d2540aefd570dc7aeab3ce386d8809dc5fd8c2.tar.xz
nixpkgs-98d2540aefd570dc7aeab3ce386d8809dc5fd8c2.tar.zst
nixpkgs-98d2540aefd570dc7aeab3ce386d8809dc5fd8c2.zip
nixosTests.dnscrypt-proxy2: Check that a UDP port is being listened on
Motivation: Ensure this test catches startup failures such as
https://github.com/NixOS/nixpkgs/issues/197443
-rw-r--r--nixos/tests/dnscrypt-proxy2.nix6
1 files changed, 4 insertions, 2 deletions
diff --git a/nixos/tests/dnscrypt-proxy2.nix b/nixos/tests/dnscrypt-proxy2.nix
index 1ba5d983e9b..4435d77bbf3 100644
--- a/nixos/tests/dnscrypt-proxy2.nix
+++ b/nixos/tests/dnscrypt-proxy2.nix
@@ -1,4 +1,6 @@
-import ./make-test-python.nix ({ pkgs, ... }: {
+import ./make-test-python.nix ({ pkgs, ... }: let
+  localProxyPort = 43;
+in {
   name = "dnscrypt-proxy2";
   meta = with pkgs.lib.maintainers; {
     maintainers = [ joachifm ];
@@ -9,7 +11,6 @@ import ./make-test-python.nix ({ pkgs, ... }: {
     # for a caching DNS client.
     client =
     { ... }:
-    let localProxyPort = 43; in
     {
       security.apparmor.enable = true;
 
@@ -32,5 +33,6 @@ import ./make-test-python.nix ({ pkgs, ... }: {
   testScript = ''
     client.wait_for_unit("dnsmasq")
     client.wait_for_unit("dnscrypt-proxy2")
+    client.wait_until_succeeds("ss --numeric --udp --listening | grep -q ${toString localProxyPort}")
   '';
 })