Skip to content

Commit

Permalink
Add test for bug (9056) where rmi -f fails with "no such id".
Browse files Browse the repository at this point in the history
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <[email protected]> (github: jfrazelle)
  • Loading branch information
jessfraz committed Nov 17, 2014
1 parent d5098fd commit a060510
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions integration-cli/docker_cli_rmi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,23 @@ func TestRmiTagWithExistingContainers(t *testing.T) {

logDone("rmi - delete tag with existing containers")
}

func TestRmiForceWithExistingContainers(t *testing.T) {
image := "busybox-clone"
if out, _, err := runCommandWithOutput(exec.Command(dockerBinary, "build", "--no-cache", "-t", image, "/docker-busybox")); err != nil {
t.Fatalf("Could not build %s: %s, %v", image, out, err)
}

if out, _, err := runCommandWithOutput(exec.Command(dockerBinary, "run", "--name", "test-force-rmi", image, "/bin/true")); err != nil {
t.Fatalf("Could not run container: %s, %v", out, err)
}

out, _, err := runCommandWithOutput(exec.Command(dockerBinary, "rmi", "-f", image))
if err != nil {
t.Fatalf("Could not remove image %s: %s, %v", image, out, err)
}

deleteAllContainers()

logDone("rmi - force delete with existing containers")
}

0 comments on commit a060510

Please sign in to comment.