diff --git a/tests/17-tun-rpl-br/test-border-router.sh b/tests/17-tun-rpl-br/test-border-router.sh index 1a1d22a46..fac803ba8 100755 --- a/tests/17-tun-rpl-br/test-border-router.sh +++ b/tests/17-tun-rpl-br/test-border-router.sh @@ -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;