6 "github.com/docker/docker/integration-cli/checker"
7 "github.com/go-check/check"
10 func (s *DockerSuite) TestInspectOomKilledTrue(c *check.C) {
11 testRequires(c, DaemonIsLinux, memoryLimitSupport, swapMemorySupport)
13 name := "testoomkilled"
14 _, exitCode, _ := dockerCmdWithError("run", "--name", name, "--memory", "32MB", "busybox", "sh", "-c", "x=a; while true; do x=$x$x$x$x; done")
16 c.Assert(exitCode, checker.Equals, 137, check.Commentf("OOM exit should be 137"))
18 oomKilled := inspectField(c, name, "State.OOMKilled")
19 c.Assert(oomKilled, checker.Equals, "true")
22 func (s *DockerSuite) TestInspectOomKilledFalse(c *check.C) {
23 testRequires(c, DaemonIsLinux, memoryLimitSupport, swapMemorySupport)
25 name := "testoomkilled"
26 dockerCmd(c, "run", "--name", name, "--memory", "32MB", "busybox", "sh", "-c", "echo hello world")
28 oomKilled := inspectField(c, name, "State.OOMKilled")
29 c.Assert(oomKilled, checker.Equals, "false")