Enable RuntimeIdentifierTests (#34595)
authorEric Erhardt <eric.erhardt@microsoft.com>
Tue, 7 Apr 2020 18:57:31 +0000 (13:57 -0500)
committerGitHub <noreply@github.com>
Tue, 7 Apr 2020 18:57:31 +0000 (13:57 -0500)
* Enable RuntimeIdentifierTests

Now that we have an updated test host, we can enable the RuntimeInformation.RuntimeIdentifier tests that are disabled.

Fix #26780

* Trim quotes from ID in /etc/os-release

src/libraries/System.Runtime.InteropServices.RuntimeInformation/tests/DescriptionNameTests.cs
src/libraries/System.Runtime.InteropServices.RuntimeInformation/tests/RuntimeIdentifierTests.cs

index bbc28bc..d65f92e 100644 (file)
@@ -117,8 +117,8 @@ namespace System.Runtime.InteropServices.RuntimeInformationTests
 
             if (osd.Contains("Linux"))
             {
-                // Dump several procfs files
-                foreach (string path in new string[] { "/proc/self/mountinfo", "/proc/self/cgroup", "/proc/self/limits" })
+                // Dump several procfs files and /etc/os-release
+                foreach (string path in new string[] { "/proc/self/mountinfo", "/proc/self/cgroup", "/proc/self/limits", "/etc/os-release" })
                 {
                     Console.WriteLine($"### CONTENTS OF \"{path}\":");
                     try
index ac7a0b7..f907025 100644 (file)
@@ -12,7 +12,6 @@ namespace System.Runtime.InteropServices.RuntimeInformationTests
     public class RuntimeIdentifierTests
     {
         [Fact]
-        [ActiveIssue("https://github.com/dotnet/runtime/issues/26780")] // need a new testhost
         public void VerifyOSRid()
         {
             Assert.NotNull(RuntimeInformation.RuntimeIdentifier);
@@ -21,7 +20,6 @@ namespace System.Runtime.InteropServices.RuntimeInformationTests
         }
 
         [Fact]
-        [ActiveIssue("https://github.com/dotnet/runtime/issues/26780")] // need a new testhost
         public void VerifyEnvironmentVariable()
         {
             RemoteInvokeOptions options = new RemoteInvokeOptions();
@@ -63,33 +61,29 @@ namespace System.Runtime.InteropServices.RuntimeInformationTests
         }
 
         [Fact, PlatformSpecific(TestPlatforms.Windows)]
-        [ActiveIssue("https://github.com/dotnet/runtime/issues/26780")] // need a new testhost
         public void VerifyWindowsRid()
         {
             Assert.StartsWith("win", RuntimeInformation.RuntimeIdentifier, StringComparison.OrdinalIgnoreCase);
         }
 
         [Fact, PlatformSpecific(TestPlatforms.Linux)]
-        [ActiveIssue("https://github.com/dotnet/runtime/issues/26780")] // need a new testhost
         public void VerifyLinuxRid()
         {
             string expectedOSName = File.ReadAllLines("/etc/os-release")
                 .First(line => line.StartsWith("ID=", StringComparison.OrdinalIgnoreCase))
                 .Substring("ID=".Length)
-                .Trim();
+                .Trim('\"', '\'');
 
             Assert.StartsWith(expectedOSName, RuntimeInformation.RuntimeIdentifier, StringComparison.OrdinalIgnoreCase);
         }
 
         [Fact, PlatformSpecific(TestPlatforms.FreeBSD)]
-        [ActiveIssue("https://github.com/dotnet/runtime/issues/26780")] // need a new testhost
         public void VerifyFreeBSDRid()
         {
             Assert.StartsWith("freebsd", RuntimeInformation.RuntimeIdentifier, StringComparison.OrdinalIgnoreCase);
         }
 
         [Fact, PlatformSpecific(TestPlatforms.OSX)]
-        [ActiveIssue("https://github.com/dotnet/runtime/issues/26780")] // need a new testhost
         public void VerifyOSXRid()
         {
             Assert.StartsWith("osx", RuntimeInformation.RuntimeIdentifier, StringComparison.OrdinalIgnoreCase);