diff --git a/test/integration/api/volume.bats b/test/integration/api/volume.bats index a33b33b71e..1b15174d85 100644 --- a/test/integration/api/volume.bats +++ b/test/integration/api/volume.bats @@ -73,20 +73,25 @@ function teardown() { start_docker_with_busybox 2 swarm_manage + # check for failure when removing a nonexistant volume run docker_swarm volume rm test_volume [ "$status" -ne 0 ] + # run a container that exits imediately but stays around and + # connected to the volume. Wait for it to finish. docker_swarm run -d --name=test_container -v=/tmp busybox true - + docker_swarm wait test_container + run docker_swarm volume ls -q volume=${output} [ "${#lines[@]}" -eq 1 ] + # check that removing an attached volume is an error run docker_swarm volume rm $volume [ "$status" -ne 0 ] docker_swarm rm test_container - + run docker_swarm volume rm $volume [ "$status" -eq 0 ] [ "${#lines[@]}" -eq 1 ]