From 291e5291fe5020cc4634e42811eafff1daebfd3d Mon Sep 17 00:00:00 2001 From: Vitaly Ostrosablin Date: Thu, 23 Mar 2017 14:31:28 +0300 Subject: [PATCH] Change TestExecUlimits to use nofile instead of nproc Test used to check whether ulimits applied by docker are in effect by setting up nproc. However, in some environments (e.g. inside Virtuozzo Containers), number of processes is higher and testcase fails. Hence, we instead change testcase to check ulimits by setting nofile limit instead of nproc. Signed-off-by: Vitaly Ostrosablin Upstream-commit: d4e132f84da72b5c2f2f63c95a8ca5cddabf8433 Component: engine --- components/engine/integration-cli/docker_cli_exec_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/engine/integration-cli/docker_cli_exec_test.go b/components/engine/integration-cli/docker_cli_exec_test.go index 3ba5b9b986..d87817cfa4 100644 --- a/components/engine/integration-cli/docker_cli_exec_test.go +++ b/components/engine/integration-cli/docker_cli_exec_test.go @@ -490,12 +490,12 @@ func (s *DockerSuite) TestExecOnReadonlyContainer(c *check.C) { func (s *DockerSuite) TestExecUlimits(c *check.C) { testRequires(c, DaemonIsLinux) name := "testexeculimits" - runSleepingContainer(c, "-d", "--ulimit", "nproc=21", "--name", name) + runSleepingContainer(c, "-d", "--ulimit", "nofile=511:511", "--name", name) c.Assert(waitRun(name), checker.IsNil) - out, _, err := dockerCmdWithError("exec", name, "sh", "-c", "ulimit -p") + out, _, err := dockerCmdWithError("exec", name, "sh", "-c", "ulimit -n") c.Assert(err, checker.IsNil) - c.Assert(strings.TrimSpace(out), checker.Equals, "21") + c.Assert(strings.TrimSpace(out), checker.Equals, "511") } // #15750