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:
Simon Duquennoy 2015-05-10 23:11:31 +02:00
parent 043f6a39c1
commit 700c22490c

View File

@ -287,9 +287,14 @@ GENERATE_MSG(2000000, "add-sink");

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;
lastMissed = -1;
packets = "_________";
hops = 0;

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