Skip to content

Commit

Permalink
Delete RHEL6 leftovers (#1648)
Browse files Browse the repository at this point in the history
Fixes #423
Closes dotnet/corefx#24525
Closes dotnet/corefx#37739
Closes dotnet/corefx#31792
  • Loading branch information
jkotas committed Jan 12, 2020
1 parent 557565a commit fb7edc0
Show file tree
Hide file tree
Showing 13 changed files with 8 additions and 78 deletions.
1 change: 0 additions & 1 deletion src/coreclr/init-distro-rid.sh
Expand Up @@ -26,7 +26,6 @@
#
# | OS | Expected RID |
# -------------------------------------------------
# | rhel6 | rhel.6-x64 |
# | alpine* | linux-musl-(arch) |
# | freeBSD | freebsd.(version)-x64 |
#
Expand Down
30 changes: 0 additions & 30 deletions src/installer/corehost/common/pal.unix.cpp
Expand Up @@ -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))
{
Expand Down Expand Up @@ -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);
}
Expand Down
Expand Up @@ -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;
Expand Down
Expand Up @@ -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
}
Expand Down
Expand Up @@ -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()
{
Expand Down
Expand Up @@ -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))]
Expand Down
13 changes: 0 additions & 13 deletions src/libraries/System.Drawing.Primitives/tests/Helpers.cs

This file was deleted.

Expand Up @@ -5,7 +5,6 @@
<ItemGroup>
<Compile Include="ColorTranslatorTests.cs" />
<Compile Include="DataContractSerializerTests.cs" />
<Compile Include="Helpers.cs" />
<Compile Include="PointFTests.cs" />
<Compile Include="PointTests.cs" />
<Compile Include="RectangleFTests.cs" />
Expand Down
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/libraries/System.IO.FileSystem/tests/File/Delete.cs
Expand Up @@ -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)
{
Expand Down
Expand Up @@ -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()
{
Expand Down
Expand Up @@ -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));
Expand Down
Expand Up @@ -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
{
Expand Down Expand Up @@ -57,9 +52,7 @@ public static IEnumerable<object[]> 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);

Expand Down

0 comments on commit fb7edc0

Please sign in to comment.