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 <vostrosablin@virtuozzo.com> Upstream-commit: d4e132f84da72b5c2f2f63c95a8ca5cddabf8433 Component: engine
This commit is contained in:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user