1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #16616 from sunyuan3/TestRunWithSwappinessInvalid

Update TestRunWithSwappinessInvalid.
This commit is contained in:
Alexander Morozov 2015-09-28 11:42:26 -07:00
commit 17062aea21

View file

@ -322,9 +322,13 @@ func (s *DockerSuite) TestRunWithSwappiness(c *check.C) {
func (s *DockerSuite) TestRunWithSwappinessInvalid(c *check.C) {
testRequires(c, memorySwappinessSupport)
out, _, err := dockerCmdWithError("run", "--memory-swappiness", "101", "busybox", "true")
if err == nil {
c.Fatalf("failed. test was able to set invalid value, output: %q", out)
}
c.Assert(err, check.NotNil)
expected := "Valid memory swappiness range is 0-100"
c.Assert(out, checker.Contains, expected, check.Commentf("Expected output to contain %q, not %q", out, expected))
out, _, err = dockerCmdWithError("run", "--memory-swappiness", "-10", "busybox", "true")
c.Assert(err, check.NotNil)
c.Assert(out, checker.Contains, expected, check.Commentf("Expected output to contain %q, not %q", out, expected))
}
func (s *DockerSuite) TestRunWithMemoryReservation(c *check.C) {