summaryrefslogtreecommitdiffstats
path: root/validation-scripts
diff options
context:
space:
mode:
authorOliver Walsh <owalsh@redhat.com>2017-06-30 11:51:06 +0100
committerOliver Walsh <owalsh@redhat.com>2017-06-30 11:56:55 +0100
commit6a64a4a9d20a7a43eee6181c7bab738329844eba (patch)
tree67b2fef844670eeeb10cc4052f85999b31421d6d /validation-scripts
parent876bafb8e91582a4fed83514d9db0cfc3bc756d1 (diff)
Tolerate network errors in pingtest retry logic
We use ping -w <deadline> -c <count>. This will ping every second until <count> replies are received, or <deadline> is reached, or a network error occurs. With the current retry logic a network error will result in a short tight loop instead of waiting for the network to come up. This change reduces the deadline to 10s, but sleeps 60s between retries. Change-Id: Ib00cff6f843c04a00737b40e3ef3d1560d6e6d2d Related-bug: #1680167
Diffstat (limited to 'validation-scripts')
-rw-r--r--validation-scripts/all-nodes.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/validation-scripts/all-nodes.sh b/validation-scripts/all-nodes.sh
index ed7fefb7..296dcd36 100644
--- a/validation-scripts/all-nodes.sh
+++ b/validation-scripts/all-nodes.sh
@@ -10,12 +10,13 @@ function ping_retry() {
PING_CMD=ping6
fi
until [ $COUNT -ge $TIMES ]; do
- if $PING_CMD -w 300 -c 1 $IP_ADDR &> /dev/null; then
+ if $PING_CMD -w 10 -c 1 $IP_ADDR &> /dev/null; then
echo "Ping to $IP_ADDR succeeded."
return 0
fi
echo "Ping to $IP_ADDR failed. Retrying..."
COUNT=$(($COUNT + 1))
+ sleep 60
done
return 1
}