Skip to content

Commit 45fbfa7

Browse files
Copilotsmith1511
andcommitted
Update Windows 2025 version to use specific build number 26100 instead of range
Co-authored-by: smith1511 <1001494+smith1511@users.noreply.github.com>
1 parent 0836eed commit 45fbfa7

File tree

17 files changed

+35
-29
lines changed

17 files changed

+35
-29
lines changed

parts/windows/windowscsehelper.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ function Get-WindowsVersion {
379379
"17763" { return "1809" }
380380
"20348" { return "ltsc2022" }
381381
"25398" { return "23H2" }
382-
{$_ -ge "25399" -and $_ -le "30397"} { return "test2025" }
382+
"26100" { return "test2025" }
383383
Default {
384384
Set-ExitCode -ExitCode $global:WINDOWS_CSE_ERROR_NOT_FOUND_BUILD_NUMBER -ErrorMessage "Failed to find the windows build number: $buildNumber"
385385
}
@@ -392,7 +392,7 @@ function Get-WindowsPauseVersion {
392392
"17763" { return "1809" }
393393
"20348" { return "ltsc2022" }
394394
"25398" { return "ltsc2022" }
395-
{$_ -ge "25399" -and $_ -le "30397"} { return "ltsc2022" }
395+
"26100" { return "ltsc2022" }
396396
Default {
397397
Set-ExitCode -ExitCode $global:WINDOWS_CSE_ERROR_NOT_FOUND_BUILD_NUMBER -ErrorMessage "Failed to find the windows build number: $buildNumber"
398398
}

parts/windows/windowscsehelper.tests.ps1

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -156,18 +156,21 @@ Describe 'Get-WindowsVersion and Get-WindowsPauseVersion' {
156156
$windowsVersion | Should -Be $expectedVersion
157157
}
158158

159-
It 'build number is from prerelease of windows 2025' {
160-
Mock Get-WindowsBuildNumber -MockWith { return "25399" }
159+
It 'build number is from Windows 2025' {
160+
Mock Get-WindowsBuildNumber -MockWith { return "26100" }
161161
$windowsVersion = Get-WindowsVersion
162162
$expectedVersion = "test2025"
163163
$windowsVersion | Should -Be $expectedVersion
164164
}
165165

166-
It 'build number is from prerelease of windows 2025' {
166+
It 'build number is from prerelease of windows 2025 (should now fail)' {
167167
Mock Get-WindowsBuildNumber -MockWith { return "30397" }
168-
$windowsVersion = Get-WindowsVersion
169-
$expectedVersion = "test2025"
170-
$windowsVersion | Should -Be $expectedVersion
168+
try {
169+
$windowsVersion = Get-WindowsVersion
170+
} catch {
171+
Write-Host "Expected exception: $_"
172+
}
173+
Assert-MockCalled -CommandName 'Set-ExitCode' -Exactly -Times 1 -ParameterFilter { $ExitCode -eq $global:WINDOWS_CSE_ERROR_NOT_FOUND_BUILD_NUMBER }
171174
}
172175

173176
It 'build number is unknown' {
@@ -180,18 +183,21 @@ Describe 'Get-WindowsVersion and Get-WindowsPauseVersion' {
180183
Assert-MockCalled -CommandName 'Set-ExitCode' -Exactly -Times 1 -ParameterFilter { $ExitCode -eq $global:WINDOWS_CSE_ERROR_NOT_FOUND_BUILD_NUMBER }
181184
}
182185

183-
It 'build number is from prerelease of windows 2025' {
184-
Mock Get-WindowsBuildNumber -MockWith { return "25399" }
186+
It 'build number is from Windows 2025' {
187+
Mock Get-WindowsBuildNumber -MockWith { return "26100" }
185188
$windowsPauseVersion = Get-WindowsPauseVersion
186189
$expectedPauseVersion = "ltsc2022"
187190
$windowsPauseVersion | Should -Be $expectedPauseVersion
188191
}
189192

190-
It 'build number is from prerelease of windows 2025' {
193+
It 'build number is from prerelease of windows 2025 (should now fail)' {
191194
Mock Get-WindowsBuildNumber -MockWith { return "30397" }
192-
$windowsPauseVersion = Get-WindowsPauseVersion
193-
$expectedPauseVersion = "ltsc2022"
194-
$windowsPauseVersion | Should -Be $expectedPauseVersion
195+
try {
196+
$windowsPauseVersion = Get-WindowsPauseVersion
197+
} catch {
198+
Write-Host "Expected exception: $_"
199+
}
200+
Assert-MockCalled -CommandName 'Set-ExitCode' -Exactly -Times 1 -ParameterFilter { $ExitCode -eq $global:WINDOWS_CSE_ERROR_NOT_FOUND_BUILD_NUMBER }
195201
}
196202
}
197203

pkg/agent/testdata/AKSWindows2019+CustomCloud+ootcredentialprovider/CustomData

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

pkg/agent/testdata/AKSWindows2019+CustomCloud/CustomData

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

pkg/agent/testdata/AKSWindows2019+CustomVnet/CustomData

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

pkg/agent/testdata/AKSWindows2019+EnablePrivateClusterHostsConfigAgent/CustomData

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

pkg/agent/testdata/AKSWindows2019+K8S116/CustomData

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

pkg/agent/testdata/AKSWindows2019+K8S117/CustomData

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

pkg/agent/testdata/AKSWindows2019+K8S118/CustomData

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

pkg/agent/testdata/AKSWindows2019+K8S119+CSI/CustomData

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)