From 71517cb131eecb8867a3f59317b69fc3034088ce Mon Sep 17 00:00:00 2001 From: ljxfstorm Date: Sun, 18 Jan 2026 16:31:53 +0800 Subject: [PATCH] tsshd: fix tests on Darwin - Allow Darwin sandbox local networking for tests - Skip tests that require non-localhost network access --- pkgs/by-name/ts/tsshd/package.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pkgs/by-name/ts/tsshd/package.nix b/pkgs/by-name/ts/tsshd/package.nix index ce9d662d7a54..451d1ad9a116 100644 --- a/pkgs/by-name/ts/tsshd/package.nix +++ b/pkgs/by-name/ts/tsshd/package.nix @@ -2,6 +2,7 @@ lib, buildGoModule, fetchFromGitHub, + stdenv, versionCheckHook, nix-update-script, }: @@ -24,6 +25,23 @@ buildGoModule (finalAttrs: { "-w" ]; + # Enable for upstream KCP and QUIC tests which require UDP binding on localhost + __darwinAllowLocalNetworking = true; + + checkFlags = + let + skippedTests = [ + # `quic.DialAddr` of `quic-go` invokes UDP writing with `sendmsg` from address `[::]`, + # causing these tests to fail even with the `__darwinAllowLocalNetworking` flag enabled. + "TestQUIC_InitialPacketSize" + "TestQUIC_RespectMTU" + "TestQUIC_CertValidation" + ]; + in + lib.optionals stdenv.hostPlatform.isDarwin [ + "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" + ]; + doInstallCheck = true; nativeCheckInputs = [ versionCheckHook