Fix SSH tests
This commit is contained in:
parent
c5b985c66f
commit
47e734c1fb
|
@ -691,7 +691,7 @@ function Invoke-OpenSSHE2ETest
|
|||
Write-Log -Message "Running OpenSSH E2E tests..."
|
||||
# $testFolders = @(Get-ChildItem *.tests.ps1 -Recurse | ForEach-Object{ Split-Path $_.FullName} | Sort-Object -Unique)
|
||||
# Invoke-Pester $testFolders -OutputFormat NUnitXml -OutputFile $Script:E2ETestResultsFile -Tag $pri -PassThru
|
||||
Invoke-Pester .\FileBasedLogging.tests.ps1 -OutputFormat NUnitXml -OutputFile $Script:E2ETestResultsFile -Tag $pri -PassThru
|
||||
Invoke-Pester .\SSH.tests.ps1 -OutputFormat NUnitXml -OutputFile $Script:E2ETestResultsFile -Tag $pri -PassThru
|
||||
Pop-Location
|
||||
}
|
||||
|
||||
|
|
|
@ -153,7 +153,7 @@ Describe "E2E scenarios for ssh client" -Tags "CI" {
|
|||
|
||||
It "$tC.$tI - multiple double quotes in cmdline" {
|
||||
# actual command line ssh target \"cmd\" /c \"echo hello\"
|
||||
$o = ssh test_target `\`"cmd`\`" /c `\`"echo hello`\`"
|
||||
$o = ssh test_target `"cmd`" /c `"echo hello`"
|
||||
$o | Should Be "hello"
|
||||
}
|
||||
|
||||
|
@ -219,19 +219,19 @@ Describe "E2E scenarios for ssh client" -Tags "CI" {
|
|||
}
|
||||
It "$tC.$tI - powershell as default shell and double quotes in cmdline" {
|
||||
# actual command line ssh target echo `"hello`"
|
||||
$o = ssh test_target echo ``\`"hello``\`"
|
||||
$o = ssh test_target echo `"hello`"
|
||||
$o | Should Be "`"hello`""
|
||||
}
|
||||
It "$tC.$tI - multiple commands with double quotes in powershell cmdlet" -skip:$skip {
|
||||
# actual command line ssh target cd "$env:programfiles";pwd
|
||||
$o = ssh test_target "cd \`"`$env:programfiles\`";pwd"
|
||||
$o = ssh test_target "cd `"`$env:programfiles\`";pwd"
|
||||
$LASTEXITCODE | Should Be 0
|
||||
$match = $o -match "Program Files"
|
||||
$match.count | Should be 1
|
||||
}
|
||||
It "$tC.$tI - multiple commands with double quotes in powershell cmdlet" -skip:$skip {
|
||||
# actual command line ssh target dir "$env:programfiles";cd "$env:programfiles";pwd
|
||||
$o = ssh test_target "dir \`"`$env:programfiles\`";cd \`"`$env:programfiles\`";pwd"
|
||||
$o = ssh test_target "dir `"`$env:programfiles\`";cd `"`$env:programfiles\`";pwd"
|
||||
$LASTEXITCODE | Should Be 0
|
||||
#$o -contains "Program Files" | Should Be $True
|
||||
$match = $o -match "Program Files"
|
||||
|
@ -263,7 +263,7 @@ Describe "E2E scenarios for ssh client" -Tags "CI" {
|
|||
}
|
||||
It "$tC.$tI - cmd as default shell and double quotes in cmdline" {
|
||||
# actual command line ssh target echo "\"hello\""
|
||||
$o = ssh test_target 'echo "\"hello\""'
|
||||
$o = ssh test_target echo "`"hello`""
|
||||
$o | Should Be "`"hello`""
|
||||
}
|
||||
It "$tC.$tI - single quotes in powershell cmdlet" -skip:$skip {
|
||||
|
@ -286,7 +286,7 @@ Describe "E2E scenarios for ssh client" -Tags "CI" {
|
|||
}
|
||||
It "$tC.$tI - shellhost as default shell and multiple double quotes in cmdline" {
|
||||
# actual command line ssh target \"cmd\" /c \"echo \"hello\"\"
|
||||
$o = ssh test_target `\`"cmd`\`" /c `\`"echo \`"hello\`"`\`"
|
||||
$o = ssh test_target `"cmd`" /c `"echo `"hello`"`"
|
||||
$o | Should Be "`"hello`""
|
||||
}
|
||||
}
|
||||
|
@ -302,7 +302,7 @@ Describe "E2E scenarios for ssh client" -Tags "CI" {
|
|||
$logFile | Should Contain "OpenSSH_"
|
||||
$logFile | Should Contain "Exit Status 0"
|
||||
}
|
||||
|
||||
ssh
|
||||
|
||||
It "$tC.$tI - cipher options (-c)" {
|
||||
#bad cipher
|
||||
|
|
Loading…
Reference in New Issue