fix flacky rm test

Signed-off-by: Victor Vieux <victorvieux@gmail.com>
This commit is contained in:
Victor Vieux 2015-05-07 16:20:52 -07:00
parent 1bca3fb483
commit aeb83be5df
1 changed files with 6 additions and 10 deletions

View File

@ -11,17 +11,15 @@ function teardown() {
start_docker_with_busybox 2
swarm_manage
run docker_swarm run -d --name test_container busybox
[ "$status" -eq 0 ]
docker_swarm create --name test_container busybox
# make sure container exsists
run docker_swarm ps -l
[ "${#lines[@]}" -eq 2 ]
[[ "${lines[1]}" == *"test_container"* ]]
run docker_swarm rm test_container
[ "$status" -eq 0 ]
docker_swarm rm test_container
# verify
run docker_swarm ps -aq
[ "${#lines[@]}" -eq 0 ]
@ -31,8 +29,7 @@ function teardown() {
start_docker_with_busybox 2
swarm_manage
run docker_swarm run -d --name test_container busybox sleep 500
[ "$status" -eq 0 ]
docker_swarm run -d --name test_container busybox sleep 500
# make sure container exsists and is up
run docker_swarm ps -a
@ -45,8 +42,7 @@ function teardown() {
[ "$status" -ne 0 ]
# rm -f, remove a running container
run docker_swarm rm -f test_container
[ "$status" -eq 0 ]
docker_swarm rm -f test_container
# verify
run docker_swarm ps -aq