mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Add test for bug (9056) where rmi -f fails with "no such id".
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
This commit is contained in:
parent
d5098fde9a
commit
a0605107d7
1 changed files with 20 additions and 0 deletions
|
@ -99,3 +99,23 @@ func TestRmiTagWithExistingContainers(t *testing.T) {
|
||||||
|
|
||||||
logDone("rmi - delete tag with existing containers")
|
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")
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue