mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Add the TestRunSwapLessThanMemoryLimit case.
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
This commit is contained in:
parent
743dc1c791
commit
ab39a4c981
1 changed files with 12 additions and 0 deletions
|
@ -338,3 +338,15 @@ func (s *DockerSuite) TestStopContainerSignal(c *check.C) {
|
|||
c.Fatalf("Expected `exit trapped` in the log, got %v", out)
|
||||
}
|
||||
}
|
||||
|
||||
func (s *DockerSuite) TestRunSwapLessThanMemoryLimit(c *check.C) {
|
||||
testRequires(c, memoryLimitSupport)
|
||||
testRequires(c, swapMemorySupport)
|
||||
out, _, err := dockerCmdWithError("run", "-m", "16m", "--memory-swap", "15m", "busybox", "echo", "test")
|
||||
expected := "Minimum memoryswap limit should be larger than memory limit"
|
||||
c.Assert(err, check.NotNil)
|
||||
|
||||
if !strings.Contains(out, expected) {
|
||||
c.Fatalf("Expected output to contain %q, not %q", out, expected)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue