From 49d88890b7d3971054e7a4026d2a508172b5d222 Mon Sep 17 00:00:00 2001 From: Karel Zikmund Date: Mon, 26 Jul 2021 16:25:19 +0200 Subject: [PATCH] Disable DNS tests failing on Ubuntu 16.04 and Debian 9 (#56296) Disabled tests tracked by #56295 --- .../TestUtilities/System/PlatformDetection.Unix.cs | 1 + .../tests/FunctionalTests/GetHostByNameTest.cs | 13 +++++++------ .../tests/FunctionalTests/GetHostEntryTest.cs | 4 +++- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Unix.cs b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Unix.cs index 096616937019e..cff5e2284cfb3 100644 --- a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Unix.cs +++ b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Unix.cs @@ -20,6 +20,7 @@ public static partial class PlatformDetection public static bool IsDebian => IsDistroAndVersion("debian"); public static bool IsAlpine => IsDistroAndVersion("alpine"); public static bool IsDebian8 => IsDistroAndVersion("debian", 8); + public static bool IsDebian9 => IsDistroAndVersion("debian", 9); public static bool IsDebian10 => IsDistroAndVersion("debian", 10); public static bool IsUbuntu1604 => IsDistroAndVersion("ubuntu", 16, 4); public static bool IsUbuntu1704 => IsDistroAndVersion("ubuntu", 17, 4); diff --git a/src/libraries/System.Net.NameResolution/tests/FunctionalTests/GetHostByNameTest.cs b/src/libraries/System.Net.NameResolution/tests/FunctionalTests/GetHostByNameTest.cs index 2b62cb6c77192..9c167f06a2e6a 100644 --- a/src/libraries/System.Net.NameResolution/tests/FunctionalTests/GetHostByNameTest.cs +++ b/src/libraries/System.Net.NameResolution/tests/FunctionalTests/GetHostByNameTest.cs @@ -108,11 +108,12 @@ public void DnsObsoleteGetHostByName_IPv6String_ReturnsOnlyGivenIP() [ActiveIssue("https://github.com/dotnet/runtime/issues/51377", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void DnsObsoleteGetHostByName_EmptyString_ReturnsHostName() { - if (PlatformDetection.IsSLES) + if (PlatformDetection.IsSLES || // [ActiveIssue("https://github.com/dotnet/runtime/issues/55271")] + PlatformDetection.IsUbuntu1604 || PlatformDetection.IsDebian9) // [ActiveIssue("https://github.com/dotnet/runtime/issues/56295")] { - // See https://github.com/dotnet/runtime/issues/55271 - throw new SkipTestException("SLES Tests environment is not configured for this test to work."); + throw new SkipTestException("Test environment is not configured for this test to work."); } + IPHostEntry entry = Dns.GetHostByName(""); // DNS labels should be compared as case insensitive for ASCII characters. See RFC 4343. @@ -124,10 +125,10 @@ public void DnsObsoleteGetHostByName_EmptyString_ReturnsHostName() [ActiveIssue("https://github.com/dotnet/runtime/issues/51377", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void DnsObsoleteBeginEndGetHostByName_EmptyString_ReturnsHostName() { - if (PlatformDetection.IsSLES) + if (PlatformDetection.IsSLES || // [ActiveIssue("https://github.com/dotnet/runtime/issues/55271")] + PlatformDetection.IsUbuntu1604 || PlatformDetection.IsDebian9) // [ActiveIssue("https://github.com/dotnet/runtime/issues/56295")] { - // See https://github.com/dotnet/runtime/issues/55271 - throw new SkipTestException("SLES Tests environment is not configured for this test to work."); + throw new SkipTestException("Test environment is not configured for this test to work."); } IPHostEntry entry = Dns.EndGetHostByName(Dns.BeginGetHostByName("", null, null)); diff --git a/src/libraries/System.Net.NameResolution/tests/FunctionalTests/GetHostEntryTest.cs b/src/libraries/System.Net.NameResolution/tests/FunctionalTests/GetHostEntryTest.cs index bfb8b48cc4e70..467b8e9115c02 100644 --- a/src/libraries/System.Net.NameResolution/tests/FunctionalTests/GetHostEntryTest.cs +++ b/src/libraries/System.Net.NameResolution/tests/FunctionalTests/GetHostEntryTest.cs @@ -30,7 +30,9 @@ public async Task Dns_GetHostEntryAsync_IPAddress_Ok() // [ActiveIssue("https://github.com/dotnet/runtime/issues/51377", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] !PlatformDetection.IsiOS && !PlatformDetection.IstvOS && !PlatformDetection.IsMacCatalyst && // [ActiveIssue("https://github.com/dotnet/runtime/issues/55271")] - !PlatformDetection.IsSLES; + !PlatformDetection.IsSLES && + // [ActiveIssue("https://github.com/dotnet/runtime/issues/56295")] + !PlatformDetection.IsUbuntu1604 && !PlatformDetection.IsDebian9; [ConditionalTheory(nameof(GetHostEntryWorks))] [InlineData("")]