Add Azure Linux distribution detection to test infrastructure
The test infrastructure uses RuntimeInformation.OSDescription and RuntimeIdentifier to detect OS distributions for conditional test execution. Azure Linux (successor to CBL-Mariner) is not recognized, causing distribution detection to fail with:
-
RuntimeInformation.OSDescription = "Microsoft Azure Linux 3.0" -
RuntimeIdentifier = "azurelinux.3.0-x64"
Changes
- Added
"azurelinux"to RuntimeIdentifier detection list, mapping toOSID.Mariner - Added
"Microsoft Azure Linux"to OSDescription detection list, mapping toOSID.Mariner
Both use case-insensitive substring matching via IndexOf, making detection version-agnostic (works for 3.0, 4.0, future versions).
private static List<Tuple<string, OSID>> _runtimeToOSID = new List<Tuple<string, OSID>>
{
new Tuple<string, OSID>("azurelinux", OSID.Mariner), // Azure Linux (successor to CBL-Mariner)
new Tuple<string, OSID>("Mariner", OSID.Mariner),
// ... other distributions
};
[!WARNING]
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
kijvsblobprodcus387.vsblob.vsassets.io
- Triggering command:
/usr/bin/dotnet dotnet build Infrastructure.Common.csproj(dns block)l49vsblobprodcus358.vsblob.vsassets.io
- Triggering command:
/home/REDACTED/work/wcf/wcf/.dotnet/dotnet /home/REDACTED/work/wcf/wcf/.dotnet/dotnet msbuild /m /nologo /clp:Summary /v:minimal /nr:true /warnaserror /p:TreatWarningsAsErrors=true /p:ContinuousIntegrationBuild=false /home/REDACTED/work/wcf/wcf/artifacts/toolset/restore.proj /t:__WriteToolsetLocation /clp:ErrorsOnly;NoSummary /p:__ToolsetLocationOutputFile=/home/REDACTED/work/wcf/wcf/artifacts/toolset/11.0.0-beta.25615.1.txt(dns block)- Triggering command:
/usr/bin/dotnet dotnet build Infrastructure.Common.csproj(dns block)If you need me to access, download, or install something from one of these locations, you can either:
- Configure Actions setup steps to set up my environment, which run before the firewall is enabled
- Add the appropriate URLs or hosts to the custom allowlist in this repository's Copilot coding agent settings (admins only)
Original prompt
This section details on the original issue you should resolve
<issue_title>Add support for Azure Linux to the test infrastructure</issue_title> <issue_description>We have the ability to skip tests based on the Linux distribution that is being run. We don't recognize the Azure Linux distribution.
When running on Azure Linux, the following values are currently set: RuntimeInformation.OSDescription = "Microsoft Azure Linux 3.0" RuntimeIdentifier = "azurelinux.3.0-x64"
The distribution detection code needs to not be version dependent. In other words, when Microsoft Azure Linux 4.0 is released, the same detection code should continue to work. </issue_description>
Comments on the Issue (you are @copilot in this section)
- Fixes dotnet/wcf#5874
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
Rename the existing Mariner enum to AzureLinux as that will be the name going forward. Fix up any references to OSID.Mariner to use the new name. Update the comments to to have mariner detection reference Azure Linux instead of the other way around.
@copilot, rename the existing Mariner enum to AzureLinux as that will be the name going forward. Fix up any references to OSID.Mariner to use the new name. Update the comments to to have mariner detection reference Azure Linux instead of the other way around.
@copilot, rename the existing Mariner enum to AzureLinux as that will be the name going forward. Fix up any references to OSID.Mariner to use the new name. Update the comments to to have mariner detec...
Done in commit 41c866e. Renamed OSID.Mariner to OSID.AzureLinux and updated all references. The comment now indicates that "Mariner" detection is for CBL-Mariner (legacy name for Azure Linux).
Rename the existing Mariner enum to AzureLinux as that will be the name going forward. Fix up any references to OSID.Mariner to use the new name. Update the comments to to have mariner detection refer...
Done in commit 41c866e. Renamed OSID.Mariner to OSID.AzureLinux and updated all references. The comment now indicates that "Mariner" detection is for CBL-Mariner (legacy name for Azure Linux).