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
public class RuntimeIdentifierTests
{
[Fact]
- [ActiveIssue("https://github.com/dotnet/runtime/issues/26780")] // need a new testhost
public void VerifyOSRid()
{
Assert.NotNull(RuntimeInformation.RuntimeIdentifier);
}
[Fact]
- [ActiveIssue("https://github.com/dotnet/runtime/issues/26780")] // need a new testhost
public void VerifyEnvironmentVariable()
{
RemoteInvokeOptions options = new RemoteInvokeOptions();
}
[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);