Skip to content
This repository has been archived by the owner on Feb 1, 2021. It is now read-only.

Commit

Permalink
Merge pull request #1362 from jimmyxian/add-integraion-test
Browse files Browse the repository at this point in the history
Add integraion test for rmi -f with image tag
  • Loading branch information
vieux committed Nov 1, 2015
2 parents d395fa5 + 5aae69f commit 830c612
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions test/integration/api/rmi.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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"* ]]
}

0 comments on commit 830c612

Please sign in to comment.