Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ public void DumpRuntimeInformationToConsole()

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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -21,7 +20,6 @@ public void VerifyOSRid()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/26780")] // need a new testhost
public void VerifyEnvironmentVariable()
{
RemoteInvokeOptions options = new RemoteInvokeOptions();
Expand Down Expand Up @@ -63,33 +61,29 @@ public void VerifyAppContextVariableUnknown()
}

[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);
Expand Down