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" {
165
165
@ {
166
166
Name = ' sshd.exe'
167
167
},
168
+ @ {
169
+ Name = ' sshd-session.exe'
170
+ },
168
171
@ {
169
172
Name = ' ssh.exe'
170
173
},
@@ -253,6 +256,37 @@ Describe "Setup Tests" -Tags "Setup" {
253
256
}
254
257
}
255
258
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
+
256
290
Context " $tC - Validate Openssh registry entries" {
257
291
BeforeAll {
258
292
$tI = 1
Original file line number Diff line number Diff line change 4
4
#define SSH_WINDOWS_BANNER " Win32-OpenSSH-GitHub"
5
5
#define SSH_VERSION SSH_WINDOWS_VERSION SSH_WINDOWS_BANNER
6
6
7
- #define SSH_PORTABLE "p1 "
7
+ #define SSH_PORTABLE "p2 "
8
8
#define SSH_RELEASE SSH_WINDOWS_VERSION SSH_PORTABLE SSH_WINDOWS_BANNER
You can’t perform that action at this time.
0 commit comments