Border router CI test: check that all ping replies are received

This commit is contained in:
Simon Duquennoy 2018-01-27 08:27:02 -08:00
parent d9e3abac2f
commit b7fe599848

View File

@ -9,6 +9,9 @@ BASENAME=$2
# Destination IPv6
IPADDR=$3
# ICMP request-reply count
COUNT=5
# Start simulation
echo "Starting Cooja simulation $BASENAME.csc"
java -Xshare:on -jar $CONTIKI/tools/cooja/dist/cooja.jar -nogui=$BASENAME.csc -contiki=$CONTIKI > $BASENAME.coojalog &
@ -28,9 +31,10 @@ sleep 5
# Do ping
echo "Pinging"
ping6 $IPADDR -c 5 | tee $BASENAME.scriptlog
ping6 $IPADDR -c $COUNT | tee $BASENAME.scriptlog
# Fetch ping6 status code (not $? because this is piped)
STATUS=${PIPESTATUS[0]}
REPLIES=`grep -c 'icmp_seq=' $BASENAME.scriptlog`
echo "Closing simulation and tunslip6"
sleep 1
@ -40,7 +44,7 @@ sleep 1
rm COOJA.testlog
rm COOJA.log
if [ $STATUS -eq 0 ] ; then
if [ $STATUS -eq 0 ] && [ $REPLIES -eq $COUNT ] ; then
printf "%-32s TEST OK\n" "$BASENAME" | tee $BASENAME.testlog;
else
echo "==== $BASENAME.coojalog ====" ; cat $BASENAME.coojalog;