mirror of https://github.com/docker/docs.git
Fix format issue in state.bats.
Signed-off-by: Dong Chen <dongluo.chen@docker.com>
This commit is contained in:
parent
9a1584d508
commit
6a1b49cf4e
|
@ -31,17 +31,17 @@ function setup_discovery_file() {
|
||||||
# Start swarm and check it can reach the node
|
# Start swarm and check it can reach the node
|
||||||
swarm_manage --engine-refresh-min-interval "1s" --engine-refresh-max-interval "1s" --engine-failure-retry 2 "$DISCOVERY"
|
swarm_manage --engine-refresh-min-interval "1s" --engine-refresh-max-interval "1s" --engine-failure-retry 2 "$DISCOVERY"
|
||||||
|
|
||||||
eval "docker_swarm info | grep -q -i 'Status: Healthy'"
|
eval "docker_swarm info | grep -q -i 'Status: Healthy'"
|
||||||
|
|
||||||
# Stop the node and let it fail
|
# Stop the node and let it fail
|
||||||
docker_host stop ${DOCKER_CONTAINERS[0]}
|
docker_host stop ${DOCKER_CONTAINERS[0]}
|
||||||
# Wait for swarm to detect node failure
|
# Wait for swarm to detect node failure
|
||||||
retry 5 1 eval "docker_swarm info | grep -q -i 'Status: Unhealthy'"
|
retry 5 1 eval "docker_swarm info | grep -q -i 'Status: Unhealthy'"
|
||||||
|
|
||||||
# Restart node
|
# Restart node
|
||||||
docker_host start ${DOCKER_CONTAINERS[0]}
|
docker_host start ${DOCKER_CONTAINERS[0]}
|
||||||
# Wait for swarm to detect node recovery
|
# Wait for swarm to detect node recovery
|
||||||
retry 5 1 eval "docker_swarm info | grep -q -i 'Status: Healthy'"
|
retry 5 1 eval "docker_swarm info | grep -q -i 'Status: Healthy'"
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "node pending and recovery" {
|
@test "node pending and recovery" {
|
||||||
|
@ -53,11 +53,11 @@ function setup_discovery_file() {
|
||||||
|
|
||||||
# Start swarm with the stopped node
|
# Start swarm with the stopped node
|
||||||
swarm_manage_no_wait "$DISCOVERY"
|
swarm_manage_no_wait "$DISCOVERY"
|
||||||
retry 2 1 eval "docker_swarm info | grep -q -i 'Status: Pending'"
|
retry 2 1 eval "docker_swarm info | grep -q -i 'Status: Pending'"
|
||||||
|
|
||||||
# Restart the node
|
# Restart the node
|
||||||
docker_host start ${DOCKER_CONTAINERS[0]}
|
docker_host start ${DOCKER_CONTAINERS[0]}
|
||||||
# Wait for swarm to detect node recovery
|
# Wait for swarm to detect node recovery
|
||||||
retry 15 3 eval "docker_swarm info | grep -q -i 'Status: Healthy'"
|
retry 15 3 eval "docker_swarm info | grep -q -i 'Status: Healthy'"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue