diff options
author | Jenkins <jenkins@review.openstack.org> | 2016-04-05 15:48:26 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2016-04-05 15:48:26 +0000 |
commit | fa24ef5944281bc17e202eab9ecb76e8080fa937 (patch) | |
tree | 39687094169bc4f019bdf1e5f88b8777d728bbbd /validation-scripts | |
parent | 9926cfb5324e2ac1e226bf7a3d5650a823d166ab (diff) | |
parent | 570c690bfb118e0cf130b7dbed7992676519ed9b (diff) |
Merge "Ping retry"
Diffstat (limited to 'validation-scripts')
-rw-r--r-- | validation-scripts/all-nodes.sh | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/validation-scripts/all-nodes.sh b/validation-scripts/all-nodes.sh index 31b4d6bf..69b489b7 100644 --- a/validation-scripts/all-nodes.sh +++ b/validation-scripts/all-nodes.sh @@ -20,9 +20,12 @@ function ping_controller_ips() { echo -n "Trying to ping $REMOTE_IP for local network $LOCAL_NETWORK..." set +e if ! $ping -W 300 -c 1 $REMOTE_IP &> /dev/null; then - echo "FAILURE" - echo "$REMOTE_IP is not pingable. Local Network: $LOCAL_NETWORK" >&2 - exit 1 + # If the first ping attempt fails, retry. + if ! $ping -W 300 -c 10 $REMOTE_IP &> /dev/null; then + echo "FAILURE" + echo "$REMOTE_IP is not pingable. Local Network: $LOCAL_NETWORK" >&2 + exit 1 + fi fi set -e echo "SUCCESS" @@ -40,10 +43,13 @@ function ping_default_gateways() { set +e for GW in $DEFAULT_GW; do echo -n "Trying to ping default gateway ${GW}..." - if ! ping -c 1 $GW &> /dev/null; then - echo "FAILURE" - echo "$GW is not pingable." - exit 1 + if ! $ping -c 1 $GW &> /dev/null; then + # If the first ping attempt fails, retry. + if ! $ping -c 10 $GW &> /dev/null; then + echo "FAILURE" + echo "$GW is not pingable." + exit 1 + fi fi done set -e |