tests: fix function to test for docker OS due to change to use linuxkit for mac (#5843)
* Also, fix syntax issues to allow to work with released Pester
This commit is contained in:
parent
bb6823d707
commit
05ed03154d
|
@ -57,8 +57,7 @@ Describe "Linux Containers run PowerShell" -Tags 'Behavior', 'Linux' {
|
|||
# prune unused volumes
|
||||
$null=Invoke-Docker -Command 'volume', 'prune' -Params '--force' -SuppressHostOutput
|
||||
}
|
||||
BeforeEach
|
||||
{
|
||||
BeforeEach {
|
||||
Remove-Item $testContext.resolvedXmlPath -ErrorAction SilentlyContinue
|
||||
Remove-Item $testContext.resolvedLogPath -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
@ -82,8 +81,7 @@ Describe "Windows Containers run PowerShell" -Tags 'Behavior', 'Windows' {
|
|||
BeforeAll{
|
||||
$testContext = Get-TestContext -type Windows
|
||||
}
|
||||
BeforeEach
|
||||
{
|
||||
BeforeEach {
|
||||
Remove-Item $testContext.resolvedXmlPath -ErrorAction SilentlyContinue
|
||||
Remove-Item $testContext.resolvedLogPath -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
|
|
@ -110,7 +110,27 @@ function Test-SkipWindows
|
|||
|
||||
function Test-SkipLinux
|
||||
{
|
||||
return !((Get-DockerEngineOs) -like 'Alpine Linux*')
|
||||
$os = Get-DockerEngineOs
|
||||
|
||||
switch -wildcard ($os)
|
||||
{
|
||||
'*Linux*' {
|
||||
return $false
|
||||
}
|
||||
'*Mac' {
|
||||
return $false
|
||||
}
|
||||
# Docker for Windows means we are running the linux kernel
|
||||
'Docker for Windows' {
|
||||
return $false
|
||||
}
|
||||
'Windows*' {
|
||||
return $true
|
||||
}
|
||||
default {
|
||||
throw "Unknow docker os '$os'"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function Get-TestContext
|
||||
|
|
Loading…
Reference in a new issue