Browse code

fix TestDaemonRestartWithInvalidBasesize

NotNil is expected behaviour, daemon should not start with
invalid base size.

Signed-off-by: Fengtu Wang <wangfengtu@huawei.com>

Fengtu Wang authored on 2017/03/29 18:32:25
Showing 1 changed files
... ...
@@ -198,7 +198,12 @@ func (s *DockerDaemonSuite) TestDaemonRestartWithInvalidBasesize(c *check.C) {
198 198
 
199 199
 	if newBasesizeBytes < oldBasesizeBytes {
200 200
 		err := s.d.RestartWithError("--storage-opt", fmt.Sprintf("dm.basesize=%d", newBasesizeBytes))
201
-		c.Assert(err, check.IsNil, check.Commentf("daemon should not have started as new base device size is less than existing base device size: %v", err))
201
+		c.Assert(err, check.NotNil, check.Commentf("daemon should not have started as new base device size is less than existing base device size: %v", err))
202
+		// 'err != nil' is expected behaviour, no new daemon started,
203
+		// so no need to stop daemon.
204
+		if err != nil {
205
+			return
206
+		}
202 207
 	}
203 208
 	s.d.Stop(c)
204 209
 }