diff --git a/regress/pesterTests/Setup.Tests.ps1 b/regress/pesterTests/Setup.Tests.ps1 index fcd2e0b1f70..145fcbbb652 100644 --- a/regress/pesterTests/Setup.Tests.ps1 +++ b/regress/pesterTests/Setup.Tests.ps1 @@ -165,6 +165,9 @@ Describe "Setup Tests" -Tags "Setup" { @{ Name = 'sshd.exe' }, + @{ + Name = 'sshd-session.exe' + }, @{ Name = 'ssh.exe' }, @@ -253,6 +256,37 @@ Describe "Setup Tests" -Tags "Setup" { } } + Context "$tC - Validate OpenSSH version" { + BeforeAll { + $tI = 1 + $sshExePath = Join-Path $binPath "ssh.exe" + if (-not (Test-Path -Path $sshExePath)) { + Throw "ssh.exe not found at $sshExePath" + } + } + AfterAll { $tC++ } + AfterEach { $tI++ } + + It "$tC.$tI - Validate ssh -V output matches ssh.exe properties" { + $pattern = "\d+\.\dp\d" # i.e. 9.2p2 + + $sshVersionOutput = & $sshExePath -V 2>&1 | Select-String -Pattern "OpenSSH" + $match = $sshVersionOutput.Line -match $pattern + if (-not $match) { + throw "No matching version pattern found from ssh -V output" + } + $versionNumber = $Matches[0] + + $fileVersionInfo = Get-Item $sshExePath | Select-Object -ExpandProperty VersionInfo + $fileVersion = $fileVersionInfo.ProductVersion + $match = $fileVersion -match $pattern + if (-not $match) { + throw "No matching version pattern found from ssh.exe properties" + } + $versionNumber | Should Match $Matches[0] + } + } + Context "$tC - Validate Openssh registry entries" { BeforeAll { $tI=1 diff --git a/version.h b/version.h index 57f161d0f21..c737c2ae14c 100644 --- a/version.h +++ b/version.h @@ -4,5 +4,5 @@ #define SSH_WINDOWS_BANNER " Win32-OpenSSH-GitHub" #define SSH_VERSION SSH_WINDOWS_VERSION SSH_WINDOWS_BANNER -#define SSH_PORTABLE "p1" +#define SSH_PORTABLE "p2" #define SSH_RELEASE SSH_WINDOWS_VERSION SSH_PORTABLE SSH_WINDOWS_BANNER