Unverified Commit f66bbd71 authored by Sizhe Zhao's avatar Sizhe Zhao Committed by GitHub
Browse files

tsshd: fix tests on Darwin (#481262)

parents b42ad3d2 71517cb1
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -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