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: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
@ -302,6 +306,7 @@ function Get-LocalUserProfile
.SYNOPSIS
This function installs the tools required by our tests
1) Pester for running the tests
2) Windbg for postmortem debugging
#>
function Install-OpenSSHTestDependencies
{

View File

@ -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.*'

View File

@ -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
}