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

Changed files
+4 -2
nixos
+4 -2
nixos/tests/dnscrypt-proxy2.nix
···
-
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 ];
···
# for a caching DNS client.
client =
{ ... }:
-
let localProxyPort = 43; in
{
security.apparmor.enable = true;
···
testScript = ''
client.wait_for_unit("dnsmasq")
client.wait_for_unit("dnscrypt-proxy2")
+
client.wait_until_succeeds("ss --numeric --udp --listening | grep -q ${toString localProxyPort}")
'';
})