From a2c76f63c3bf86995794adf9178849ca74650c70 Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Tue, 27 Mar 2018 02:01:41 -0700 Subject: [PATCH] Border router tests: make all simulations real-time --- tests/17-tun-rpl-br/01-border-router-cooja.csc | 3 ++- tests/17-tun-rpl-br/01-border-router-cooja.sh | 2 +- tests/17-tun-rpl-br/02-border-router-cooja-tsch.csc | 3 ++- tests/17-tun-rpl-br/02-border-router-cooja-tsch.sh | 3 ++- tests/17-tun-rpl-br/03-border-router-sky.csc | 4 +++- tests/17-tun-rpl-br/03-border-router-sky.sh | 2 +- tests/17-tun-rpl-br/04-border-router-traceroute.csc | 3 ++- tests/17-tun-rpl-br/04-border-router-traceroute.sh | 8 ++++++-- tests/17-tun-rpl-br/07-native-border-router-cooja.sh | 2 +- tests/17-tun-rpl-br/test-border-router.sh | 7 +++++-- .../{test-nbr.sh => test-native-border-router.sh} | 7 +++++-- tests/Makefile.script-test | 1 + 12 files changed, 31 insertions(+), 14 deletions(-) rename tests/17-tun-rpl-br/{test-nbr.sh => test-native-border-router.sh} (91%) diff --git a/tests/17-tun-rpl-br/01-border-router-cooja.csc b/tests/17-tun-rpl-br/01-border-router-cooja.csc index 02808aeec..b0d95600a 100644 --- a/tests/17-tun-rpl-br/01-border-router-cooja.csc +++ b/tests/17-tun-rpl-br/01-border-router-cooja.csc @@ -239,7 +239,8 @@ make -j hello-world.cooja TARGET=cooja org.contikios.cooja.plugins.ScriptRunner +/* Set simulaion speed to real time */ +sim.setSpeedLimit(1.0); true 600 diff --git a/tests/17-tun-rpl-br/01-border-router-cooja.sh b/tests/17-tun-rpl-br/01-border-router-cooja.sh index 6a781583d..11b2edc8a 100755 --- a/tests/17-tun-rpl-br/01-border-router-cooja.sh +++ b/tests/17-tun-rpl-br/01-border-router-cooja.sh @@ -6,4 +6,4 @@ CONTIKI=$1 # Simulation file BASENAME=01-border-router-cooja -bash test-border-router.sh $CONTIKI $BASENAME fd00::204:4:4:4 +bash test-border-router.sh $CONTIKI $BASENAME fd00::204:4:4:4 60 diff --git a/tests/17-tun-rpl-br/02-border-router-cooja-tsch.csc b/tests/17-tun-rpl-br/02-border-router-cooja-tsch.csc index 5b86b690c..61a6c96ce 100644 --- a/tests/17-tun-rpl-br/02-border-router-cooja-tsch.csc +++ b/tests/17-tun-rpl-br/02-border-router-cooja-tsch.csc @@ -239,7 +239,8 @@ make -j hello-world.cooja TARGET=cooja MAKE_MAC=MAKE_MAC_TSCH org.contikios.cooja.plugins.ScriptRunner +/* Set simulaion speed to real time */ +sim.setSpeedLimit(1.0); true 600 diff --git a/tests/17-tun-rpl-br/02-border-router-cooja-tsch.sh b/tests/17-tun-rpl-br/02-border-router-cooja-tsch.sh index b91a8d5c7..c7e61c8a7 100755 --- a/tests/17-tun-rpl-br/02-border-router-cooja-tsch.sh +++ b/tests/17-tun-rpl-br/02-border-router-cooja-tsch.sh @@ -6,4 +6,5 @@ CONTIKI=$1 # Simulation file BASENAME=02-border-router-cooja-tsch -bash test-border-router.sh $CONTIKI $BASENAME fd00::204:4:4:4 +# Add a little extra initial time to account for TSCH association time +bash test-border-router.sh $CONTIKI $BASENAME fd00::204:4:4:4 120 diff --git a/tests/17-tun-rpl-br/03-border-router-sky.csc b/tests/17-tun-rpl-br/03-border-router-sky.csc index cec948e0d..e19573d8d 100644 --- a/tests/17-tun-rpl-br/03-border-router-sky.csc +++ b/tests/17-tun-rpl-br/03-border-router-sky.csc @@ -222,7 +222,9 @@ make -j hello-world.sky TARGET=sky org.contikios.cooja.plugins.ScriptRunner - + true 600 diff --git a/tests/17-tun-rpl-br/03-border-router-sky.sh b/tests/17-tun-rpl-br/03-border-router-sky.sh index 798e0242b..7ffa4265e 100755 --- a/tests/17-tun-rpl-br/03-border-router-sky.sh +++ b/tests/17-tun-rpl-br/03-border-router-sky.sh @@ -6,4 +6,4 @@ CONTIKI=$1 # Simulation file BASENAME=03-border-router-sky -bash test-border-router.sh $CONTIKI $BASENAME fd00::0212:7404:0004:0404 +bash test-border-router.sh $CONTIKI $BASENAME fd00::0212:7404:0004:0404 60 diff --git a/tests/17-tun-rpl-br/04-border-router-traceroute.csc b/tests/17-tun-rpl-br/04-border-router-traceroute.csc index 02808aeec..b0d95600a 100644 --- a/tests/17-tun-rpl-br/04-border-router-traceroute.csc +++ b/tests/17-tun-rpl-br/04-border-router-traceroute.csc @@ -239,7 +239,8 @@ make -j hello-world.cooja TARGET=cooja org.contikios.cooja.plugins.ScriptRunner +/* Set simulaion speed to real time */ +sim.setSpeedLimit(1.0); true 600 diff --git a/tests/17-tun-rpl-br/04-border-router-traceroute.sh b/tests/17-tun-rpl-br/04-border-router-traceroute.sh index 33e239e08..e1e9d6cdd 100755 --- a/tests/17-tun-rpl-br/04-border-router-traceroute.sh +++ b/tests/17-tun-rpl-br/04-border-router-traceroute.sh @@ -8,6 +8,10 @@ BASENAME=04-border-router-traceroute # Destination IPv6 IPADDR=fd00::204:4:4:4 + +# Time allocated for toplogy formation +WAIT_TIME=60 + # The expected hop count TARGETHOPS=4 @@ -22,8 +26,8 @@ echo "Starting tunslip6" make -C $CONTIKI/tools tunslip6 make -C $CONTIKI/examples/rpl-border-router/ connect-router-cooja TARGET=zoul >> $BASENAME.tunslip.log 2>&1 & MPID=$! -echo "Waiting for network formation" -sleep 20 # not in real-time, simulates at full speed +printf "Waiting for network formation (%d seconds)\n" "$WAIT_TIME" +sleep $WAIT_TIME # Do ping echo "Running Traceroute" diff --git a/tests/17-tun-rpl-br/07-native-border-router-cooja.sh b/tests/17-tun-rpl-br/07-native-border-router-cooja.sh index d5d2642fe..8f91bd726 100755 --- a/tests/17-tun-rpl-br/07-native-border-router-cooja.sh +++ b/tests/17-tun-rpl-br/07-native-border-router-cooja.sh @@ -6,4 +6,4 @@ CONTIKI=$1 # Simulation file BASENAME=07-native-border-router-cooja -bash test-nbr.sh $CONTIKI $BASENAME fd00::204:4:4:4 +bash test-native-border-router.sh $CONTIKI $BASENAME fd00::204:4:4:4 60 diff --git a/tests/17-tun-rpl-br/test-border-router.sh b/tests/17-tun-rpl-br/test-border-router.sh index ff0e48cce..6bfb8cf62 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 +# Time allocated for convergence +WAIT_TIME=$4 + # ICMP request-reply count COUNT=5 @@ -23,8 +26,8 @@ echo "Starting tunslip6" make -C $CONTIKI/tools tunslip6 make -C $CONTIKI/examples/rpl-border-router/ connect-router-cooja TARGET=zoul >> $BASENAME.tunslip.log 2>&1 & MPID=$! -echo "Waiting for network formation" -sleep 20 # not in real-time, simulates at full speed +printf "Waiting for network formation (%d seconds)\n" "$WAIT_TIME" +sleep $WAIT_TIME # Do ping echo "Pinging" diff --git a/tests/17-tun-rpl-br/test-nbr.sh b/tests/17-tun-rpl-br/test-native-border-router.sh similarity index 91% rename from tests/17-tun-rpl-br/test-nbr.sh rename to tests/17-tun-rpl-br/test-native-border-router.sh index 9a1824f7c..38dce1bae 100644 --- a/tests/17-tun-rpl-br/test-nbr.sh +++ b/tests/17-tun-rpl-br/test-native-border-router.sh @@ -9,6 +9,9 @@ BASENAME=$2 # Destination IPv6 IPADDR=$3 +# Time allocated for convergence +WAIT_TIME=$4 + # ICMP request-reply count COUNT=5 @@ -22,8 +25,8 @@ sleep 20 echo "Starting native border-router" nohup make -C $CONTIKI/examples/rpl-border-router/ connect-router-cooja TARGET=native >> $BASENAME.nbr.log 2>&1 & MPID=$! -echo "Waiting for network formation" -sleep 60 # runs in real time so we need to wait a bit +printf "Waiting for network formation (%d seconds)\n" "$WAIT_TIME" +sleep $WAIT_TIME # Do ping echo "Pinging" diff --git a/tests/Makefile.script-test b/tests/Makefile.script-test index 978809dfb..e4dd0da6a 100644 --- a/tests/Makefile.script-test +++ b/tests/Makefile.script-test @@ -11,6 +11,7 @@ summary: cooja $(TESTLOGS) @cat summary %.testlog: %.sh cooja + @echo "========== Running script test $(basename $@).sh ==========" @bash "$(basename $@).sh" "$(CONTIKI)" clean: