integration-cli/docker_cli_oom_killed_test.go
0b513144
 // +build !windows
 
 package main
 
 import (
 	"github.com/docker/docker/pkg/integration/checker"
 	"github.com/go-check/check"
 )
 
 func (s *DockerSuite) TestInspectOomKilledTrue(c *check.C) {
 	testRequires(c, DaemonIsLinux, memoryLimitSupport)
 
 	name := "testoomkilled"
ba19b692
 	_, exitCode, _ := dockerCmdWithError("run", "--name", name, "--memory", "32MB", "busybox", "sh", "-c", "x=a; while true; do x=$x$x$x$x; done")
0b513144
 
 	c.Assert(exitCode, checker.Equals, 137, check.Commentf("OOM exit should be 137"))
 
62a856e9
 	oomKilled := inspectField(c, name, "State.OOMKilled")
0b513144
 	c.Assert(oomKilled, checker.Equals, "true")
 }
 
 func (s *DockerSuite) TestInspectOomKilledFalse(c *check.C) {
 	testRequires(c, DaemonIsLinux, memoryLimitSupport)
 
 	name := "testoomkilled"
ba19b692
 	dockerCmd(c, "run", "--name", name, "--memory", "32MB", "busybox", "sh", "-c", "echo hello world")
0b513144
 
62a856e9
 	oomKilled := inspectField(c, name, "State.OOMKilled")
0b513144
 	c.Assert(oomKilled, checker.Equals, "false")
 }