Add the expected error verification for TestRmiBlank.
Signed-off-by: Yuan Sun <sunyuan3@huawei.com> Upstream-commit: 2179dd00dd2e084ed833c2c22e766b56903fc12c Component: engine
This commit is contained in:
@ -252,4 +252,19 @@ func (s *DockerSuite) TestRmiBlank(c *check.C) {
|
||||
if strings.Contains(out, "No such image") {
|
||||
c.Fatalf("Wrong error message generated: %s", out)
|
||||
}
|
||||
|
||||
if !strings.Contains(out, "Image name can not be blank") {
|
||||
c.Fatalf("Expected error message not generated: %s", out)
|
||||
}
|
||||
|
||||
runCmd = exec.Command(dockerBinary, "rmi", " ")
|
||||
out, _, err = runCommandWithOutput(runCmd)
|
||||
|
||||
if err == nil {
|
||||
c.Fatal("Should have failed to delete '' image")
|
||||
}
|
||||
|
||||
if !strings.Contains(out, "No such image") {
|
||||
c.Fatalf("Expected error message not generated: %s", out)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user