Browse code

Merge pull request #17011 from sunyuan3/TestRunWithBlkioInvalidWeight

update TestRunWithBlkioInvalidWeight

Vincent Demeester authored on 2015/10/15 15:34:52
Showing 1 changed files
... ...
@@ -273,9 +273,10 @@ func (s *DockerSuite) TestRunWithBlkioWeight(c *check.C) {
273 273
 
274 274
 func (s *DockerSuite) TestRunWithBlkioInvalidWeight(c *check.C) {
275 275
 	testRequires(c, blkioWeight)
276
-	if _, _, err := dockerCmdWithError("run", "--blkio-weight", "5", "busybox", "true"); err == nil {
277
-		c.Fatalf("run with invalid blkio-weight should failed")
278
-	}
276
+	out, _, err := dockerCmdWithError("run", "--blkio-weight", "5", "busybox", "true")
277
+	c.Assert(err, check.NotNil, check.Commentf(out))
278
+	expected := "Range of blkio weight is from 10 to 1000"
279
+	c.Assert(out, checker.Contains, expected)
279 280
 }
280 281
 
281 282
 func (s *DockerSuite) TestRunOOMExitCode(c *check.C) {