-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge #72: Add Firefox ESR+Nightly Windows tests
e4a02e2 Exports tests: set ErrorActionPreference (Jeremy Rand) 1cef0f6 Fix assert-proxy-log Linux tests (Jeremy Rand) 2c61d98 pkcs11mod: Improve logfile path detection (Jeremy Rand) c8f713c Add Firefox ESR+Nightly Windows tests (Jeremy Rand) Pull request description: Refs #24 Top commit has no ACKs. Tree-SHA512: 2e49f94c2a192780cf25b04c3d8e205a103effffddadabfdf17fffb2d706bbe9a64183d73034f93d8bf97508d97230caef13b8d086b1745a4e832593214a6ef7
- Loading branch information
Showing
7 changed files
with
207 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
param ( | ||
$desired | ||
) | ||
|
||
$ErrorActionPreference = "Stop" | ||
|
||
if ( ("$desired" -ne "present" ) -and ( "$desired" -ne "missing" ) ) { | ||
Write-Host "Invalid DESIRED value; should be present or missing" | ||
exit 1 | ||
} | ||
|
||
if ( ( Test-Path -Path "$Env:APPDATA/pkcs11mod.log" ) -Or ( Test-Path -Path "./pkcs11mod.log" ) ) { | ||
$result="present" | ||
} | ||
else { | ||
$result="missing" | ||
} | ||
|
||
Remove-Item -Force -ErrorAction SilentlyContinue "$Env:APPDATA/pkcs11mod.log" | ||
Remove-Item -Force -ErrorAction SilentlyContinue "./pkcs11mod.log" | ||
|
||
if ( "$result" -ne "$desired" ) { | ||
Write-Host "Log test failed" | ||
Write-Host "Got $result, wanted $desired" | ||
exit 1 | ||
} | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
$ErrorActionPreference = "Stop" | ||
|
||
Write-Host "===== Default System CKBI =====" | ||
|
||
& "powershell" "-ExecutionPolicy" "Unrestricted" "-File" "testdata/try-firefox-connect.ps1" -server_host "www.namecoin.org" -desired "success" | ||
If (!$?) { | ||
exit 222 | ||
} | ||
& "powershell" "-ExecutionPolicy" "Unrestricted" "-File" "testdata/assert-proxy-log.ps1" -desired "missing" | ||
If (!$?) { | ||
exit 222 | ||
} | ||
|
||
& "powershell" "-ExecutionPolicy" "Unrestricted" "-File" "testdata/try-firefox-connect.ps1" -server_host "untrusted-root.badssl.com" -desired "fail" | ||
If (!$?) { | ||
exit 222 | ||
} | ||
& "powershell" "-ExecutionPolicy" "Unrestricted" "-File" "testdata/assert-proxy-log.ps1" -desired "missing" | ||
If (!$?) { | ||
exit 222 | ||
} | ||
|
||
Write-Host "===== Deleted System CKBI =====" | ||
|
||
Move-Item -Path "$Env:CI_MAIN_MODULE" -Destination "$Env:CI_BAK_MODULE" | ||
|
||
& "powershell" "-ExecutionPolicy" "Unrestricted" "-File" "testdata/try-firefox-connect.ps1" -server_host "www.namecoin.org" -desired "fail" | ||
If (!$?) { | ||
exit 222 | ||
} | ||
& "powershell" "-ExecutionPolicy" "Unrestricted" "-File" "testdata/assert-proxy-log.ps1" -desired "missing" | ||
If (!$?) { | ||
exit 222 | ||
} | ||
|
||
& "powershell" "-ExecutionPolicy" "Unrestricted" "-File" "testdata/try-firefox-connect.ps1" -server_host "untrusted-root.badssl.com" -desired "fail" | ||
If (!$?) { | ||
exit 222 | ||
} | ||
& "powershell" "-ExecutionPolicy" "Unrestricted" "-File" "testdata/assert-proxy-log.ps1" -desired "missing" | ||
If (!$?) { | ||
exit 222 | ||
} | ||
|
||
# TODO: No env var, -desired "missing" default target | ||
|
||
# TODO: Env var pointing to -desired "missing" target | ||
|
||
Write-Host "===== System CKBI via pkcs11proxy =====" | ||
|
||
$Env:PKCS11PROXY_CKBI_TARGET = "$Env:CI_BAK_MODULE" | ||
Copy-Item pkcs11proxy.dll -Destination "$Env:CI_MAIN_MODULE" | ||
|
||
& "powershell" "-ExecutionPolicy" "Unrestricted" "-File" "testdata/try-firefox-connect.ps1" -server_host "www.namecoin.org" -desired "success" | ||
If (!$?) { | ||
exit 222 | ||
} | ||
& "powershell" "-ExecutionPolicy" "Unrestricted" "-File" "testdata/assert-proxy-log.ps1" -desired "present" | ||
If (!$?) { | ||
exit 222 | ||
} | ||
|
||
& "powershell" "-ExecutionPolicy" "Unrestricted" "-File" "testdata/try-firefox-connect.ps1" -server_host "untrusted-root.badssl.com" -desired "fail" | ||
If (!$?) { | ||
exit 222 | ||
} | ||
& "powershell" "-ExecutionPolicy" "Unrestricted" "-File" "testdata/assert-proxy-log.ps1" -desired "present" | ||
If (!$?) { | ||
exit 222 | ||
} | ||
|
||
Write-Host "===== System CKBI via p11proxy =====" | ||
|
||
$Env:P11PROXY_CKBI_TARGET = "$Env:CI_BAK_MODULE" | ||
Copy-Item p11proxy.dll -Destination "$Env:CI_MAIN_MODULE" | ||
|
||
& "powershell" "-ExecutionPolicy" "Unrestricted" "-File" "testdata/try-firefox-connect.ps1" -server_host "www.namecoin.org" -desired "success" | ||
If (!$?) { | ||
exit 222 | ||
} | ||
& "powershell" "-ExecutionPolicy" "Unrestricted" "-File" "testdata/assert-proxy-log.ps1" -desired "present" | ||
If (!$?) { | ||
exit 222 | ||
} | ||
|
||
& "powershell" "-ExecutionPolicy" "Unrestricted" "-File" "testdata/try-firefox-connect.ps1" -server_host "untrusted-root.badssl.com" -desired "fail" | ||
If (!$?) { | ||
exit 222 | ||
} | ||
& "powershell" "-ExecutionPolicy" "Unrestricted" "-File" "testdata/assert-proxy-log.ps1" -desired "present" | ||
If (!$?) { | ||
exit 222 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
param ( | ||
$server_host, | ||
$desired | ||
) | ||
|
||
$ErrorActionPreference = "Stop" | ||
|
||
Write-Host "$server_host" | ||
|
||
if ( ("$desired" -ne "success" ) -and ( "$desired" -ne "fail" ) ) { | ||
Write-Host "Invalid DESIRED value; should be success or fail" | ||
exit 1 | ||
} | ||
|
||
# Nuke whatever cached state might exist... | ||
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$Env:APPDATA/Mozilla" | ||
|
||
& "$Env:CI_MAIN_EXE" --screenshot "https://$server_host" | ||
Start-Sleep -seconds 10 | ||
Stop-Process -Name "firefox" -ErrorAction SilentlyContinue | ||
Start-Sleep -seconds 5 | ||
|
||
if ( Test-Path -Path "screenshot.png" ) { | ||
$result = "success" | ||
} | ||
else { | ||
$result = "fail" | ||
} | ||
|
||
Remove-Item -Force -ErrorAction SilentlyContinue "screenshot.png" | ||
|
||
if ( "$result" -ne "$desired" ) { | ||
Write-Host "TLS test failed" | ||
Write-Host "Got $result, wanted $desired" | ||
exit 1 | ||
} | ||
|
||
exit 0 |