mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Fixes for release tests (#20028)
This commit is contained in:
@@ -59,11 +59,11 @@ Describe "Basic Auth over HTTP not allowed on Unix" -Tag @("CI") {
|
||||
|
||||
Describe "JEA session Transcript script test" -Tag @("Feature", 'RequireAdminOnWindows') {
|
||||
BeforeAll {
|
||||
$originalDefaultParameterValues = $PSDefaultParameterValues.Clone()
|
||||
$originalDefaultParameterValues = $global:PSDefaultParameterValues.Clone()
|
||||
|
||||
if ( ! $IsWindows -or !(Test-CanWriteToPsHome))
|
||||
{
|
||||
$PSDefaultParameterValues["it:skip"] = $true
|
||||
$global:PSDefaultParameterValues["it:skip"] = $true
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -101,11 +101,11 @@ Describe "JEA session Transcript script test" -Tag @("Feature", 'RequireAdminOnW
|
||||
|
||||
Describe "JEA session Get-Help test" -Tag @("CI", 'RequireAdminOnWindows') {
|
||||
BeforeAll {
|
||||
$originalDefaultParameterValues = $PSDefaultParameterValues.Clone()
|
||||
$originalDefaultParameterValues = $global:PSDefaultParameterValues.Clone()
|
||||
|
||||
if ( ! $IsWindows -or !(Test-CanWriteToPsHome))
|
||||
{
|
||||
$PSDefaultParameterValues["it:skip"] = $true
|
||||
$global:PSDefaultParameterValues["it:skip"] = $true
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -141,16 +141,22 @@ Describe "JEA session Get-Help test" -Tag @("CI", 'RequireAdminOnWindows') {
|
||||
Describe "Remoting loopback tests" -Tags @('CI', 'RequireAdminOnWindows') {
|
||||
BeforeAll {
|
||||
|
||||
$originalDefaultParameterValues = $PSDefaultParameterValues.Clone()
|
||||
$originalDefaultParameterValues = $global:PSDefaultParameterValues.Clone()
|
||||
|
||||
if ( ! $IsWindows )
|
||||
{
|
||||
$PSDefaultParameterValues["it:skip"] = $true
|
||||
$global:PSDefaultParameterValues["it:skip"] = $true
|
||||
}
|
||||
else
|
||||
{
|
||||
Enable-PSRemoting -SkipNetworkProfileCheck
|
||||
$endPoint = (Get-PSSessionConfiguration -Name "PowerShell.$(${PSVersionTable}.GitCommitId)").Name
|
||||
$configName = "PowerShell." + $PSVersionTable.GitCommitId
|
||||
$configuration = Get-PSSessionConfiguration -Name $configName -ErrorAction Ignore
|
||||
if ($null -eq $configuration) {
|
||||
$global:PSDefaultParameterValues["it:skip"] = $true
|
||||
return
|
||||
}
|
||||
$endPoint = $configuration.Name
|
||||
$disconnectedSession = New-RemoteSession -ConfigurationName $endPoint -ComputerName localhost | Disconnect-PSSession
|
||||
$closedSession = New-RemoteSession -ConfigurationName $endPoint -ComputerName localhost
|
||||
$closedSession.Runspace.Close()
|
||||
|
||||
@@ -89,14 +89,22 @@ Describe "Windows file content signatures" -Tags @('Feature', 'RequireAdminOnWin
|
||||
}
|
||||
|
||||
AfterAll {
|
||||
|
||||
if ($shouldSkip) {
|
||||
return
|
||||
}
|
||||
|
||||
Remove-Item -Path Cert:\LocalMachine\Root\$caRootThumbprint -Force
|
||||
Remove-Item -Path Cert:\LocalMachine\TrustedPublisher\$signingThumbprint -Force
|
||||
Remove-Item -Path Cert:\CurrentUser\My\$signingThumbprint -Force
|
||||
$paths = @(
|
||||
"Cert:\LocalMachine\Root\$caRootThumbprint"
|
||||
"Cert:\LocalMachine\TrustedPublisher\$signingThumbprint"
|
||||
"Cert:\CurrentUser\My\$signingThumbprint"
|
||||
)
|
||||
|
||||
foreach($path in $paths) {
|
||||
if (Test-Path $path) {
|
||||
# failing to remove is not fatal
|
||||
Remove-Item -Force -Path $path -ErrorAction Continue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
It "Validates signature using path on even char count with Encoding <Encoding>" -TestCases @(
|
||||
|
||||
Reference in New Issue
Block a user