diff --git a/test/integration/api/rm.bats b/test/integration/api/rm.bats index a347e3bf49..5b190ee9b3 100644 --- a/test/integration/api/rm.bats +++ b/test/integration/api/rm.bats @@ -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