mirror of https://github.com/docker/docs.git
add integraion test for rmi -f with image tag
Signed-off-by: Xian Chaobo <xianchaobo@huawei.com>
This commit is contained in:
parent
d395fa59a1
commit
5aae69fc58
|
@ -102,3 +102,30 @@ function teardown() {
|
|||
[[ "${output}" != *"busybox"* ]]
|
||||
[[ "${output}" != *"testimage"* ]]
|
||||
}
|
||||
|
||||
@test "docker rmi --force with image tag" {
|
||||
start_docker_with_busybox 1
|
||||
start_docker 1
|
||||
|
||||
swarm_manage
|
||||
|
||||
# make sure same image id have two repo-tags
|
||||
docker_swarm tag busybox:latest testimage:tag1
|
||||
docker_swarm tag busybox:latest testimage:tag2
|
||||
|
||||
run docker_swarm images
|
||||
[[ "${output}" == *"busybox"* ]]
|
||||
[[ "${output}" == *"testimage"* ]]
|
||||
[[ "${output}" == *"tag1"* ]]
|
||||
[[ "${output}" == *"tag2"* ]]
|
||||
|
||||
# test rmi with force
|
||||
docker_swarm rmi -f testimage:tag1
|
||||
|
||||
# testimage:tag1 should be removed, testimage:tag2 should not
|
||||
run docker_swarm images
|
||||
[[ "${output}" == *"busybox"* ]]
|
||||
[[ "${output}" == *"testimage"* ]]
|
||||
[[ "${output}" != *"tag1"* ]]
|
||||
[[ "${output}" == *"tag2"* ]]
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue