Modified RPL temporary root loss test: now waiting a while after the root is back and checking that all messages after its return are correctly routed
This commit is contained in:
parent
043f6a39c1
commit
700c22490c
|
@ -287,9 +287,14 @@ GENERATE_MSG(2000000, "add-sink");
|
||||||

|

|
||||||
lostMsgs = 0;
|
lostMsgs = 0;
|
||||||

|

|
||||||
TIMEOUT(2000000, if(lostMsgs == 0) { log.testOK(); } );
|
// we check that we got up to at least message 62 and
|
||||||
|
// (the simulation is 4000000ms = 66 minutes long)
|
||||||
|
// that we did not lose anything since 34
|
||||||
|
// (the sink is back at 2000000ms = 33 minutes)
|
||||||
|
TIMEOUT(4000000, if(lastMsg >= 62 && lastMissed <= 34) { log.testOK(); } );
|
||||||

|

|
||||||
lastMsg = -1;
|
lastMsg = -1;
|
||||||
|
lastMissed = -1;
|
||||||
packets = "_________";
|
packets = "_________";
|
||||||
hops = 0;
|
hops = 0;
|
||||||

|

|
||||||
|
@ -321,6 +326,7 @@ while(true) {
|
||||||
// log.log("Num " + num + "\n");
|
// log.log("Num " + num + "\n");
|
||||||
if(lastMsg != -1) {
|
if(lastMsg != -1) {
|
||||||
if(num != lastMsg + 1) {
|
if(num != lastMsg + 1) {
|
||||||
|
lastMissed = num;
|
||||||
numMissed = num - lastMsg - 1;
|
numMissed = num - lastMsg - 1;
|
||||||
lostMsgs += numMissed;
|
lostMsgs += numMissed;
|
||||||
log.log("Missed messages " + numMissed + " before " + num + "\n"); 
|
log.log("Missed messages " + numMissed + " before " + num + "\n"); 
|
||||||
|
|
Loading…
Reference in a new issue