From b469933b063169718987865b8b1215cb7befd1a6 Mon Sep 17 00:00:00 2001 From: Pavel Tikhomirov Date: Wed, 7 Aug 2019 11:29:39 +0300 Subject: [PATCH] integration-cli/requirements: Skip windows specific isolation requirements on non-windows After the commit faaffd5d6d7f ("Windows:Disable 2 restart test when Hyper-V") some tests became skipped on linux: SKIP: docker_cli_restart_test.go:167: DockerSuite.TestRestartContainerSuccess (unmatched requirement IsolationIsProcess) SKIP: docker_cli_restart_test.go:240: DockerSuite.TestRestartPolicyAfterRestart (unmatched requirement IsolationIsProcess) But AFAIU it is highly unlikely that we actually meant to skip them on linux. https://github.com/moby/moby/issues/39625 Signed-off-by: Pavel Tikhomirov --- integration-cli/docker_cli_restart_test.go | 10 ++++++++-- integration-cli/docker_cli_run_test.go | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/integration-cli/docker_cli_restart_test.go b/integration-cli/docker_cli_restart_test.go index 3fc2da81db..9e1d99d3eb 100644 --- a/integration-cli/docker_cli_restart_test.go +++ b/integration-cli/docker_cli_restart_test.go @@ -166,10 +166,13 @@ func (s *DockerSuite) TestRestartContainerwithGoodContainer(c *testing.T) { } func (s *DockerSuite) TestRestartContainerSuccess(c *testing.T) { + testRequires(c, testEnv.IsLocalDaemon) // Skipped for Hyper-V isolated containers. Test is currently written // such that it assumes there is a host process to kill. In Hyper-V // containers, the process is inside the utility VM, not on the host. - testRequires(c, testEnv.IsLocalDaemon, IsolationIsProcess) + if DaemonIsWindows() { + testRequires(c, IsolationIsProcess) + } out := runSleepingContainer(c, "-d", "--restart=always") id := strings.TrimSpace(out) @@ -239,10 +242,13 @@ func (s *DockerSuite) TestRestartWithPolicyUserDefinedNetwork(c *testing.T) { } func (s *DockerSuite) TestRestartPolicyAfterRestart(c *testing.T) { + testRequires(c, testEnv.IsLocalDaemon) // Skipped for Hyper-V isolated containers. Test is currently written // such that it assumes there is a host process to kill. In Hyper-V // containers, the process is inside the utility VM, not on the host. - testRequires(c, testEnv.IsLocalDaemon, IsolationIsProcess) + if DaemonIsWindows() { + testRequires(c, IsolationIsProcess) + } out := runSleepingContainer(c, "-d", "--restart=always") id := strings.TrimSpace(out) diff --git a/integration-cli/docker_cli_run_test.go b/integration-cli/docker_cli_run_test.go index 13ad30b391..3a431aaddd 100644 --- a/integration-cli/docker_cli_run_test.go +++ b/integration-cli/docker_cli_run_test.go @@ -4227,7 +4227,7 @@ func (s *DockerSuite) TestRunWindowsWithCPUPercent(c *testing.T) { } func (s *DockerSuite) TestRunProcessIsolationWithCPUCountCPUSharesAndCPUPercent(c *testing.T) { - testRequires(c, DaemonIsWindows, IsolationIsProcess) + testRequires(c, IsolationIsProcess) out, _ := dockerCmd(c, "run", "--cpu-count=1", "--cpu-shares=1000", "--cpu-percent=80", "--name", "test", "busybox", "echo", "testing") assert.Assert(c, strings.Contains(strings.TrimSpace(out), "WARNING: Conflicting options: CPU count takes priority over CPU shares on Windows Server Containers. CPU shares discarded")) @@ -4244,7 +4244,7 @@ func (s *DockerSuite) TestRunProcessIsolationWithCPUCountCPUSharesAndCPUPercent( } func (s *DockerSuite) TestRunHypervIsolationWithCPUCountCPUSharesAndCPUPercent(c *testing.T) { - testRequires(c, DaemonIsWindows, IsolationIsHyperv) + testRequires(c, IsolationIsHyperv) out, _ := dockerCmd(c, "run", "--cpu-count=1", "--cpu-shares=1000", "--cpu-percent=80", "--name", "test", "busybox", "echo", "testing") assert.Assert(c, strings.Contains(strings.TrimSpace(out), "testing"))