Skip to content

Commit

Permalink
Fix tests on downlevel systems failing at end of test (microsoft#2177)
Browse files Browse the repository at this point in the history
* Try to debug tests failing at end

* Disable logging

* More printing

* Smore

* Another test

* Final fix

* Only 0 out last exit code once
  • Loading branch information
thhous-msft authored Nov 23, 2021
1 parent 4fe2827 commit e71ee75
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/install-test-certificates.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ param (
[Parameter(Mandatory = $true)]
[string]$OutputFile = ""
)

Set-StrictMode -Version 'Latest'
$PSDefaultParameterValues['*:ErrorAction'] = 'Stop'

[System.DateTimeOffset]$NotBefore = [System.DateTimeOffset]::Now.AddDays(-1)
[System.DateTimeOffset]$NotAfter = [System.DateTimeOffset]::Now.AddDays(365)

Expand Down Expand Up @@ -174,7 +178,7 @@ $Leaf = CreateLeafCert $IntermediateSigner

$Collection = [System.Security.Cryptography.X509Certificates.X509Certificate2Collection]::new()

$Collection.Add($Leaf[1]) # TODO(AnRossi):Why is $Leaf an array of an Int and the Cert?
$Collection.Add($Leaf[1]) | Out-Null # TODO(AnRossi):Why is $Leaf an array of an Int and the Cert?
#Export the intermediate and root certs and then import them to drop their private keys.
$Collection.Import($IntermediateSigner.rawData)
$Collection.Import($Root.rawData)
Expand Down
1 change: 1 addition & 0 deletions scripts/log.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ function Log-Cancel {
wpr.exe -cancel -instancename $InstanceName 2>&1
} catch {
}
$global:LASTEXITCODE = 0
} elseif ($IsMacOS) {
} else {
if (!(Test-Path $TempDir)) {
Expand Down

0 comments on commit e71ee75

Please sign in to comment.