From e23546ce08914af2c20e5898786ace93af58d3dc Mon Sep 17 00:00:00 2001 From: Ahmet Ibrahim Aksoy Date: Thu, 25 Jul 2024 18:23:26 +0200 Subject: [PATCH 1/5] Enable CertificateCallbackThrowPropagates --- .../System.Net.Quic/tests/FunctionalTests/MsQuicTests.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicTests.cs b/src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicTests.cs index 2f18e4ba84491..5e3b440377814 100644 --- a/src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicTests.cs +++ b/src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicTests.cs @@ -353,7 +353,6 @@ public async Task UntrustedClientCertificateFails() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/99074")] public async Task CertificateCallbackThrowPropagates() { using CancellationTokenSource cts = new CancellationTokenSource(PassingTestTimeout); From f16d1dc6f5d5ecae48dadc81e97bcb2f569c4ee6 Mon Sep 17 00:00:00 2001 From: Ahmet Ibrahim Aksoy Date: Thu, 25 Jul 2024 18:34:33 +0200 Subject: [PATCH 2/5] Skip Test on platforms other than Alpine --- .../System.Net.Quic/tests/FunctionalTests/MsQuicTests.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicTests.cs b/src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicTests.cs index 5e3b440377814..d065d90ed7264 100644 --- a/src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicTests.cs +++ b/src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicTests.cs @@ -352,9 +352,14 @@ public async Task UntrustedClientCertificateFails() } } - [Fact] + [ConditionalFact] public async Task CertificateCallbackThrowPropagates() { + if (!PlatformDetection.IsAlpine) + { + throw new SkipTestException("On other platforms - ActiveIssue: https://github.com/dotnet/runtime/issues/99074"); + } + using CancellationTokenSource cts = new CancellationTokenSource(PassingTestTimeout); bool validationResult = false; From c4b1ac444f8a6349815e615a1476dab112593b64 Mon Sep 17 00:00:00 2001 From: Ahmet Ibrahim Aksoy Date: Fri, 26 Jul 2024 12:28:29 +0200 Subject: [PATCH 3/5] Review feedback --- .../tests/TestUtilities/System/PlatformDetection.Unix.cs | 1 + .../System.Net.Quic/tests/FunctionalTests/MsQuicTests.cs | 8 ++------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Unix.cs b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Unix.cs index 6b087a82e56ae..70fbe0ea5772c 100644 --- a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Unix.cs +++ b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Unix.cs @@ -33,6 +33,7 @@ public static partial class PlatformDetection public static bool IsNotMonoLinuxArm64 => !IsMonoLinuxArm64; public static bool IsQemuLinux => IsLinux && Environment.GetEnvironmentVariable("DOTNET_RUNNING_UNDER_QEMU") != null; public static bool IsNotQemuLinux => !IsQemuLinux; + public static bool IsNotAlpine => !IsAlpine; // OSX family public static bool IsApplePlatform => IsOSX || IsiOS || IstvOS || IsMacCatalyst; diff --git a/src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicTests.cs b/src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicTests.cs index d065d90ed7264..fc6bb36b1ea7c 100644 --- a/src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicTests.cs +++ b/src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicTests.cs @@ -352,14 +352,10 @@ public async Task UntrustedClientCertificateFails() } } - [ConditionalFact] + [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/99074", typeof(PlatformDetection), nameof(PlatformDetection.IsNotAlpine))] public async Task CertificateCallbackThrowPropagates() { - if (!PlatformDetection.IsAlpine) - { - throw new SkipTestException("On other platforms - ActiveIssue: https://github.com/dotnet/runtime/issues/99074"); - } - using CancellationTokenSource cts = new CancellationTokenSource(PassingTestTimeout); bool validationResult = false; From 3332fdd14021c3c7a923d8570cebd010b1e55325 Mon Sep 17 00:00:00 2001 From: Ahmet Ibrahim Aksoy Date: Mon, 29 Jul 2024 12:44:41 +0200 Subject: [PATCH 4/5] Change condition to check MsQuic Version instead of Specific Distro --- .../System.Net.Quic/tests/FunctionalTests/MsQuicTests.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicTests.cs b/src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicTests.cs index fc6bb36b1ea7c..77acbfa2e4f48 100644 --- a/src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicTests.cs +++ b/src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicTests.cs @@ -52,6 +52,7 @@ public class MsQuicTests : QuicTestBase, IClassFixture { private static byte[] s_data = "Hello world!"u8.ToArray(); readonly CertificateSetup _certificates; + static bool SupportsAsyncCertValidation => QuicTestCollection.MsQuicVersion >= new Version(2, 4); public MsQuicTests(ITestOutputHelper output, CertificateSetup setup) : base(output) { @@ -353,7 +354,7 @@ public async Task UntrustedClientCertificateFails() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/99074", typeof(PlatformDetection), nameof(PlatformDetection.IsNotAlpine))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/99074", typeof(MsQuicTests), nameof(SupportsAsyncCertValidation))] public async Task CertificateCallbackThrowPropagates() { using CancellationTokenSource cts = new CancellationTokenSource(PassingTestTimeout); From ea9559e03555748738af90aa598c7d63c2a21885 Mon Sep 17 00:00:00 2001 From: Ahmet Ibrahim Aksoy Date: Mon, 29 Jul 2024 12:45:57 +0200 Subject: [PATCH 5/5] Delete unused property --- .../Common/tests/TestUtilities/System/PlatformDetection.Unix.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Unix.cs b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Unix.cs index 70fbe0ea5772c..6b087a82e56ae 100644 --- a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Unix.cs +++ b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Unix.cs @@ -33,7 +33,6 @@ public static partial class PlatformDetection public static bool IsNotMonoLinuxArm64 => !IsMonoLinuxArm64; public static bool IsQemuLinux => IsLinux && Environment.GetEnvironmentVariable("DOTNET_RUNNING_UNDER_QEMU") != null; public static bool IsNotQemuLinux => !IsQemuLinux; - public static bool IsNotAlpine => !IsAlpine; // OSX family public static bool IsApplePlatform => IsOSX || IsiOS || IstvOS || IsMacCatalyst;