diff --git a/tools/cooja/contiki_tests/rime_runicast.csc b/tools/cooja/contiki_tests/rime_runicast.csc new file mode 100644 index 000000000..a10a8fe24 --- /dev/null +++ b/tools/cooja/contiki_tests/rime_runicast.csc @@ -0,0 +1,130 @@ + + + + My simulation + 0 + 1 + 123456 + 10000 + + se.sics.cooja.radiomediums.UDGM + 50.0 + 0.0 + 0.9 + 1.0 + + + se.sics.cooja.mspmote.SkyMoteType + sky1 + Sky Mote Type #1 + ../../../examples/rime/example-runicast.c + make example-runicast.sky TARGET=sky + + + se.sics.cooja.mspmote.SkyMote + sky1 + + se.sics.cooja.interfaces.Position + 3.0783332685337617 + 38.39795740836801 + 0.0 + + + se.sics.cooja.mspmote.interfaces.MspMoteID + 1 + + + + se.sics.cooja.mspmote.SkyMote + sky1 + + se.sics.cooja.interfaces.Position + 1.1986251808192212 + 53.65838347315817 + 0.0 + + + se.sics.cooja.mspmote.interfaces.MspMoteID + 2 + + + + se.sics.cooja.mspmote.SkyMote + sky1 + + se.sics.cooja.interfaces.Position + 34.432838059195255 + 38.26541658684913 + 0.0 + + + se.sics.cooja.mspmote.interfaces.MspMoteID + 3 + + + + se.sics.cooja.mspmote.SkyMote + sky1 + + se.sics.cooja.interfaces.Position + 150.85510197745134 + 141.37553211643905 + 0.0 + + + se.sics.cooja.mspmote.interfaces.MspMoteID + 4 + + + + + se.sics.cooja.plugins.SimControl + 265 + 1 + 200 + 0 + 0 + false + + + se.sics.cooja.plugins.LogListener + + received + 256 + + 692 + 2 + 209 + 0 + 434 + false + + + se.sics.cooja.radiomediums.UDGM$VisUDGM + 263 + 4 + 125 + 1 + 200 + false + + + se.sics.cooja.plugins.RadioLogger + 427 + 3 + 432 + 264 + 1 + false + + + se.sics.cooja.plugins.VisTraffic + 263 + 5 + 110 + 1 + 324 + false + + + diff --git a/tools/cooja/contiki_tests/rime_runicast.info b/tools/cooja/contiki_tests/rime_runicast.info new file mode 100644 index 000000000..c256fe4f7 --- /dev/null +++ b/tools/cooja/contiki_tests/rime_runicast.info @@ -0,0 +1 @@ +4 Sky nodes running examples/rime/example-runicast.c. Tests both timeout and send acknowledgements. diff --git a/tools/cooja/contiki_tests/rime_runicast.js b/tools/cooja/contiki_tests/rime_runicast.js new file mode 100644 index 000000000..47fe8530e --- /dev/null +++ b/tools/cooja/contiki_tests/rime_runicast.js @@ -0,0 +1,63 @@ + +/* Count received packets */ +if (msg.contains('received')) { + result = global.get("recv"); + if (result == null) { + result = 0; + } + + result++; + global.put("recv", result); + log.log("Received packets count now: " + result + "\n"); +} + +/* Count timed out packets */ +if (msg.contains('timed out')) { + result = global.get("timeout"); + if (result == null) { + result = 0; + } + + result++; + global.put("timeout", result); + log.log("Timed out packets count now: " + result + "\n"); +} + + + +/* Count sent packets */ +if (msg.contains('sent to')) { + result = global.get("sent"); + if (result == null) { + result = 0; + } + + result++; + global.put("sent", result); + log.log("Sent packets count now: " + result + "\n"); +} + +/* Look for test completion */ +countSent = global.get("sent"); +if (countSent >= 10) { + + /* Make sure received counter matches sent counter */ + countReceived = global.get("recv"); + if (countReceived < countSent) { + log.log("Received < Sent: " + countReceived + " < " + countSent + "\n"); + log.log("Received packets less than acked sent packets!\n"); + log.testFailed(); + } + + /* Make sure some packets timed out (all from node 4) */ + countTimedOut = global.get("timeout"); + if (countTimedOut == null || countTimedOut < 2) { + log.log("Timed out: " + countTimedOut + "\n"); + log.log("Too few packets timed out!\n"); + log.testFailed(); + } + + log.log("Received / Sent: " + countReceived + " / " + countSent + "\n"); + log.log("Timed out: " + countTimedOut + "\n"); + log.testOK(); +}