Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
| ... | ... |
@@ -252,4 +252,19 @@ func (s *DockerSuite) TestRmiBlank(c *check.C) {
|
| 252 | 252 |
if strings.Contains(out, "No such image") {
|
| 253 | 253 |
c.Fatalf("Wrong error message generated: %s", out)
|
| 254 | 254 |
} |
| 255 |
+ |
|
| 256 |
+ if !strings.Contains(out, "Image name can not be blank") {
|
|
| 257 |
+ c.Fatalf("Expected error message not generated: %s", out)
|
|
| 258 |
+ } |
|
| 259 |
+ |
|
| 260 |
+ runCmd = exec.Command(dockerBinary, "rmi", " ") |
|
| 261 |
+ out, _, err = runCommandWithOutput(runCmd) |
|
| 262 |
+ |
|
| 263 |
+ if err == nil {
|
|
| 264 |
+ c.Fatal("Should have failed to delete '' image")
|
|
| 265 |
+ } |
|
| 266 |
+ |
|
| 267 |
+ if !strings.Contains(out, "No such image") {
|
|
| 268 |
+ c.Fatalf("Expected error message not generated: %s", out)
|
|
| 269 |
+ } |
|
| 255 | 270 |
} |