From f242555aaa85663aed80ad140d02dab36f18932a Mon Sep 17 00:00:00 2001 From: Antonio Murdaca Date: Fri, 18 Sep 2015 23:56:16 +0200 Subject: [PATCH] integration-cli: fix tests with memory limit If you don't have cgroup swap memory support, `dockerCmd`'s output in these tests will be polluted by a warning from the daemon and will fail the tests. No need to have memory swap support for these tests to run as it will be reset to -1 and everything will continue correctly. Signed-off-by: Antonio Murdaca Upstream-commit: 0b8b8ed9e98a7355661f1aad93bfa0dd76362723 Component: engine --- components/engine/integration-cli/docker_cli_run_unix_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/engine/integration-cli/docker_cli_run_unix_test.go b/components/engine/integration-cli/docker_cli_run_unix_test.go index a8fdac0d2d..5ffb496daf 100644 --- a/components/engine/integration-cli/docker_cli_run_unix_test.go +++ b/components/engine/integration-cli/docker_cli_run_unix_test.go @@ -227,7 +227,7 @@ func (s *DockerSuite) TestRunEchoStdoutWitCPUShares(c *check.C) { func (s *DockerSuite) TestRunEchoStdoutWithCPUSharesAndMemoryLimit(c *check.C) { testRequires(c, cpuShare) testRequires(c, memoryLimitSupport) - out, _ := dockerCmd(c, "run", "--cpu-shares", "1000", "-m", "16m", "busybox", "echo", "test") + out, _, _ := dockerCmdWithStdoutStderr(c, "run", "--cpu-shares", "1000", "-m", "16m", "busybox", "echo", "test") if out != "test\n" { c.Errorf("container should've printed 'test', got %q instead", out) } @@ -291,7 +291,7 @@ func (s *DockerSuite) TestRunOOMExitCode(c *check.C) { // "test" should be printed func (s *DockerSuite) TestRunEchoStdoutWithMemoryLimit(c *check.C) { testRequires(c, memoryLimitSupport) - out, _ := dockerCmd(c, "run", "-m", "16m", "busybox", "echo", "test") + out, _, _ := dockerCmdWithStdoutStderr(c, "run", "-m", "16m", "busybox", "echo", "test") out = strings.Trim(out, "\r\n") if expected := "test"; out != expected {