Skip to content

Commit c16f32d

Browse files
saibulususaibulusu
andauthored
RHEL 9 support (#292)
* Providing support for RHEL 9. * Bumping version. --------- Co-authored-by: saibulusu <[email protected]>
1 parent d1d013c commit c16f32d

File tree

8 files changed

+56
-5
lines changed

8 files changed

+56
-5
lines changed

.pipelines/azure-pipelines-linux.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ resources:
1616
options: --entrypoint=""
1717

1818
variables:
19-
VcVersion : 1.14.13
19+
VcVersion : 1.14.14
2020
ROOT: $(Build.SourcesDirectory)
2121
CDP_DEFINITION_BUILD_COUNT: $[counter('', 0)] # needed for onebranch.pipeline.version task https://aka.ms/obpipelines/versioning
2222
ENABLE_PRS_DELAYSIGN: 1
@@ -654,4 +654,4 @@ stages:
654654
msal_client_ID: 'f407a268-1184-4845-92b1-eebfbe0749c0'
655655
package_path: '$(Agent.BuildDirectory)/drop/packages'
656656
repository: 'microsoft-ubuntu-zesty-prod-apt'
657-
release: 'zesty'
657+
release: 'zesty'

.pipelines/azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pool:
1818
vmImage: windows-latest
1919

2020
variables:
21-
VcVersion : 1.14.13
21+
VcVersion : 1.14.14
2222
ROOT: $(Build.SourcesDirectory)
2323
CDP_DEFINITION_BUILD_COUNT: $[counter('', 0)] # needed for onebranch.pipeline.version task https://aka.ms/obpipelines/versioning
2424
ENABLE_PRS_DELAYSIGN: 1
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
 Static hostname: linux-vm-5
2+
Icon name: computer-vm
3+
Chassis: vm 🖴
4+
Machine ID: 86687b25d03f4b0ba54e801b9da2e1b6
5+
Boot ID: 70a5733f02cd42098b9b09dbb9145ad4
6+
Virtualization: microsoft
7+
Operating System: Red Hat Enterprise Linux 9.3 (Plow)
8+
CPE OS Name: cpe:/o:redhat:enterprise_linux:9::baseos
9+
Kernel: Linux 5.14.0-362.8.1.el9_3.x86_64
10+
Architecture: x86-64
11+
Hardware Vendor: Microsoft Corporation
12+
Hardware Model: Virtual Machine
13+
Firmware Version: Hyper-V UEFI Release v4.1
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
NAME="Red Hat Enterprise Linux"
2+
VERSION="9.3 (Plow)"
3+
ID="rhel"
4+
ID_LIKE="fedora"
5+
VERSION_ID="9.3"
6+
PLATFORM_ID="platform:el9"
7+
PRETTY_NAME="Red Hat Enterprise Linux 9.3 (Plow)"
8+
ANSI_COLOR="0;31"
9+
LOGO="fedora-logo-icon"
10+
CPE_NAME="cpe:/o:redhat:enterprise_linux:9::baseos"
11+
HOME_URL="https://www.redhat.com/"
12+
DOCUMENTATION_URL="https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9"
13+
BUG_REPORT_URL="https://bugzilla.redhat.com/"
14+
15+
REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 9"
16+
REDHAT_BUGZILLA_PRODUCT_VERSION=9.3
17+
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
18+
REDHAT_SUPPORT_PRODUCT_VERSION="9.3"

src/VirtualClient/VirtualClient.Contracts.UnitTests/Parser/HostnamectlParserUnitTests.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,5 +114,15 @@ public void HostnamectlParserRecognizeSUSE()
114114
Assert.AreEqual(LinuxDistribution.SUSE, this.testParser.Parse().LinuxDistribution);
115115
Assert.AreEqual("SUSE Linux Enterprise Server 15 SP3", this.testParser.Parse().OperationSystemFullName);
116116
}
117+
118+
[Test]
119+
public void HostnamectlParserRecognizeRedhat93()
120+
{
121+
string outputPath = Path.Combine(this.ExamplePath, "RHEL9Example.txt");
122+
this.rawText = File.ReadAllText(outputPath);
123+
this.testParser = new HostnamectlParser(this.rawText);
124+
Assert.AreEqual(LinuxDistribution.RHEL8, this.testParser.Parse().LinuxDistribution);
125+
Assert.AreEqual("Red Hat Enterprise Linux 9.3 (Plow)", this.testParser.Parse().OperationSystemFullName);
126+
}
117127
}
118128
}

src/VirtualClient/VirtualClient.Contracts.UnitTests/Parser/OsReleaseFileParserUnitTests.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,15 @@ public void OsReleaseFileParserrRecognizeDebian11()
5555
Assert.AreEqual(LinuxDistribution.Debian, this.testParser.Parse().LinuxDistribution);
5656
Assert.AreEqual("Debian GNU/Linux 11 (bullseye)", this.testParser.Parse().OperationSystemFullName);
5757
}
58+
59+
[Test]
60+
public void OsReleaseFileParserrRecognizeRHEL93()
61+
{
62+
string outputPath = Path.Combine(this.ExamplePath, "RHEL93Example.txt");
63+
this.rawText = File.ReadAllText(outputPath);
64+
this.testParser = new OsReleaseFileParser(this.rawText);
65+
Assert.AreEqual(LinuxDistribution.RHEL8, this.testParser.Parse().LinuxDistribution);
66+
Assert.AreEqual("Red Hat Enterprise Linux 9.3 (Plow)", this.testParser.Parse().OperationSystemFullName);
67+
}
5868
}
5969
}

src/VirtualClient/VirtualClient.Contracts/Parser/HostnamectlParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public override LinuxDistributionInfo Parse()
3030
Regex ubuntuRegex = new Regex("Operating System: Ubuntu", RegexOptions.Multiline | RegexOptions.IgnoreCase);
3131
Regex debianRegex = new Regex("Operating System: Debian", RegexOptions.Multiline | RegexOptions.IgnoreCase);
3232
Regex rhel7Regex = new Regex(@"Operating System: Red Hat Enterprise Linux 7", RegexOptions.Multiline | RegexOptions.IgnoreCase);
33-
Regex rhel8Regex = new Regex(@"Operating System: Red Hat Enterprise Linux 8.", RegexOptions.Multiline | RegexOptions.IgnoreCase);
33+
Regex rhel8Regex = new Regex(@"Operating System: Red Hat Enterprise Linux (8|9).", RegexOptions.Multiline | RegexOptions.IgnoreCase);
3434
Regex flatcarRegex = new Regex("Operating System: Flatcar", RegexOptions.Multiline | RegexOptions.IgnoreCase);
3535
Regex centos7Regex = new Regex("Operating System: CentOS Linux 7", RegexOptions.Multiline | RegexOptions.IgnoreCase);
3636
Regex centos8Regex = new Regex("Operating System: CentOS Linux 8", RegexOptions.Multiline | RegexOptions.IgnoreCase);

src/VirtualClient/VirtualClient.Contracts/Parser/OsReleaseFileParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public override LinuxDistributionInfo Parse()
3131
Regex ubuntuRegex = new Regex("Name=(\")?Ubuntu", RegexOptions.Multiline | RegexOptions.IgnoreCase);
3232
Regex debianRegex = new Regex("Name=(\")?Debian", RegexOptions.Multiline | RegexOptions.IgnoreCase);
3333
Regex rhel7Regex = new Regex("PRETTY_NAME=(\")?Red Hat Enterprise Linux 7.", RegexOptions.Multiline | RegexOptions.IgnoreCase);
34-
Regex rhel8Regex = new Regex("PRETTY_NAME=(\")?Red Hat Enterprise Linux 8.", RegexOptions.Multiline | RegexOptions.IgnoreCase);
34+
Regex rhel8Regex = new Regex("PRETTY_NAME=(\")?Red Hat Enterprise Linux (8|9).", RegexOptions.Multiline | RegexOptions.IgnoreCase);
3535
Regex flatcarRegex = new Regex("Name=(\")?Flatcar", RegexOptions.Multiline | RegexOptions.IgnoreCase);
3636
Regex centos7Regex = new Regex("Name=(\")?CentOS Linux 7", RegexOptions.Multiline | RegexOptions.IgnoreCase);
3737
Regex centos8Regex = new Regex("Name=(\")?CentOS Linux 8", RegexOptions.Multiline | RegexOptions.IgnoreCase);

0 commit comments

Comments
 (0)