Skip to content

Commit

Permalink
Travis: The test criteria for this test was too strict --- one or two
Browse files Browse the repository at this point in the history
packets get lost. Change the test to ensure that data comes back from
every node and we get at least 75 non-duplicate reports.
  • Loading branch information
malvira committed May 18, 2013
1 parent d396832 commit 585dd3f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions regression-tests/11-ipv6/04-sky-ipv6-rpl-collect.csc
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ print()
for(i = 1; i <= nrNodes; i++) {
log.log("Node " + i + " ");
if(i == sink) {
log.log("sink\n");
log.log("sink. Got " + total + " non-dups from " + num_reported + " nodes.\n");
} else {
log.log("received: " + received[i] + " hops: " + hops[i] + "\n");
}
Expand All @@ -517,12 +517,15 @@ booted = new Array();
received = new Array();
hops = new Array();
nrNodes = 25;
total = 0; /* number of non-dups the sink received */
reported = new Array(); /* nodes that have reported at least once */

nodes_starting = true;
for(i = 1; i <= nrNodes; i++) {
booted[i] = false;
received[i] = "_____";
hops[i] = received[i];
reported[i] = 0;
}

/* Wait until all nodes have started */
Expand Down Expand Up @@ -579,9 +582,11 @@ while(true) {
source = node_id & 0xff;
seqno = seqno - 1;
dups = received[source].substr(seqno, 1);
reported[source]++;

if(dups == "_") {
dups = 1;
total++;
} else if(dups < 9) {
dups++;
}
Expand All @@ -598,12 +603,12 @@ while(true) {
/* Signal OK if all nodes have reported 10 messages. */
num_reported = 0;
for(i = 1; i <= nrNodes; i++) {
if(!isNaN(received[i])) {
if(reported[i] > 0) {
num_reported++;
}
}

if(num_reported == nrNodes - 1) {
if((num_reported == nrNodes - 1) && (total >= 75)) {
print();
log.testOK();
}
Expand Down

0 comments on commit 585dd3f

Please sign in to comment.