From 87ebab71137491d93a9181100f01d684ae3e4a6e Mon Sep 17 00:00:00 2001 From: fros4943 Date: Wed, 3 Dec 2008 14:19:41 +0000 Subject: [PATCH] modified test to fail if any single node successfully delivers 20 sensor data packets, before all other nodes has delivered 5 packets --- tools/cooja/contiki_tests/sky_collect.csc | 57 +++++++++++++--------- tools/cooja/contiki_tests/sky_collect.info | 2 +- tools/cooja/contiki_tests/sky_collect.js | 20 +++++++- 3 files changed, 53 insertions(+), 26 deletions(-) diff --git a/tools/cooja/contiki_tests/sky_collect.csc b/tools/cooja/contiki_tests/sky_collect.csc index 792e11b80..6e9da839a 100644 --- a/tools/cooja/contiki_tests/sky_collect.csc +++ b/tools/cooja/contiki_tests/sky_collect.csc @@ -8,10 +8,10 @@ 10000 se.sics.cooja.radiomediums.UDGM - 50.0 - 100.0 - 1.0 - 1.0 + 30.0 + 40.0 + 0.9 + 0.9 se.sics.cooja.mspmote.SkyMoteType @@ -25,8 +25,8 @@ sky1 se.sics.cooja.interfaces.Position - 29.17421996892351 - 104.77909205535983 + 9.333811152651393 + 89.28114548870677 0.0 @@ -39,8 +39,8 @@ sky1 se.sics.cooja.interfaces.Position - 59.38068944364397 - 97.64274390719908 + 33.040227185226826 + 54.184283361563054 0.0 @@ -53,8 +53,8 @@ sky1 se.sics.cooja.interfaces.Position - 4.709236350803614 - 36.140965282433676 + -2.2559922410521516 + 50.71648775308175 0.0 @@ -81,8 +81,8 @@ sky1 se.sics.cooja.interfaces.Position - 4.405437081821395 - 74.51872257012788 + 15.917348901177405 + 66.93526904376517 0.0 @@ -95,8 +95,8 @@ sky1 se.sics.cooja.interfaces.Position - 20.032542580805657 - 38.81348491507741 + 26.735174243053933 + 35.939375910459084 0.0 @@ -109,8 +109,8 @@ sky1 se.sics.cooja.interfaces.Position - 44.10978600980437 - 49.73908473744734 + 41.5254792748469 + 28.370611308140152 0.0 @@ -122,7 +122,7 @@ se.sics.cooja.plugins.SimControl 265 - 1 + 2 200 0 0 @@ -135,19 +135,28 @@ 256 1168 - 3 - 209 - 0 - 621 + 4 + 240 + -1 + 618 false se.sics.cooja.radiomediums.UDGM$VisUDGM 300 - 2 + 1 300 - 864 - 0 + 31 + 287 + false + + + se.sics.cooja.plugins.RadioLogger + 424 + 3 + 595 + 988 + 13 false diff --git a/tools/cooja/contiki_tests/sky_collect.info b/tools/cooja/contiki_tests/sky_collect.info index d3d9c553a..3b1eb04eb 100644 --- a/tools/cooja/contiki_tests/sky_collect.info +++ b/tools/cooja/contiki_tests/sky_collect.info @@ -1 +1 @@ -Sky-collect running on 7 Sky nodes. Test waits until sensor data has been received from every node at least 5 times. +Sky-collect running on 7 Sky nodes. Test waits until sensor data has been received from every node at least 5 times. If any node successfully transmits 20 packets to the sink, the test fails. diff --git a/tools/cooja/contiki_tests/sky_collect.js b/tools/cooja/contiki_tests/sky_collect.js index 1a303ea4e..bb669c711 100644 --- a/tools/cooja/contiki_tests/sky_collect.js +++ b/tools/cooja/contiki_tests/sky_collect.js @@ -30,6 +30,24 @@ if (count == null) { count++; global.put("count_" + source, count); +/* Fail if any node has transmitted more than 20 packets */ +for (i = 1; i <= 7; i++) { + result = global.get("count_" + i); + if (result > 20) { + + log.log("FAILED: received/node: " + + global.get("count_1") + " " + + global.get("count_2") + " " + + global.get("count_3") + " " + + global.get("count_4") + " " + + global.get("count_5") + " " + + global.get("count_6") + " " + + global.get("count_7") + "\n"); + log.testFailed(); /* We are done! */ + return; + } +} + /* Wait until we have received data from all nodes */ for (i = 1; i <= 7; i++) { result = global.get("count_" + i); @@ -39,4 +57,4 @@ for (i = 1; i <= 7; i++) { } } -log.testOK(); /* We are done! */ \ No newline at end of file +log.testOK(); /* We are done! */