From 62854151d7071cb8213079fccacb3e848160b057 Mon Sep 17 00:00:00 2001 From: fros4943 Date: Tue, 11 Nov 2008 15:17:44 +0000 Subject: [PATCH] more extensive rime abc testing: less than perfect radio environment (95%) + each node receives 30 radio messages each --- tools/cooja/contiki_tests/rime_abc.csc | 9 ++++----- tools/cooja/contiki_tests/rime_abc.info | 2 +- tools/cooja/contiki_tests/rime_abc.js | 19 ++++++++++++++----- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/tools/cooja/contiki_tests/rime_abc.csc b/tools/cooja/contiki_tests/rime_abc.csc index 40a517a34..8ac1536b3 100644 --- a/tools/cooja/contiki_tests/rime_abc.csc +++ b/tools/cooja/contiki_tests/rime_abc.csc @@ -5,13 +5,12 @@ 0 1 123456 - 1 5000 se.sics.cooja.radiomediums.UDGM 50.0 100.0 - 1.0 + 0.95 1.0 @@ -53,7 +52,7 @@ se.sics.cooja.plugins.SimControl 313 - 2 + 1 199 30 30 @@ -62,7 +61,7 @@ se.sics.cooja.radiomediums.UDGM$VisUDGM 300 - 3 + 2 122 367 23 @@ -75,7 +74,7 @@ 256 573 - 1 + 3 242 23 235 diff --git a/tools/cooja/contiki_tests/rime_abc.info b/tools/cooja/contiki_tests/rime_abc.info index 2e103276c..c247336d2 100644 --- a/tools/cooja/contiki_tests/rime_abc.info +++ b/tools/cooja/contiki_tests/rime_abc.info @@ -1 +1 @@ -Rime anonymous broadcast (test-abc.c). Two Sky nodes. +Two Sky nodes running Rime anonymous broadcast (examples/rime/example-abc.c). Test finishes when both nodes have received more than 30 messages each. diff --git a/tools/cooja/contiki_tests/rime_abc.js b/tools/cooja/contiki_tests/rime_abc.js index 8e7d7405b..cddc84d25 100644 --- a/tools/cooja/contiki_tests/rime_abc.js +++ b/tools/cooja/contiki_tests/rime_abc.js @@ -3,9 +3,14 @@ if (!msg.contains('received')) { return; } -/* Remember receiver */ -global.put("recv_" + id, "ok"); -log.log(id + " received a message\n"); +/* Count received packets */ +result = global.get("recv_" + id); +if (result == null) { + result = 0; +} +result++; +global.put("recv_" + id, result); +log.log(id + " received " + result + " messages\n"); /* Did all nodes (1 and 2) receive a message? */ for (i = 1; i <= 2; i++) { @@ -13,7 +18,11 @@ for (i = 1; i <= 2; i++) { if (result == null) { return; } + if (result < 30) { + return; + } } -log.log("TEST OK\n"); /* Report test success */ -mote.getSimulation().getGUI().doQuit(false); /* Quit simulator (to end test run)*/ +log.log("Node 1 received " + global.get("recv_1") + " messages\n"); +log.log("Node 2 received " + global.get("recv_2") + " messages\n"); +log.testOK(); /* Report test success */