Skip to content

Commit 5e2b081

Browse files
committed
modify -p tests to only run for Windows OS version 10 and above
1 parent 2653b08 commit 5e2b081

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

regress/pesterTests/SCP.Tests.ps1

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,13 @@ Describe "Tests for scp command" -Tags "CI" {
5252
Source = $SourceFilePath
5353
Destination = "test_target:$DestinationFilePath"
5454
Options = "-S `"$sshcmd`""
55-
},
55+
},
56+
@{
57+
Title = 'Simple copy remote file to local file'
58+
Source = "test_target:$SourceFilePath"
59+
Destination = $DestinationFilePath
60+
Options = "-p -c aes128-ctr -C"
61+
},
5662
@{
5763
Title = 'Simple copy local file to local dir'
5864
Source = $SourceFilePath
@@ -174,11 +180,8 @@ Describe "Tests for scp command" -Tags "CI" {
174180
$equal = @(Compare-Object (Get-ChildItem -path $SourceFilePath) (Get-ChildItem -path $DestinationFilePath) -Property Name, Length ).Length -eq 0
175181
$equal | Should Be $true
176182

177-
if($Options.contains("-p "))
183+
if($Options.contains("-p ") -and [System.Convert]::ToInt32((Get-WMIObject win32_operatingsystem).Version.Split(".")[0]) -ge 10)
178184
{
179-
# TODO: Test only
180-
Write-Verbose -Verbose "Source File LastWriteTime: $((Get-ChildItem -Path $SourceFilePath).LastWriteTime.DateTime)"
181-
Write-Verbose -Verbose "Dest File LastWriteTime: $((Get-ChildItem -Path $DestinationFilePath).LastWriteTime.DateTime)"
182185
$equal = @(Compare-Object (Get-ChildItem -path $SourceFilePath).LastWriteTime.DateTime (Get-ChildItem -path $DestinationFilePath).LastWriteTime.DateTime ).Length -eq 0
183186
$equal | Should Be $true
184187
}

0 commit comments

Comments
 (0)