Changes error check form NotNil to IsNil

rmi -f always returns a 0 exit code so these tests needed to be changed
accordingly.

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
(cherry picked from commit 5d1587e61e)
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
This commit is contained in:
Eli Uriegas
2017-09-06 11:30:29 -07:00
committed by Eli Uriegas
parent 4e81e4fa4e
commit d73806305a

View File

@ -152,7 +152,7 @@ func (s *DockerSuite) TestRmiImageIDForceWithRunningContainersAndMultipleTags(c
out, _, err := dockerCmdWithError("rmi", "-f", imgID)
// rmi -f should not delete image with running containers
c.Assert(err, checker.NotNil)
c.Assert(err, checker.IsNil)
c.Assert(out, checker.Contains, "(cannot be forced) - image is being used by running container")
}
@ -245,7 +245,7 @@ func (s *DockerSuite) TestRmiContainerImageNotFound(c *check.C) {
// Try to remove the image of the running container and see if it fails as expected.
out, _, err := dockerCmdWithError("rmi", "-f", imageIds[0])
// The image of the running container should not be removed.
c.Assert(err, checker.NotNil)
c.Assert(err, checker.IsNil)
c.Assert(out, checker.Contains, "image is being used by running container", check.Commentf("out: %s", out))
}