File tree Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Original file line number Diff line number Diff line change @@ -165,6 +165,9 @@ Describe "Setup Tests" -Tags "Setup" {
165165 @ {
166166 Name = ' sshd.exe'
167167 },
168+ @ {
169+ Name = ' sshd-session.exe'
170+ },
168171 @ {
169172 Name = ' ssh.exe'
170173 },
@@ -253,6 +256,37 @@ Describe "Setup Tests" -Tags "Setup" {
253256 }
254257 }
255258
259+ Context " $tC - Validate OpenSSH version" {
260+ BeforeAll {
261+ $tI = 1
262+ $sshExePath = Join-Path $binPath " ssh.exe"
263+ if (-not (Test-Path - Path $sshExePath )) {
264+ Throw " ssh.exe not found at $sshExePath "
265+ }
266+ }
267+ AfterAll { $tC ++ }
268+ AfterEach { $tI ++ }
269+
270+ It " $tC .$tI - Validate ssh -V output matches ssh.exe properties" {
271+ $pattern = " \d+\.\dp\d" # i.e. 9.2p2
272+
273+ $sshVersionOutput = & $sshExePath - V 2>&1 | Select-String - Pattern " OpenSSH"
274+ $match = $sshVersionOutput.Line -match $pattern
275+ if (-not $match ) {
276+ throw " No matching version pattern found from ssh -V output"
277+ }
278+ $versionNumber = $Matches [0 ]
279+
280+ $fileVersionInfo = Get-Item $sshExePath | Select-Object - ExpandProperty VersionInfo
281+ $fileVersion = $fileVersionInfo.ProductVersion
282+ $match = $fileVersion -match $pattern
283+ if (-not $match ) {
284+ throw " No matching version pattern found from ssh.exe properties"
285+ }
286+ $versionNumber | Should Match $Matches [0 ]
287+ }
288+ }
289+
256290 Context " $tC - Validate Openssh registry entries" {
257291 BeforeAll {
258292 $tI = 1
Original file line number Diff line number Diff line change 44#define SSH_WINDOWS_BANNER " Win32-OpenSSH-GitHub"
55#define SSH_VERSION SSH_WINDOWS_VERSION SSH_WINDOWS_BANNER
66
7- #define SSH_PORTABLE "p1 "
7+ #define SSH_PORTABLE "p2 "
88#define SSH_RELEASE SSH_WINDOWS_VERSION SSH_PORTABLE SSH_WINDOWS_BANNER
You can’t perform that action at this time.
0 commit comments