1
0
mirror of https://github.com/moby/moby.git synced 2025-12-06 07:41:18 +03:00

Add support for kernel memory limit

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
This commit is contained in:
Qiang Huang
2015-08-19 23:56:55 +08:00
parent 87959dbfac
commit b6f1b4ad35
17 changed files with 160 additions and 4 deletions

View File

@@ -283,6 +283,18 @@ func (s *DockerSuite) TestRunWithCpuPeriod(c *check.C) {
}
}
func (s *DockerSuite) TestRunWithKernelMemory(c *check.C) {
testRequires(c, kernelMemorySupport)
dockerCmd(c, "run", "--kernel-memory", "50M", "--name", "test", "busybox", "true")
out, err := inspectField("test", "HostConfig.KernelMemory")
c.Assert(err, check.IsNil)
if out != "52428800" {
c.Fatalf("setting the kernel memory limit failed")
}
}
func (s *DockerSuite) TestRunOOMExitCode(c *check.C) {
testRequires(c, oomControl)
errChan := make(chan error)