add integraion test for rmi -f with image tag

Signed-off-by: Xian Chaobo <xianchaobo@huawei.com>
This commit is contained in:
Xian Chaobo 2015-10-31 10:36:02 +08:00
parent d395fa59a1
commit 5aae69fc58
1 changed files with 27 additions and 0 deletions

View File

@ -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"* ]]
}