From 069b3996399f70a62301cac9d44685e7c1c8a674 Mon Sep 17 00:00:00 2001 From: Joakim Eriksson Date: Sat, 27 Jan 2018 15:52:45 +0100 Subject: [PATCH] added CI test for native border router --- .../07-native-border-router-sky.csc | 235 ++++++++++++++++++ .../07-native-border-router-sky.sh | 9 + tests/17-tun-rpl-br/test-nbr.sh | 56 +++++ 3 files changed, 300 insertions(+) create mode 100644 tests/17-tun-rpl-br/07-native-border-router-sky.csc create mode 100755 tests/17-tun-rpl-br/07-native-border-router-sky.sh create mode 100644 tests/17-tun-rpl-br/test-nbr.sh diff --git a/tests/17-tun-rpl-br/07-native-border-router-sky.csc b/tests/17-tun-rpl-br/07-native-border-router-sky.csc new file mode 100644 index 000000000..22e1fbf9d --- /dev/null +++ b/tests/17-tun-rpl-br/07-native-border-router-sky.csc @@ -0,0 +1,235 @@ + + + [APPS_DIR]/mrm + [APPS_DIR]/mspsim + [APPS_DIR]/avrora + [APPS_DIR]/serial_socket + [APPS_DIR]/collect-view + [APPS_DIR]/powertracker + + My simulation + 1.0 + 123456 + 1000000 + + org.contikios.cooja.radiomediums.UDGM + 50.0 + 100.0 + 1.0 + 1.0 + + + 40000 + + + org.contikios.cooja.mspmote.SkyMoteType + sky1 + Sky Mote Type #sky1 + [CONTIKI_DIR]/examples/slip-radio/slip-radio.c + make clean TARGET=sky +make -j slip-radio.sky TARGET=sky + [CONTIKI_DIR]/examples/slip-radio/slip-radio.sky + org.contikios.cooja.interfaces.Position + org.contikios.cooja.interfaces.RimeAddress + org.contikios.cooja.interfaces.IPAddress + org.contikios.cooja.interfaces.Mote2MoteRelations + org.contikios.cooja.interfaces.MoteAttributes + org.contikios.cooja.mspmote.interfaces.MspClock + org.contikios.cooja.mspmote.interfaces.MspMoteID + org.contikios.cooja.mspmote.interfaces.SkyButton + org.contikios.cooja.mspmote.interfaces.SkyFlash + org.contikios.cooja.mspmote.interfaces.SkyCoffeeFilesystem + org.contikios.cooja.mspmote.interfaces.Msp802154Radio + org.contikios.cooja.mspmote.interfaces.MspSerial + org.contikios.cooja.mspmote.interfaces.SkyLED + org.contikios.cooja.mspmote.interfaces.MspDebugOutput + org.contikios.cooja.mspmote.interfaces.SkyTemperature + + + org.contikios.cooja.mspmote.SkyMoteType + sky2 + Sky Mote Type #sky2 + [CONTIKI_DIR]/examples/hello-world/hello-world.c + make clean TARGET=sky +make -j hello-world.sky TARGET=sky + [CONTIKI_DIR]/examples/hello-world/hello-world.sky + org.contikios.cooja.interfaces.Position + org.contikios.cooja.interfaces.RimeAddress + org.contikios.cooja.interfaces.IPAddress + org.contikios.cooja.interfaces.Mote2MoteRelations + org.contikios.cooja.interfaces.MoteAttributes + org.contikios.cooja.mspmote.interfaces.MspClock + org.contikios.cooja.mspmote.interfaces.MspMoteID + org.contikios.cooja.mspmote.interfaces.SkyButton + org.contikios.cooja.mspmote.interfaces.SkyFlash + org.contikios.cooja.mspmote.interfaces.SkyCoffeeFilesystem + org.contikios.cooja.mspmote.interfaces.Msp802154Radio + org.contikios.cooja.mspmote.interfaces.MspSerial + org.contikios.cooja.mspmote.interfaces.SkyLED + org.contikios.cooja.mspmote.interfaces.MspDebugOutput + org.contikios.cooja.mspmote.interfaces.SkyTemperature + + + + + org.contikios.cooja.interfaces.Position + -24.750327773354453 + 17.688901393447438 + 0.0 + + + org.contikios.cooja.mspmote.interfaces.MspClock + 1.0 + + + org.contikios.cooja.mspmote.interfaces.MspMoteID + 1 + + sky1 + + + + + org.contikios.cooja.interfaces.Position + 1.091493067677618 + 40.943504236660225 + 0.0 + + + org.contikios.cooja.mspmote.interfaces.MspClock + 1.0 + + + org.contikios.cooja.mspmote.interfaces.MspMoteID + 2 + + sky2 + + + + + org.contikios.cooja.interfaces.Position + 22.647678967805337 + 61.6365018442491 + 0.0 + + + org.contikios.cooja.mspmote.interfaces.MspClock + 1.0 + + + org.contikios.cooja.mspmote.interfaces.MspMoteID + 3 + + sky2 + + + + + org.contikios.cooja.interfaces.Position + 44.02005813888037 + 93.02398317771755 + 0.0 + + + org.contikios.cooja.mspmote.interfaces.MspClock + 1.0 + + + org.contikios.cooja.mspmote.interfaces.MspMoteID + 4 + + sky2 + + + + org.contikios.cooja.plugins.SimControl + 280 + 1 + 160 + 400 + 0 + + + org.contikios.cooja.plugins.Visualizer + + true + org.contikios.cooja.plugins.skins.IDVisualizerSkin + org.contikios.cooja.plugins.skins.UDGMVisualizerSkin + 2.3610941331949244 0.0 0.0 2.3610941331949244 119.38219749746548 -4.52452305190821 + + 400 + 3 + 400 + 1 + 1 + + + org.contikios.cooja.plugins.LogListener + + + + + + 1404 + 6 + 240 + 400 + 160 + + + org.contikios.cooja.plugins.TimeLine + + 0 + 1 + 2 + 3 + + + + 500.0 + + 1804 + 5 + 166 + 0 + 742 + + + org.contikios.cooja.plugins.Notes + + Enter notes here + true + + 1124 + 4 + 160 + 680 + 0 + + + org.contikios.cooja.serialsocket.SerialSocketServer + 0 + + 60001 + true + + 362 + 2 + 116 + 30 + 403 + + + org.contikios.cooja.plugins.ScriptRunner + + + true + + 600 + 0 + 700 + 850 + 13 + + diff --git a/tests/17-tun-rpl-br/07-native-border-router-sky.sh b/tests/17-tun-rpl-br/07-native-border-router-sky.sh new file mode 100755 index 000000000..b986b3fce --- /dev/null +++ b/tests/17-tun-rpl-br/07-native-border-router-sky.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# Contiki directory +CONTIKI=$1 + +# Simulation file +BASENAME=07-native-border-router-sky + +bash test-nbr.sh $CONTIKI $BASENAME fd02::0212:7202:0002:0202 diff --git a/tests/17-tun-rpl-br/test-nbr.sh b/tests/17-tun-rpl-br/test-nbr.sh new file mode 100644 index 000000000..fdb4b191c --- /dev/null +++ b/tests/17-tun-rpl-br/test-nbr.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +# Contiki directory +CONTIKI=$1 + +# Simulation file +BASENAME=$2 + +# Destination IPv6 +IPADDR=$3 + +# 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 & +JPID=$! +sleep 20 + +echo "Enabling IPv6" +sudo sysctl -w net.ipv6.conf.all.disable_ipv6=0 + +# Connect to the simlation +echo "Starting native border-router" +make -C $CONTIKI/examples/rpl-border-router/ +sudo $CONTIKI/examples/rpl-border-router/border-router.native -B 115200 -a localhost fd02::1/64 >> $BASENAME.nbr.log 2>&1 & +MPID=$! +echo "Waiting for network formation" +sleep 50 + +# Do ping +echo "Pinging" +ping6 $IPADDR -s 10 -c 5 | tee $BASENAME.scriptlog +# Fetch ping6 status code (not $? because this is piped) +STATUS=${PIPESTATUS[0]} + +echo "Closing simulation and nbr" +sleep 1 +kill -9 $JPID +kill -9 $MPID +sleep 1 +rm COOJA.testlog +rm COOJA.log + +if [ $STATUS -eq 0 ] ; then + printf "%-32s TEST OK\n" "$BASENAME" | tee $BASENAME.testlog; +else + echo "==== $BASENAME.coojalog ====" ; cat $BASENAME.coojalog; + echo "==== $BASENAME.nbr.log ====" ; cat $BASENAME.nbr.log; + echo "==== $BASENAME.scriptlog ====" ; cat $BASENAME.scriptlog; + + printf "%-32s TEST FAIL\n" "$BASENAME" | tee $BASENAME.testlog; +fi + +# We do not want Make to stop -> Return 0 +# The Makefile will check if a log contains FAIL at the end + +exit 0