Files
docker-docs/test/integration/api/wait.bats
Andrea Luzzardi 4bb035e41a integration: Fix API races related to delay in refresh.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-08 19:26:58 -07:00

22 lines
416 B
Bash

#!/usr/bin/env bats
load ../helpers
function teardown() {
swarm_manage_cleanup
stop_docker
}
@test "docker wait" {
start_docker_with_busybox 2
swarm_manage
# run after 1 seconds, test_container will exit
docker_swarm run -d --name test_container busybox sleep 1
# wait until exist(after 1 seconds)
run timeout 5 docker -H $SWARM_HOST wait test_container
[ "$status" -eq 0 ]
[[ "${output}" == "0" ]]
}