Skip to content

Patch version fix #785

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions regress/pesterTests/Setup.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ Describe "Setup Tests" -Tags "Setup" {
@{
Name = 'sshd.exe'
},
@{
Name = 'sshd-session.exe'
},
@{
Name = 'ssh.exe'
},
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion version.h
Original file line number Diff line number Diff line change
Expand Up @@ -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