From 700c22490c82899d80b3eb912004c7295d7dd021 Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Sun, 10 May 2015 23:11:31 +0200 Subject: [PATCH] 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 --- regression-tests/12-rpl/06-rpl-temporary-root-loss.csc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/regression-tests/12-rpl/06-rpl-temporary-root-loss.csc b/regression-tests/12-rpl/06-rpl-temporary-root-loss.csc index 297ef0646..6884c9fc5 100644 --- a/regression-tests/12-rpl/06-rpl-temporary-root-loss.csc +++ b/regression-tests/12-rpl/06-rpl-temporary-root-loss.csc @@ -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");