Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit e9be24d

Browse files
author
Paulo Janotti
authored
Disable Net.Http tests failing in Fedora.27 (#26835)
* Disable Net.Http tests failing in Fedora.27 (#26803) * Adding comments for when tracking issue is fixed.
1 parent 928d525 commit e9be24d

File tree

5 files changed

+19
-12
lines changed

5 files changed

+19
-12
lines changed

src/CoreFx.Private.TestUtilities/ref/CoreFx.Private.TestUtilities.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public static partial class PlatformDetection
4747
public static bool IsDebian8 { get { throw null; } }
4848
public static bool IsDrawingSupported { get { throw null; } }
4949
public static bool IsFedora { get { throw null; } }
50+
public static bool IsFedora27 { get { throw null; } }
5051
public static bool IsFullFramework { get { throw null; } }
5152
public static bool IsInvokingStaticConstructorsSupported { get { throw null; } }
5253
public static bool IsMacOsHighSierraOrHigher { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
@@ -59,6 +60,7 @@ public static partial class PlatformDetection
5960
public static bool IsNetNative { get { throw null; } }
6061
public static bool IsNonZeroLowerBoundArraySupported { get { throw null; } }
6162
public static bool IsNotArmProcess { get { throw null; } }
63+
public static bool IsNotFedora27 { get { throw null; } }
6264
public static bool IsNotFedoraOrRedHatFamily { get { throw null; } }
6365
public static bool IsNotMacOsHighSierraOrHigher { get { throw null; } }
6466
public static bool IsNotNetNativeRunningAsConsoleApp { get { throw null; } }

src/CoreFx.Private.TestUtilities/src/System/PlatformDetection.Unix.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public static partial class PlatformDetection
3535
public static bool IsUbuntu1710 => IsDistroAndVersion("ubuntu", 17, 10);
3636
public static bool IsTizen => IsDistroAndVersion("tizen");
3737
public static bool IsFedora => IsDistroAndVersion("fedora");
38+
public static bool IsFedora27 => IsDistroAndVersion("fedora", 27);
3839
public static bool IsWindowsNanoServer => false;
3940
public static bool IsWindowsServerCore => false;
4041
public static bool IsWindowsAndElevated => false;
@@ -46,6 +47,7 @@ public static partial class PlatformDetection
4647
public static bool IsNotRedHatFamily6 => !IsRedHatFamily6;
4748
public static bool IsRedHatFamily7 => IsRedHatFamilyAndVersion(7);
4849
public static bool IsNotFedoraOrRedHatFamily => !IsFedora && !IsRedHatFamily;
50+
public static bool IsNotFedora27 => !IsFedora27;
4951

5052
public static Version OSXVersion { get; } = ToVersion(Microsoft.DotNet.PlatformAbstractions.RuntimeEnvironment.OperatingSystemVersion);
5153

src/CoreFx.Private.TestUtilities/src/System/PlatformDetection.Windows.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public static partial class PlatformDetection
2929
public static bool IsTizen => false;
3030
public static bool IsNotFedoraOrRedHatFamily => true;
3131
public static bool IsFedora => false;
32+
public static bool IsFedora27 => false;
3233
public static bool IsWindowsNanoServer => (IsNotWindowsIoTCore && GetInstallationType().Equals("Nano Server", StringComparison.OrdinalIgnoreCase));
3334
public static bool IsWindowsServerCore => GetInstallationType().Equals("Server Core", StringComparison.OrdinalIgnoreCase);
3435
public static int WindowsVersion => GetWindowsVersion();
@@ -39,6 +40,8 @@ public static partial class PlatformDetection
3940
public static bool IsRedHatFamily6 => false;
4041
public static bool IsRedHatFamily7 => false;
4142
public static bool IsNotRedHatFamily6 => true;
43+
public static bool IsNotFedora27 => true;
44+
4245

4346
public static bool IsWindows10Version1607OrGreater =>
4447
GetWindowsVersion() == 10 && GetWindowsMinorVersion() == 0 && GetWindowsBuildNumber() >= 14393;

src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.ServerCertificates.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public async Task NoCallback_ValidCertificate_SuccessAndExpectedPropertyBehavior
6464

6565
[SkipOnTargetFramework(TargetFrameworkMonikers.Uap, "UAP won't send requests through a custom proxy")]
6666
[OuterLoop] // TODO: Issue #11345
67-
[Fact]
67+
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotFedora27))] // TODO: make test unconditional when #26803 is fixed
6868
public async Task UseCallback_HaveNoCredsAndUseAuthenticatedCustomProxyAndPostToSecureServer_ProxyAuthenticationRequiredStatusCode()
6969
{
7070
if (!BackendSupportsCustomCertificateHandling)
@@ -100,7 +100,7 @@ public async Task UseCallback_HaveNoCredsAndUseAuthenticatedCustomProxyAndPostTo
100100
}
101101

102102
[OuterLoop] // TODO: Issue #11345
103-
[Fact]
103+
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotFedora27))] // TODO: make test unconditional when #26803 is fixed
104104
public async Task UseCallback_NotSecureConnection_CallbackNotCalled()
105105
{
106106
if (!BackendSupportsCustomCertificateHandling)
@@ -140,7 +140,7 @@ public static IEnumerable<object[]> UseCallback_ValidCertificate_ExpectedValuesD
140140
}
141141

142142
[OuterLoop] // TODO: Issue #11345
143-
[Theory]
143+
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotFedora27))] // TODO: make test unconditional when #26803 is fixed
144144
[MemberData(nameof(UseCallback_ValidCertificate_ExpectedValuesDuringCallback_Urls))]
145145
public async Task UseCallback_ValidCertificate_ExpectedValuesDuringCallback(Uri url, bool checkRevocation)
146146
{
@@ -189,7 +189,7 @@ public async Task UseCallback_ValidCertificate_ExpectedValuesDuringCallback(Uri
189189
}
190190

191191
[OuterLoop] // TODO: Issue #11345
192-
[Fact]
192+
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotFedora27))] // TODO: make test unconditional when #26803 is fixed
193193
public async Task UseCallback_CallbackReturnsFailure_ThrowsException()
194194
{
195195
if (!BackendSupportsCustomCertificateHandling)
@@ -207,7 +207,7 @@ public async Task UseCallback_CallbackReturnsFailure_ThrowsException()
207207
}
208208

209209
[OuterLoop] // TODO: Issue #11345
210-
[Fact]
210+
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotFedora27))] // TODO: make test unconditional when #26803 is fixed
211211
public async Task UseCallback_CallbackThrowsException_ExceptionPropagatesAsBaseException()
212212
{
213213
if (!BackendSupportsCustomCertificateHandling)
@@ -269,7 +269,7 @@ public async Task NoCallback_RevokedCertificate_NoRevocationChecking_Succeeds()
269269
}
270270

271271
[OuterLoop] // TODO: Issue #11345
272-
[Fact]
272+
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotFedora27))] // TODO: make test unconditional when #26803 is fixed
273273
public async Task NoCallback_RevokedCertificate_RevocationChecking_Fails()
274274
{
275275
if (!BackendSupportsCustomCertificateHandling)
@@ -332,7 +332,7 @@ private async Task UseCallback_BadCertificate_ExpectedPolicyErrors_Helper(string
332332
}
333333

334334
[OuterLoop] // TODO: Issue #11345
335-
[Theory]
335+
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotFedora27))] // TODO: make test unconditional when #26803 is fixed
336336
[MemberData(nameof(CertificateValidationServersAndExpectedPolicies))]
337337
public async Task UseCallback_BadCertificate_ExpectedPolicyErrors(string url, SslPolicyErrors expectedErrors)
338338
{

src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.SslProtocols.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public void SetGetProtocols_Roundtrips(SslProtocols protocols)
4646
}
4747

4848
[OuterLoop] // TODO: Issue #11345
49-
[Fact]
49+
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotFedora27))] // TODO: make test unconditional when #26803 is fixed
5050
public async Task SetProtocols_AfterRequest_ThrowsException()
5151
{
5252
if (!BackendSupportsSslConfiguration)
@@ -86,7 +86,7 @@ public void DisabledProtocols_SetSslProtocols_ThrowsException(SslProtocols disab
8686
}
8787

8888
[OuterLoop] // TODO: Issue #11345
89-
[Theory]
89+
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotFedora27))] // TODO: make test unconditional when #26803 is fixed
9090
[InlineData(SslProtocols.Tls, false)]
9191
[InlineData(SslProtocols.Tls, true)]
9292
[InlineData(SslProtocols.Tls11, false)]
@@ -237,7 +237,7 @@ await TestHelper.WhenAllCompletedOrAnyFailed(
237237
}
238238

239239
[OuterLoop] // TODO: Issue #11345
240-
[Theory]
240+
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotFedora27))] // TODO: make test unconditional when #26803 is fixed
241241
[InlineData(SslProtocols.Tls11, SslProtocols.Tls, typeof(IOException))]
242242
[InlineData(SslProtocols.Tls12, SslProtocols.Tls11, typeof(IOException))]
243243
[InlineData(SslProtocols.Tls, SslProtocols.Tls12, typeof(AuthenticationException))]
@@ -264,7 +264,7 @@ await TestHelper.WhenAllCompletedOrAnyFailed(
264264

265265
[OuterLoop] // TODO: Issue #11345
266266
[ActiveIssue(8538, TestPlatforms.Windows)]
267-
[Fact]
267+
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotFedora27))] // TODO: make test unconditional when #26803 is fixed
268268
public async Task GetAsync_DisallowTls10_AllowTls11_AllowTls12()
269269
{
270270
using (HttpClientHandler handler = CreateHttpClientHandler())
@@ -303,7 +303,7 @@ await TestHelper.WhenAllCompletedOrAnyFailed(
303303
}
304304
}
305305

306-
private static bool SslDefaultsToTls12 => !PlatformDetection.IsWindows7;
306+
private static bool SslDefaultsToTls12 => !PlatformDetection.IsWindows7 && !PlatformDetection.IsFedora27; // TODO: remove IsFedora27 when #26803 is fixed
307307
// TLS 1.2 may not be enabled on Win7
308308
// https://technet.microsoft.com/en-us/library/dn786418.aspx#BKMK_SchannelTR_TLS12
309309
}

0 commit comments

Comments
 (0)