diff --git a/contrib/win32/openssh/OpenSSHTestHelper.psm1 b/contrib/win32/openssh/OpenSSHTestHelper.psm1 index 731bb9810..422ebf883 100644 --- a/contrib/win32/openssh/OpenSSHTestHelper.psm1 +++ b/contrib/win32/openssh/OpenSSHTestHelper.psm1 @@ -20,6 +20,7 @@ $Script:UnitTestResultsFile = Join-Path $TestDataPath $UnitTestResultsFileName $Script:TestSetupLogFile = Join-Path $TestDataPath $TestSetupLogFileName $Script:E2ETestDirectory = Join-Path $repositoryRoot.FullName -ChildPath "regress\pesterTests" $Script:WindowsInBox = $false +$Script:UseLibreSSL = $true $Script:EnableAppVerifier = $true $Script:PostmortemDebugging = $false @@ -37,7 +38,8 @@ function Set-OpenSSHTestEnvironment [string] $TestDataPath = "$env:SystemDrive\OpenSSHTests", [Boolean] $DebugMode = $false, [Switch] $NoAppVerifier, - [Switch] $PostmortemDebugging + [Switch] $PostmortemDebugging, + [Switch] $NoLibreSSL ) if($PSBoundParameters.ContainsKey("Verbose")) @@ -56,6 +58,7 @@ function Set-OpenSSHTestEnvironment $Script:TestSetupLogFile = Join-Path $TestDataPath "TestSetupLog.txt" $Script:UnitTestDirectory = Get-UnitTestDirectory $Script:EnableAppVerifier = -not ($NoAppVerifier.IsPresent) + $Script:UseLibreSSL = -not ($NoLibreSSL.IsPresent) if($Script:EnableAppVerifier) { $Script:PostmortemDebugging = $PostmortemDebugging.IsPresent @@ -77,6 +80,7 @@ function Set-OpenSSHTestEnvironment "DebugMode" = $DebugMode # run openssh E2E in debug mode "EnableAppVerifier" = $Script:EnableAppVerifier "PostmortemDebugging" = $Script:PostmortemDebugging + "UseLibreSSL" = $Script:UseLibreSSL } #if user does not set path, pick it up @@ -301,7 +305,8 @@ function Get-LocalUserProfile <# .SYNOPSIS This function installs the tools required by our tests - 1) Pester for running the tests + 1) Pester for running the tests + 2) Windbg for postmortem debugging #> function Install-OpenSSHTestDependencies { @@ -594,7 +599,7 @@ function Invoke-OpenSSHE2ETest # Discover all CI tests and run them. Import-Module pester -force -global Push-Location $Script:E2ETestDirectory - Write-Log -Message "Running OpenSSH E2E tests..." + 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 Pop-Location diff --git a/regress/pesterTests/KeyUtils.Tests.ps1 b/regress/pesterTests/KeyUtils.Tests.ps1 index a68c55e3b..bdc59302a 100644 --- a/regress/pesterTests/KeyUtils.Tests.ps1 +++ b/regress/pesterTests/KeyUtils.Tests.ps1 @@ -18,8 +18,8 @@ Describe "E2E scenarios for ssh key management" -Tags "CI" { } $keypassphrase = "testpassword" - $WindowsInBox = $OpenSSHTestInfo["WindowsInBox"] - if($WindowsInBox) + $UseLibreSSL = $OpenSSHTestInfo["UseLibreSSL"] + if($UseLibreSSL) { $keytypes = @("ed25519") } @@ -139,7 +139,7 @@ Describe "E2E scenarios for ssh key management" -Tags "CI" { { $keyPath = Join-Path $testDir "id_$type" remove-item $keyPath -ErrorAction SilentlyContinue - if($OpenSSHTestInfo["WindowsInBox"]) + if($OpenSSHTestInfo["UseLibreSSL"]) { ssh-keygen -t $type -P $keypassphrase -f $keyPath -Z aes128-ctr } @@ -252,7 +252,7 @@ Describe "E2E scenarios for ssh key management" -Tags "CI" { $keyFileName = "sshadd_userPermTestkey_ed25519" $keyFilePath = Join-Path $testDir $keyFileName Remove-Item -path "$keyFilePath*" -Force -ErrorAction SilentlyContinue - if($OpenSSHTestInfo["WindowsInBox"]) + if($OpenSSHTestInfo["UseLibreSSL"]) { ssh-keygen.exe -t ed25519 -f $keyFilePath -P $keypassphrase -Z aes128-ctr } @@ -377,23 +377,23 @@ Describe "E2E scenarios for ssh key management" -Tags "CI" { } AfterAll{$tC++} - It "$tC.$tI - ssh-keyscan with default arguments" -Skip:$WindowsInBox { + It "$tC.$tI - ssh-keyscan with default arguments" -Skip:$UseLibreSSL { cmd /c "ssh-keyscan -p $port 127.0.0.1 2>&1 > $outputFile" $outputFile | Should Contain '.*ssh-rsa.*' } - It "$tC.$tI - ssh-keyscan with -p" -Skip:$WindowsInBox { + It "$tC.$tI - ssh-keyscan with -p" -Skip:$UseLibreSSL { cmd /c "ssh-keyscan -p $port 127.0.0.1 2>&1 > $outputFile" $outputFile | Should Contain '.*ssh-rsa.*' } - It "$tC.$tI - ssh-keyscan with -f" -Skip:$WindowsInBox { + It "$tC.$tI - ssh-keyscan with -f" -Skip:$UseLibreSSL { Set-Content -Path tmp.txt -Value "127.0.0.1" cmd /c "ssh-keyscan -p $port -f tmp.txt 2>&1 > $outputFile" $outputFile | Should Contain '.*ssh-rsa.*' } - It "$tC.$tI - ssh-keyscan with -f -t" -Skip:$WindowsInBox { + It "$tC.$tI - ssh-keyscan with -f -t" -Skip:$UseLibreSSL { Set-Content -Path tmp.txt -Value "127.0.0.1" cmd /c "ssh-keyscan -p $port -f tmp.txt -t rsa,dsa 2>&1 > $outputFile" $outputFile | Should Contain '.*ssh-rsa.*' diff --git a/regress/pesterTests/Userkey_fileperm.Tests.ps1 b/regress/pesterTests/Userkey_fileperm.Tests.ps1 index 0ea561d2f..16aac1af3 100644 --- a/regress/pesterTests/Userkey_fileperm.Tests.ps1 +++ b/regress/pesterTests/Userkey_fileperm.Tests.ps1 @@ -50,7 +50,7 @@ Describe "Tests for user Key file permission" -Tags "CI" { $keyFileName = "sshtest_userPermTestkey_ed25519" $keyFilePath = Join-Path $testDir $keyFileName Remove-Item -path "$keyFilePath*" -Force -ErrorAction SilentlyContinue - if($OpenSSHTestInfo["WindowsInBox"]) + if($OpenSSHTestInfo["UseLibreSSL"]) { ssh-keygen.exe -t ed25519 -f $keyFilePath -P $keypassphrase -Z aes128-ctr }