From fb7edc0c3bbf437ded91fcadc2d1895e5bee4d84 Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Sun, 12 Jan 2020 12:49:27 -0800 Subject: [PATCH] Delete RHEL6 leftovers (#1648) Fixes #423 Closes dotnet/corefx#24525 Closes dotnet/corefx#37739 Closes dotnet/corefx#31792 --- src/coreclr/init-distro-rid.sh | 1 - src/installer/corehost/common/pal.unix.cpp | 30 ------------------- .../System/PlatformDetection.Unix.cs | 2 -- .../System/PlatformDetection.cs | 3 +- .../tests/ProcessTests.Unix.cs | 3 +- .../tests/ColorTranslatorTests.cs | 2 +- .../tests/Helpers.cs | 13 -------- .../System.Drawing.Primitives.Tests.csproj | 1 - .../tests/Directory/Delete.cs | 2 +- .../System.IO.FileSystem/tests/File/Delete.cs | 2 +- .../AnonymousPipeTest.Specific.cs | 2 +- .../System/Runtime/ProfileOptimization.cs | 16 +--------- .../RevocationTests/DynamicRevocationTests.cs | 9 +----- 13 files changed, 8 insertions(+), 78 deletions(-) delete mode 100644 src/libraries/System.Drawing.Primitives/tests/Helpers.cs diff --git a/src/coreclr/init-distro-rid.sh b/src/coreclr/init-distro-rid.sh index beb7451a1f7ee..0885f1d346cf4 100755 --- a/src/coreclr/init-distro-rid.sh +++ b/src/coreclr/init-distro-rid.sh @@ -26,7 +26,6 @@ # # | OS | Expected RID | # ------------------------------------------------- -# | rhel6 | rhel.6-x64 | # | alpine* | linux-musl-(arch) | # | freeBSD | freebsd.(version)-x64 | # diff --git a/src/installer/corehost/common/pal.unix.cpp b/src/installer/corehost/common/pal.unix.cpp index bf22be3245e2d..0fc00d268933f 100644 --- a/src/installer/corehost/common/pal.unix.cpp +++ b/src/installer/corehost/common/pal.unix.cpp @@ -545,7 +545,6 @@ pal::string_t pal::get_current_os_rid_platform() { pal::string_t ridOS; pal::string_t versionFile(_X("/etc/os-release")); - pal::string_t rhelVersionFile(_X("/etc/redhat-release")); if (pal::file_exists(versionFile)) { @@ -625,35 +624,6 @@ pal::string_t pal::get_current_os_rid_platform() } } } - else if (pal::file_exists(rhelVersionFile)) - { - // Read the file to check if the current OS is RHEL or CentOS 6.x - std::fstream fsVersionFile; - - fsVersionFile.open(rhelVersionFile, std::fstream::in); - - // Proceed only if we were able to open the file - if (fsVersionFile.good()) - { - pal::string_t line; - // Read the first line - std::getline(fsVersionFile, line); - - if (!fsVersionFile.eof()) - { - pal::string_t rhel6Prefix(_X("Red Hat Enterprise Linux Server release 6.")); - pal::string_t centos6Prefix(_X("CentOS release 6.")); - - if ((line.find(rhel6Prefix) == 0) || (line.find(centos6Prefix) == 0)) - { - ridOS = _X("rhel.6"); - } - } - - // Close the file now that we are done with it. - fsVersionFile.close(); - } - } return normalize_linux_rid(ridOS); } diff --git a/src/libraries/Common/tests/CoreFx.Private.TestUtilities/System/PlatformDetection.Unix.cs b/src/libraries/Common/tests/CoreFx.Private.TestUtilities/System/PlatformDetection.Unix.cs index a4f7d1e1b9582..22a7046239bcc 100644 --- a/src/libraries/Common/tests/CoreFx.Private.TestUtilities/System/PlatformDetection.Unix.cs +++ b/src/libraries/Common/tests/CoreFx.Private.TestUtilities/System/PlatformDetection.Unix.cs @@ -48,8 +48,6 @@ public static partial class PlatformDetection // RedHat family covers RedHat and CentOS public static bool IsRedHatFamily => IsRedHatFamilyAndVersion(); public static bool IsNotRedHatFamily => !IsRedHatFamily; - public static bool IsRedHatFamily6 => IsRedHatFamilyAndVersion(6); - public static bool IsNotRedHatFamily6 => !IsRedHatFamily6; public static bool IsRedHatFamily7 => IsRedHatFamilyAndVersion(7); public static bool IsNotFedoraOrRedHatFamily => !IsFedora && !IsRedHatFamily; public static bool IsNotDebian10 => !IsDebian10; diff --git a/src/libraries/Common/tests/CoreFx.Private.TestUtilities/System/PlatformDetection.cs b/src/libraries/Common/tests/CoreFx.Private.TestUtilities/System/PlatformDetection.cs index 119f570cb0503..c9709e0dabc63 100644 --- a/src/libraries/Common/tests/CoreFx.Private.TestUtilities/System/PlatformDetection.cs +++ b/src/libraries/Common/tests/CoreFx.Private.TestUtilities/System/PlatformDetection.cs @@ -50,8 +50,7 @@ public static bool IsDrawingSupported } else { - // ActiveIssue(24525) - return PlatformDetection.IsNotRedHatFamily6 && (NativeLibrary.TryLoad("libgdiplus.so", out _) || NativeLibrary.TryLoad("libgdiplus.so.0", out _)); + return NativeLibrary.TryLoad("libgdiplus.so", out _) || NativeLibrary.TryLoad("libgdiplus.so.0", out _); } #endif } diff --git a/src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs b/src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs index 084501eac7f82..c1d7da8db989b 100644 --- a/src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs +++ b/src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs @@ -156,8 +156,7 @@ public void ProcessStart_UseShellExecute_OnUnix_SuccessWhenProgramInstalled(bool } } - // Active issue https://github.com/dotnet/corefx/issues/37739 - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotRedHatFamily6))] + [Fact] [PlatformSpecific(~TestPlatforms.OSX)] // On OSX, ProcessName returns the script interpreter. public void ProcessNameMatchesScriptName() { diff --git a/src/libraries/System.Drawing.Primitives/tests/ColorTranslatorTests.cs b/src/libraries/System.Drawing.Primitives/tests/ColorTranslatorTests.cs index 7597be15798c1..beddc8ee45027 100644 --- a/src/libraries/System.Drawing.Primitives/tests/ColorTranslatorTests.cs +++ b/src/libraries/System.Drawing.Primitives/tests/ColorTranslatorTests.cs @@ -219,7 +219,7 @@ public void FromHtml_Invalid_Throws(string htmlColor) } } - [ConditionalTheory(Helpers.IsDrawingSupported)] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported))] [InlineData("#G12", typeof(FormatException))] [InlineData("#G12345", typeof(FormatException))] [InlineData("1,2", typeof(ArgumentException))] diff --git a/src/libraries/System.Drawing.Primitives/tests/Helpers.cs b/src/libraries/System.Drawing.Primitives/tests/Helpers.cs deleted file mode 100644 index 8118a2a516356..0000000000000 --- a/src/libraries/System.Drawing.Primitives/tests/Helpers.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace System.Drawing.Tests -{ - public static class Helpers - { - public const string IsDrawingSupported = nameof(Helpers) + "." + nameof(GetIsDrawingSupported); - - public static bool GetIsDrawingSupported() => /* ActiveIssue(24525) */ PlatformDetection.IsNotRedHatFamily6 && PlatformDetection.IsDrawingSupported; - } -} diff --git a/src/libraries/System.Drawing.Primitives/tests/System.Drawing.Primitives.Tests.csproj b/src/libraries/System.Drawing.Primitives/tests/System.Drawing.Primitives.Tests.csproj index 9e3af0b91eb5d..54a8c60a3450b 100644 --- a/src/libraries/System.Drawing.Primitives/tests/System.Drawing.Primitives.Tests.csproj +++ b/src/libraries/System.Drawing.Primitives/tests/System.Drawing.Primitives.Tests.csproj @@ -5,7 +5,6 @@ - diff --git a/src/libraries/System.IO.FileSystem/tests/Directory/Delete.cs b/src/libraries/System.IO.FileSystem/tests/Directory/Delete.cs index 78f881bd5b92e..066e3282ef284 100644 --- a/src/libraries/System.IO.FileSystem/tests/Directory/Delete.cs +++ b/src/libraries/System.IO.FileSystem/tests/Directory/Delete.cs @@ -11,7 +11,7 @@ namespace System.IO.Tests { public class Directory_Delete_str : FileSystemTest { - static bool IsBindMountSupported => RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && !PlatformDetection.IsInContainer && !PlatformDetection.IsRedHatFamily6; + static bool IsBindMountSupported => RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && !PlatformDetection.IsInContainer; #region Utilities diff --git a/src/libraries/System.IO.FileSystem/tests/File/Delete.cs b/src/libraries/System.IO.FileSystem/tests/File/Delete.cs index 59fe51b895cfa..e665abd6b529b 100644 --- a/src/libraries/System.IO.FileSystem/tests/File/Delete.cs +++ b/src/libraries/System.IO.FileSystem/tests/File/Delete.cs @@ -10,7 +10,7 @@ namespace System.IO.Tests { public class File_Delete : FileSystemTest { - static bool IsBindMountSupported => RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && !PlatformDetection.IsInContainer && !PlatformDetection.IsRedHatFamily6; + static bool IsBindMountSupported => RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && !PlatformDetection.IsInContainer; protected virtual void Delete(string path) { diff --git a/src/libraries/System.IO.Pipes/tests/AnonymousPipeTests/AnonymousPipeTest.Specific.cs b/src/libraries/System.IO.Pipes/tests/AnonymousPipeTests/AnonymousPipeTest.Specific.cs index a14a59d458393..b1f64ecd33eb4 100644 --- a/src/libraries/System.IO.Pipes/tests/AnonymousPipeTests/AnonymousPipeTest.Specific.cs +++ b/src/libraries/System.IO.Pipes/tests/AnonymousPipeTests/AnonymousPipeTest.Specific.cs @@ -79,7 +79,7 @@ public static void ClonedClient_ActsAsOriginalClient() } } - [ConditionalFact(typeof(PlatformDetection), "IsNotRedHatFamily6")] + [Fact] [PlatformSpecific(TestPlatforms.Linux)] // On Linux, setting the buffer size of the server will also set the buffer size of the client public static void Linux_BufferSizeRoundtrips() { diff --git a/src/libraries/System.Runtime.Extensions/tests/System/Runtime/ProfileOptimization.cs b/src/libraries/System.Runtime.Extensions/tests/System/Runtime/ProfileOptimization.cs index f120c39ff3732..83ef8f947ac2f 100644 --- a/src/libraries/System.Runtime.Extensions/tests/System/Runtime/ProfileOptimization.cs +++ b/src/libraries/System.Runtime.Extensions/tests/System/Runtime/ProfileOptimization.cs @@ -11,27 +11,13 @@ namespace System.Runtime.Tests { public class ProfileOptimizationTest : FileCleanupTestBase { - // Active issue https://github.com/dotnet/corefx/issues/31792 - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotRedHatFamily6))] + [Fact] public void ProfileOptimization_CheckFileExists() { string profileFile = GetTestFileName(); RemoteExecutor.Invoke((_profileFile) => { - // tracking down why test sporadically fails on RedHat69 - // write to the file first to check permissions - // See https://github.com/dotnet/corefx/issues/31792 - File.WriteAllText(_profileFile, "42"); - - // Verify this write succeeded - Assert.True(File.Exists(_profileFile), $"'{_profileFile}' does not exist"); - Assert.True(new FileInfo(_profileFile).Length > 0, $"'{_profileFile}' is empty"); - - // Delete the file and verify the delete - File.Delete(_profileFile); - Assert.True(!File.Exists(_profileFile), $"'{_profileFile} ought to not exist now"); - // Perform the test work ProfileOptimization.SetProfileRoot(Path.GetDirectoryName(_profileFile)); ProfileOptimization.StartProfile(Path.GetFileName(_profileFile)); diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/tests/RevocationTests/DynamicRevocationTests.cs b/src/libraries/System.Security.Cryptography.X509Certificates/tests/RevocationTests/DynamicRevocationTests.cs index 88bdf8326be68..274dce0fe4143 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/tests/RevocationTests/DynamicRevocationTests.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/tests/RevocationTests/DynamicRevocationTests.cs @@ -22,11 +22,6 @@ public static class DynamicRevocationTests private static readonly X509ChainStatusFlags ThisOsRevocationStatusUnknown = X509ChainStatusFlags.RevocationStatusUnknown | X509ChainStatusFlags.OfflineRevocation; - // RHEL6 uses a version of OpenSSL that (empirically) doesn't support designated responders. - // (There's a chance that we should be passing in extra stuff, but RHEL6 is the only platform - // still on OpenSSL 1.0.0/1.0.1 in 2019, so it seems OpenSSL-related) - private static readonly bool s_supportsDesignatedResponder = PlatformDetection.IsNotRedHatFamily6; - [Flags] public enum PkiOptions { @@ -57,9 +52,7 @@ public static IEnumerable AllViableRevocation { get { - int designationLimit = s_supportsDesignatedResponder ? 4 : 1; - - for (int designation = 0; designation < designationLimit; designation++) + for (int designation = 0; designation < 4; designation++) { PkiOptions designationOptions = (PkiOptions)(designation << 16);