mirror of
https://github.com/actions/runner-images.git
synced 2025-12-17 23:28:57 +00:00
Add DotnetTLS Pester test
This commit is contained in:
@@ -694,12 +694,6 @@
|
|||||||
"{{ template_dir }}/scripts/Installers/Validate-AzureModules.ps1"
|
"{{ template_dir }}/scripts/Installers/Validate-AzureModules.ps1"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"type": "powershell",
|
|
||||||
"scripts":[
|
|
||||||
"{{ template_dir }}/scripts/Installers/Validate-DotnetTLS.ps1"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "powershell",
|
"type": "powershell",
|
||||||
"scripts":[
|
"scripts":[
|
||||||
|
|||||||
@@ -693,12 +693,6 @@
|
|||||||
"{{ template_dir }}/scripts/Installers/Validate-AzureModules.ps1"
|
"{{ template_dir }}/scripts/Installers/Validate-AzureModules.ps1"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"type": "powershell",
|
|
||||||
"scripts":[
|
|
||||||
"{{ template_dir }}/scripts/Installers/Validate-DotnetTLS.ps1"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "powershell",
|
"type": "powershell",
|
||||||
"scripts":[
|
"scripts":[
|
||||||
|
|||||||
@@ -15,4 +15,5 @@ if(Test-Path $registryPath){
|
|||||||
Set-ItemProperty -Path $registryPath -Name $name -Value $value -Type DWORD
|
Set-ItemProperty -Path $registryPath -Name $name -Value $value -Type DWORD
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Invoke-PesterTests -TestFile "Tools" -TestName "DotnetTLS"
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
################################################################################
|
|
||||||
## File: Validate-DotnetTLS.ps1
|
|
||||||
## Desc: Validate DotNetFramework security protocol to TLS 1.2
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
$protocols = [Net.ServicePointManager]::SecurityProtocol
|
|
||||||
$protocolArr = $protocols -split ', '
|
|
||||||
if ($protocolArr.Contains('Tls12'))
|
|
||||||
{
|
|
||||||
Write-Host 'Tls 1.2 has been enabled.'
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Write-Host 'Tls 1.2 has not been enabled.'
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@@ -15,3 +15,11 @@ Describe "Kind" {
|
|||||||
"kind version" | Should -ReturnZeroExitCode
|
"kind version" | Should -ReturnZeroExitCode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Describe "DotnetTLS" {
|
||||||
|
It "Tls 1.2 is enabled" {
|
||||||
|
$protocols = [Net.ServicePointManager]::SecurityProtocol
|
||||||
|
$protocolArr = $protocols -split ', '
|
||||||
|
$protocolArr.Contains('Tls12') | Should -BeTrue
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user