Enable libressl as default and to disable use the switch

This commit is contained in:
bagajjal 2017-11-07 13:57:08 -08:00
parent 4edff78b9d
commit 494faf24dd
3 changed files with 17 additions and 12 deletions

View File

@ -20,6 +20,7 @@ $Script:UnitTestResultsFile = Join-Path $TestDataPath $UnitTestResultsFileName
$Script:TestSetupLogFile = Join-Path $TestDataPath $TestSetupLogFileName $Script:TestSetupLogFile = Join-Path $TestDataPath $TestSetupLogFileName
$Script:E2ETestDirectory = Join-Path $repositoryRoot.FullName -ChildPath "regress\pesterTests" $Script:E2ETestDirectory = Join-Path $repositoryRoot.FullName -ChildPath "regress\pesterTests"
$Script:WindowsInBox = $false $Script:WindowsInBox = $false
$Script:UseLibreSSL = $true
$Script:EnableAppVerifier = $true $Script:EnableAppVerifier = $true
$Script:PostmortemDebugging = $false $Script:PostmortemDebugging = $false
@ -37,7 +38,8 @@ function Set-OpenSSHTestEnvironment
[string] $TestDataPath = "$env:SystemDrive\OpenSSHTests", [string] $TestDataPath = "$env:SystemDrive\OpenSSHTests",
[Boolean] $DebugMode = $false, [Boolean] $DebugMode = $false,
[Switch] $NoAppVerifier, [Switch] $NoAppVerifier,
[Switch] $PostmortemDebugging [Switch] $PostmortemDebugging,
[Switch] $NoLibreSSL
) )
if($PSBoundParameters.ContainsKey("Verbose")) if($PSBoundParameters.ContainsKey("Verbose"))
@ -56,6 +58,7 @@ function Set-OpenSSHTestEnvironment
$Script:TestSetupLogFile = Join-Path $TestDataPath "TestSetupLog.txt" $Script:TestSetupLogFile = Join-Path $TestDataPath "TestSetupLog.txt"
$Script:UnitTestDirectory = Get-UnitTestDirectory $Script:UnitTestDirectory = Get-UnitTestDirectory
$Script:EnableAppVerifier = -not ($NoAppVerifier.IsPresent) $Script:EnableAppVerifier = -not ($NoAppVerifier.IsPresent)
$Script:UseLibreSSL = -not ($NoLibreSSL.IsPresent)
if($Script:EnableAppVerifier) if($Script:EnableAppVerifier)
{ {
$Script:PostmortemDebugging = $PostmortemDebugging.IsPresent $Script:PostmortemDebugging = $PostmortemDebugging.IsPresent
@ -77,6 +80,7 @@ function Set-OpenSSHTestEnvironment
"DebugMode" = $DebugMode # run openssh E2E in debug mode "DebugMode" = $DebugMode # run openssh E2E in debug mode
"EnableAppVerifier" = $Script:EnableAppVerifier "EnableAppVerifier" = $Script:EnableAppVerifier
"PostmortemDebugging" = $Script:PostmortemDebugging "PostmortemDebugging" = $Script:PostmortemDebugging
"UseLibreSSL" = $Script:UseLibreSSL
} }
#if user does not set path, pick it up #if user does not set path, pick it up
@ -301,7 +305,8 @@ function Get-LocalUserProfile
<# <#
.SYNOPSIS .SYNOPSIS
This function installs the tools required by our tests 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 function Install-OpenSSHTestDependencies
{ {
@ -594,7 +599,7 @@ function Invoke-OpenSSHE2ETest
# Discover all CI tests and run them. # Discover all CI tests and run them.
Import-Module pester -force -global Import-Module pester -force -global
Push-Location $Script:E2ETestDirectory 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) $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
Pop-Location Pop-Location

View File

@ -18,8 +18,8 @@ Describe "E2E scenarios for ssh key management" -Tags "CI" {
} }
$keypassphrase = "testpassword" $keypassphrase = "testpassword"
$WindowsInBox = $OpenSSHTestInfo["WindowsInBox"] $UseLibreSSL = $OpenSSHTestInfo["UseLibreSSL"]
if($WindowsInBox) if($UseLibreSSL)
{ {
$keytypes = @("ed25519") $keytypes = @("ed25519")
} }
@ -139,7 +139,7 @@ Describe "E2E scenarios for ssh key management" -Tags "CI" {
{ {
$keyPath = Join-Path $testDir "id_$type" $keyPath = Join-Path $testDir "id_$type"
remove-item $keyPath -ErrorAction SilentlyContinue remove-item $keyPath -ErrorAction SilentlyContinue
if($OpenSSHTestInfo["WindowsInBox"]) if($OpenSSHTestInfo["UseLibreSSL"])
{ {
ssh-keygen -t $type -P $keypassphrase -f $keyPath -Z aes128-ctr 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" $keyFileName = "sshadd_userPermTestkey_ed25519"
$keyFilePath = Join-Path $testDir $keyFileName $keyFilePath = Join-Path $testDir $keyFileName
Remove-Item -path "$keyFilePath*" -Force -ErrorAction SilentlyContinue 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 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++} 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" cmd /c "ssh-keyscan -p $port 127.0.0.1 2>&1 > $outputFile"
$outputFile | Should Contain '.*ssh-rsa.*' $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" cmd /c "ssh-keyscan -p $port 127.0.0.1 2>&1 > $outputFile"
$outputFile | Should Contain '.*ssh-rsa.*' $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" Set-Content -Path tmp.txt -Value "127.0.0.1"
cmd /c "ssh-keyscan -p $port -f tmp.txt 2>&1 > $outputFile" cmd /c "ssh-keyscan -p $port -f tmp.txt 2>&1 > $outputFile"
$outputFile | Should Contain '.*ssh-rsa.*' $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" 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" cmd /c "ssh-keyscan -p $port -f tmp.txt -t rsa,dsa 2>&1 > $outputFile"
$outputFile | Should Contain '.*ssh-rsa.*' $outputFile | Should Contain '.*ssh-rsa.*'

View File

@ -50,7 +50,7 @@ Describe "Tests for user Key file permission" -Tags "CI" {
$keyFileName = "sshtest_userPermTestkey_ed25519" $keyFileName = "sshtest_userPermTestkey_ed25519"
$keyFilePath = Join-Path $testDir $keyFileName $keyFilePath = Join-Path $testDir $keyFileName
Remove-Item -path "$keyFilePath*" -Force -ErrorAction SilentlyContinue 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 ssh-keygen.exe -t ed25519 -f $keyFilePath -P $keypassphrase -Z aes128-ctr
} }