|
@@ -2826,13 +2826,11 @@ func (s *DockerSuite) TestRunPIDHostWithChildIsKillable(c *testing.T) {
|
|
|
}
|
|
|
|
|
|
func (s *DockerSuite) TestRunWithTooSmallMemoryLimit(c *testing.T) {
|
|
|
- // TODO Windows. This may be possible to enable once Windows supports
|
|
|
- // memory limits on containers
|
|
|
+ // TODO Windows. This may be possible to enable once Windows supports memory limits on containers
|
|
|
testRequires(c, DaemonIsLinux)
|
|
|
- // this memory limit is 1 byte less than the min, which is 4MB
|
|
|
- // https://github.com/docker/docker/blob/v1.5.0/daemon/create.go#L22
|
|
|
- out, _, err := dockerCmdWithError("run", "-m", "4194303", "busybox")
|
|
|
- if err == nil || !strings.Contains(out, "Minimum memory limit allowed is 4MB") {
|
|
|
+ // this memory limit is 1 byte less than the min (daemon.linuxMinMemory), which is 6MB (6291456 bytes)
|
|
|
+ out, _, err := dockerCmdWithError("create", "-m", "6291455", "busybox")
|
|
|
+ if err == nil || !strings.Contains(out, "Minimum memory limit allowed is 6MB") {
|
|
|
c.Fatalf("expected run to fail when using too low a memory limit: %q", out)
|
|
|
}
|
|
|
}
|