diff --git a/docker/tests/container.tests.ps1 b/docker/tests/container.tests.ps1 index 7c37b9ca481..2f4fb5e6481 100644 --- a/docker/tests/container.tests.ps1 +++ b/docker/tests/container.tests.ps1 @@ -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 } diff --git a/docker/tests/containerTestCommon.psm1 b/docker/tests/containerTestCommon.psm1 index 333f252d912..68ae2f3491b 100644 --- a/docker/tests/containerTestCommon.psm1 +++ b/docker/tests/containerTestCommon.psm1 @@ -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