fix tests

Signed-off-by: Victor Vieux <vieux@docker.com>
This commit is contained in:
Victor Vieux 2015-12-07 18:25:24 -08:00 committed by Alexandre Beslic
parent a17f182026
commit f1b7b7be59
5 changed files with 14 additions and 8 deletions

View File

@ -99,7 +99,7 @@ function teardown() {
swarm_join "$DISCOVERY"
# Start a manager. It should keep retrying
swarm_manage "$DISCOVERY"
swarm_manage_no_wait "$DISCOVERY"
# Now start the store
start_store

View File

@ -106,7 +106,7 @@ function teardown() {
swarm_join "$DISCOVERY"
# Start a manager. It should keep retrying
swarm_manage "$DISCOVERY"
swarm_manage_no_wait "$DISCOVERY"
# Now start the store
start_store

View File

@ -82,7 +82,7 @@ function setup_discovery_file() {
start_docker 2
# Start a manager. It should keep retrying
swarm_manage "$DISCOVERY"
swarm_manage_no_wait "$DISCOVERY"
# Now create the discovery file.
setup_discovery_file

View File

@ -99,7 +99,7 @@ function teardown() {
swarm_join "$DISCOVERY"
# Start a manager. It should keep retrying
swarm_manage "$DISCOVERY"
swarm_manage_no_wait "$DISCOVERY"
# Now start the store
start_store

View File

@ -95,8 +95,17 @@ function discovery_check_swarm_info() {
retry 10 1 eval "docker -H $host info | grep -q -e \"Nodes: $total\" -e \"Offers: $total\""
}
# Start the swarm manager in background.
function swarm_manage() {
local i=${#SWARM_MANAGE_PID[@]}
swarm_manage_no_wait "$@"
# Wait for nodes to be discovered
discovery_check_swarm_info "${#HOSTS[@]}" "${SWARM_HOSTS[$i]}"
}
# Start the swarm manager in background.
function swarm_manage_no_wait() {
local discovery
if [ $# -eq 0 ]; then
discovery=`join , ${HOSTS[@]}`
@ -114,9 +123,6 @@ function swarm_manage() {
# Wait for the Manager to be reachable
wait_until_reachable "$host"
# Wait for nodes to be discovered
discovery_check_swarm_info "${#HOSTS[@]}" "$host"
}
# swarm join every engine created with `start_docker`.