Run SSH and ShellHost tests

This commit is contained in:
Vivian Thiebaut 2022-11-15 15:00:13 -05:00
parent 47e734c1fb
commit fea0542d1f
3 changed files with 15 additions and 14 deletions

View File

@ -692,6 +692,7 @@ function Invoke-OpenSSHE2ETest
# $testFolders = @(Get-ChildItem *.tests.ps1 -Recurse | ForEach-Object{ Split-Path $_.FullName} | Sort-Object -Unique) # $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 $testFolders -OutputFormat NUnitXml -OutputFile $Script:E2ETestResultsFile -Tag $pri -PassThru
Invoke-Pester .\SSH.tests.ps1 -OutputFormat NUnitXml -OutputFile $Script:E2ETestResultsFile -Tag $pri -PassThru Invoke-Pester .\SSH.tests.ps1 -OutputFormat NUnitXml -OutputFile $Script:E2ETestResultsFile -Tag $pri -PassThru
Invoke-Pester .\ShellHost.tests.ps1 -OutputFormat NUnitXml -OutputFile $Script:E2ETestResultsFile -Tag $pri -PassThru
Pop-Location Pop-Location
} }

View File

@ -220,7 +220,7 @@ Describe "E2E scenarios for ssh client" -Tags "CI" {
It "$tC.$tI - powershell as default shell and double quotes in cmdline" { It "$tC.$tI - powershell as default shell and double quotes in cmdline" {
# actual command line ssh target echo `"hello`" # actual command line ssh target echo `"hello`"
$o = ssh test_target echo `"hello`" $o = ssh test_target echo `"hello`"
$o | Should Be "`"hello`"" $o | Should Be "hello"
} }
It "$tC.$tI - multiple commands with double quotes in powershell cmdlet" -skip:$skip { It "$tC.$tI - multiple commands with double quotes in powershell cmdlet" -skip:$skip {
# actual command line ssh target cd "$env:programfiles";pwd # actual command line ssh target cd "$env:programfiles";pwd
@ -233,7 +233,7 @@ Describe "E2E scenarios for ssh client" -Tags "CI" {
# actual command line ssh target dir "$env:programfiles";cd "$env:programfiles";pwd # 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 $LASTEXITCODE | Should Be 0
#$o -contains "Program Files" | Should Be $True #$o -contains "Program Files" | Shosshuld Be $True
$match = $o -match "Program Files" $match = $o -match "Program Files"
$match.count | Should Be 3 $match.count | Should Be 3
} }

View File

@ -23,18 +23,18 @@ Describe "E2E scenarios for ssh-shellhost" -Tags "CI" {
} }
It "$tC.$tI - various quote tests" -skip:$skip { It "$tC.$tI - various quote tests" -skip:$skip {
$o = ssh-shellhost -c cmd /c echo hello $o = ssh-shellhost -c cmd /c echo hello
$o | Should Be "hello" $o | Should Be "hello"
$o = ssh-shellhost -c `"cmd /c echo hello`" $o = ssh-shellhost -c "cmd /c echo hello"
$o | Should Be "hello" $o | Should Be "hello"
$o = ssh-shellhost -c cmd /c echo `"hello`" $o = ssh-shellhost -c cmd /c echo "hello"
$o | Should Be "`"hello`"" $o | Should Be "hello"
$o = ssh-shellhost -c `"cmd /c echo `"hello`"`" $o = ssh-shellhost -c "cmd /c echo `"hello`""
$o | Should Be "`"hello`"" $o | Should Be "`\`"hello`\`""
$o = ssh-shellhost -c `"cmd /c echo `"hello`" $o = ssh-shellhost -c "cmd /c echo `"hello"
$o | Should Be "`"hello" $o | Should Be "`\`"hello"
$o = ssh-shellhost -c `"`"cmd`" /c echo `"hello`"`" $o = ssh-shellhost -c "cmd" /c echo "hello"
$o | Should Be "`"hello`"" $o | Should Be "hello"
} }