Commit b7fe5998 authored by Simon Duquennoy's avatar Simon Duquennoy
Browse files

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

parent d9e3abac
......@@ -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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment