1
0
Fork 0
mirror of https://github.com/VSadov/Satori.git synced 2025-06-10 01:50:53 +09:00

Add C library detection to processinfo3 test (#88260)

This commit is contained in:
Justin Anderson 2023-07-10 13:17:10 -07:00 committed by GitHub
parent 89d6fd50a3
commit e40d6e165c
Signed by: github
GPG key ID: 4AEE18F83AFDEB23

View file

@ -288,7 +288,29 @@ namespace Tracing.Tests.ProcessInfoValidation
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
expectedPortableRidOs = "linux";
// Check process modules for C library type indication to determine
// which linux RID OS is applicable.
Logger.logger.Log("Begin checking process modules to determine C library type.");
for (int i = 0; i < currentProcess.Modules.Count; i++)
{
ProcessModule module = currentProcess.Modules[i];
Logger.logger.Log($"- {module.ModuleName}");
if (module.ModuleName.StartsWith("libc.", StringComparison.Ordinal) ||
module.ModuleName.StartsWith("libc-", StringComparison.Ordinal))
{
Logger.logger.Log("Found gnu libc indicator.");
expectedPortableRidOs = "linux";
break;
}
else if (module.ModuleName.StartsWith("ld-musl-", StringComparison.Ordinal))
{
Logger.logger.Log("Found musl libc indicator.");
expectedPortableRidOs = "linux-musl";
break;
}
}
Logger.logger.Log("Finished checking process modules.");
}
Utils.Assert(!string.IsNullOrEmpty(expectedPortableRidOs), $"Unable to calculate expected portable RID OS.");