From 1d74b4f6d4990901b918d82957bef4bb5f41294c Mon Sep 17 00:00:00 2001 From: Fengtu Wang Date: Wed, 29 Mar 2017 17:32:25 +0800 Subject: [PATCH] fix TestDaemonRestartWithInvalidBasesize NotNil is expected behaviour, daemon should not start with invalid base size. Signed-off-by: Fengtu Wang --- integration-cli/docker_cli_daemon_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/integration-cli/docker_cli_daemon_test.go b/integration-cli/docker_cli_daemon_test.go index d23dcfd31d..b538327a91 100644 --- a/integration-cli/docker_cli_daemon_test.go +++ b/integration-cli/docker_cli_daemon_test.go @@ -198,7 +198,12 @@ func (s *DockerDaemonSuite) TestDaemonRestartWithInvalidBasesize(c *check.C) { if newBasesizeBytes < oldBasesizeBytes { err := s.d.RestartWithError("--storage-opt", fmt.Sprintf("dm.basesize=%d", newBasesizeBytes)) - 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)) + 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)) + // 'err != nil' is expected behaviour, no new daemon started, + // so no need to stop daemon. + if err != nil { + return + } } s.d.Stop(c) }