Allow pingloss adjustment.
Don't hardcode packet loss threshold but make it configurable. New variable 'loss_threshold' is introduced in this change and by default is set to 1 Output of ping test might contain info about errors, for e.g.: 2486 packets transmitted, 2385 received, +73 errors, 4% packet loss versus: 520 packets transmitted, 505 received, 2% packet loss, time 519232ms causing issue in threshold assertion task. Change-Id: I77eca033dc818487cdb2c68fa2378cc9acad6e66
This commit is contained in:
parent
b111366084
commit
a359c3a1ae
@ -232,3 +232,6 @@ upgrade_remove_rpm: false
|
||||
|
||||
# List of roles deployed in overcloud
|
||||
oc_roles: []
|
||||
|
||||
# Packet loss threshold for a ping test
|
||||
loss_threshold: 1
|
||||
|
@ -11,8 +11,8 @@ PING_RESULT_LOG=$(find ~ -iname 'ping_results*' | sort | tail -1)
|
||||
tail -2 $PING_RESULT_LOG
|
||||
|
||||
# check results
|
||||
PING_RESULT=$(tail -2 $PING_RESULT_LOG | head -1 | awk {'print $6'} | sed s/%//)
|
||||
if [[ $PING_RESULT -gt 1 ]]; then
|
||||
echo "Ping loss higher than 1% detected"
|
||||
PING_RESULT=$( awk '/[[:digit:]]+% packet loss/' $PING_RESULT_LOG | grep -Eo '[[:digit:]]+%' | sed s/\%// )
|
||||
if [[ $PING_RESULT -gt {{ loss_threshold|default(1)|int }} ]]; then
|
||||
echo "Ping loss higher than {{ loss_threshold|default(1)|int }}% detected"
|
||||
exit 1
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user