From 043f6a39c1477bd5ac9336bd01b26e9db2840752 Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Sun, 10 May 2015 13:46:53 +0200 Subject: [PATCH 1/2] Fix log messages of Travis tests in 12-rpl --- regression-tests/12-rpl/01-rpl-up-route.csc | 4 ++-- regression-tests/12-rpl/02-rpl-root-reboot.csc | 4 ++-- regression-tests/12-rpl/03-rpl-28-hours.csc | 4 ++-- regression-tests/12-rpl/04-rpl-large-network.csc | 4 ++-- regression-tests/12-rpl/05-rpl-up-and-down-routes.csc | 4 ++-- regression-tests/12-rpl/06-rpl-temporary-root-loss.csc | 4 ++-- regression-tests/12-rpl/08-rpl-dao-route-loss-0.csc | 4 ++-- regression-tests/12-rpl/08-rpl-dao-route-loss-1.csc | 4 ++-- regression-tests/12-rpl/08-rpl-dao-route-loss-2.csc | 4 ++-- regression-tests/12-rpl/08-rpl-dao-route-loss-3.csc | 4 ++-- regression-tests/12-rpl/08-rpl-dao-route-loss-4.csc | 4 ++-- regression-tests/12-rpl/08-rpl-dao-route-loss-5.csc | 4 ++-- 12 files changed, 24 insertions(+), 24 deletions(-) diff --git a/regression-tests/12-rpl/01-rpl-up-route.csc b/regression-tests/12-rpl/01-rpl-up-route.csc index 7c515b24b..bcefd4128 100644 --- a/regression-tests/12-rpl/01-rpl-up-route.csc +++ b/regression-tests/12-rpl/01-rpl-up-route.csc @@ -312,7 +312,7 @@ while(true) { } } else if(msg.startsWith("Sending")) { hops = 0; - } else if(msg.startsWith("#L")) { + } else if(msg.startsWith("#L") && msg.endsWith("1; red")) { hops++; } else if(msg.startsWith("Data")) { // log.log("" + msg + "\n"); @@ -323,7 +323,7 @@ while(true) { // log.log("Num " + num + "\n"); if(lastMsg != -1) { if(num != lastMsg + 1) { - numMissed = num - lastMsg; + numMissed = num - lastMsg - 1; lostMsgs += numMissed; log.log("Missed messages " + numMissed + " before " + num + "\n"); for(i = 0; i < numMissed; i++) { diff --git a/regression-tests/12-rpl/02-rpl-root-reboot.csc b/regression-tests/12-rpl/02-rpl-root-reboot.csc index eda75d60b..2ab456726 100644 --- a/regression-tests/12-rpl/02-rpl-root-reboot.csc +++ b/regression-tests/12-rpl/02-rpl-root-reboot.csc @@ -312,7 +312,7 @@ while(true) { } } else if(msg.startsWith("Sending")) { hops = 0; - } else if(msg.startsWith("#L")) { + } else if(msg.startsWith("#L") && msg.endsWith("1; red")) { hops++; } else if(msg.startsWith("Data")) { // log.log("" + msg + "\n"); @@ -323,7 +323,7 @@ while(true) { // log.log("Num " + num + "\n"); if(lastMsg != -1) { if(num != lastMsg + 1) { - numMissed = num - lastMsg; + numMissed = num - lastMsg - 1; lostMsgs += numMissed; log.log("Missed messages " + numMissed + " before " + num + "\n"); for(i = 0; i < numMissed; i++) { diff --git a/regression-tests/12-rpl/03-rpl-28-hours.csc b/regression-tests/12-rpl/03-rpl-28-hours.csc index d107f13b4..383b636fa 100644 --- a/regression-tests/12-rpl/03-rpl-28-hours.csc +++ b/regression-tests/12-rpl/03-rpl-28-hours.csc @@ -261,7 +261,7 @@ while(true) { } } else if(msg.startsWith("Sending")) { hops = 0; - } else if(msg.startsWith("#L")) { + } else if(msg.startsWith("#L") && msg.endsWith("1; red")) { hops++; } else if(msg.startsWith("Data")) { // log.log("" + msg + "\n"); @@ -272,7 +272,7 @@ while(true) { // log.log("Num " + num + "\n"); if(lastMsg != -1) { if(num != lastMsg + 1) { - numMissed = num - lastMsg; + numMissed = num - lastMsg - 1; lostMsgs += numMissed; log.log("Missed messages " + numMissed + " before " + num + "\n"); for(i = 0; i < numMissed; i++) { diff --git a/regression-tests/12-rpl/04-rpl-large-network.csc b/regression-tests/12-rpl/04-rpl-large-network.csc index 50b1cfad4..30944240a 100644 --- a/regression-tests/12-rpl/04-rpl-large-network.csc +++ b/regression-tests/12-rpl/04-rpl-large-network.csc @@ -7027,7 +7027,7 @@ while(true) { } } else if(msg.startsWith("Sending")) { hops = 0; - } else if(msg.startsWith("#L")) { + } else if(msg.startsWith("#L") && msg.endsWith("1; red")) { hops++; } else if(msg.startsWith("Data")) { // log.log("" + msg + "\n"); @@ -7038,7 +7038,7 @@ while(true) { // log.log("Num " + num + "\n"); if(lastMsg != -1) { if(num != lastMsg + 1) { - numMissed = num - lastMsg; + numMissed = num - lastMsg - 1; lostMsgs += numMissed; log.log("Missed messages " + numMissed + " before " + num + "\n"); for(i = 0; i < numMissed; i++) { diff --git a/regression-tests/12-rpl/05-rpl-up-and-down-routes.csc b/regression-tests/12-rpl/05-rpl-up-and-down-routes.csc index 7191e79ad..ba409e4fb 100644 --- a/regression-tests/12-rpl/05-rpl-up-and-down-routes.csc +++ b/regression-tests/12-rpl/05-rpl-up-and-down-routes.csc @@ -310,7 +310,7 @@ while(true) { } } else if(msg.startsWith("Sending")) { hops = 0; - } else if(msg.startsWith("#L")) { + } else if(msg.startsWith("#L") && msg.endsWith("1; red")) { hops++; } else if(msg.startsWith("Data")) { // log.log("" + msg + "\n"); @@ -321,7 +321,7 @@ while(true) { // log.log("Num " + num + "\n"); if(lastMsg != -1) { if(num != lastMsg + 1) { - numMissed = num - lastMsg; + numMissed = num - lastMsg - 1; lostMsgs += numMissed; log.log("Missed messages " + numMissed + " before " + num + "\n"); for(i = 0; i < numMissed; i++) { 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 f4c132c4d..297ef0646 100644 --- a/regression-tests/12-rpl/06-rpl-temporary-root-loss.csc +++ b/regression-tests/12-rpl/06-rpl-temporary-root-loss.csc @@ -310,7 +310,7 @@ while(true) { } } else if(msg.startsWith("Sending")) { hops = 0; - } else if(msg.startsWith("#L")) { + } else if(msg.startsWith("#L") && msg.endsWith("1; red")) { hops++; } else if(msg.startsWith("Data")) { // log.log("" + msg + "\n"); @@ -321,7 +321,7 @@ while(true) { // log.log("Num " + num + "\n"); if(lastMsg != -1) { if(num != lastMsg + 1) { - numMissed = num - lastMsg; + numMissed = num - lastMsg - 1; lostMsgs += numMissed; log.log("Missed messages " + numMissed + " before " + num + "\n"); for(i = 0; i < numMissed; i++) { diff --git a/regression-tests/12-rpl/08-rpl-dao-route-loss-0.csc b/regression-tests/12-rpl/08-rpl-dao-route-loss-0.csc index 7f63864a2..66e890394 100644 --- a/regression-tests/12-rpl/08-rpl-dao-route-loss-0.csc +++ b/regression-tests/12-rpl/08-rpl-dao-route-loss-0.csc @@ -327,7 +327,7 @@ while(true) { node8.getInterfaces().getPosition().setCoordinates(58, 108, 0); } else if(msg.startsWith("Sending")) { hops = 0; - } else if(msg.startsWith("#L")) { + } else if(msg.startsWith("#L") && msg.endsWith("1; red")) { hops++; } else if(msg.startsWith("Data")) { // log.log("" + msg + "\n"); @@ -339,7 +339,7 @@ while(true) { // log.log("Num " + num + "\n"); if(lastMsg != -1) { if(num != lastMsg + 1) { - numMissed = num - lastMsg; + numMissed = num - lastMsg - 1; lostMsgs += numMissed; log.log("Missed messages " + numMissed + " before " + num + "\n"); for(i = 0; i < numMissed; i++) { diff --git a/regression-tests/12-rpl/08-rpl-dao-route-loss-1.csc b/regression-tests/12-rpl/08-rpl-dao-route-loss-1.csc index 9468dd53e..57b426ab2 100644 --- a/regression-tests/12-rpl/08-rpl-dao-route-loss-1.csc +++ b/regression-tests/12-rpl/08-rpl-dao-route-loss-1.csc @@ -327,7 +327,7 @@ while(true) { node8.getInterfaces().getPosition().setCoordinates(58, 108, 0); } else if(msg.startsWith("Sending")) { hops = 0; - } else if(msg.startsWith("#L")) { + } else if(msg.startsWith("#L") && msg.endsWith("1; red")) { hops++; } else if(msg.startsWith("Data")) { // log.log("" + msg + "\n"); @@ -339,7 +339,7 @@ while(true) { // log.log("Num " + num + "\n"); if(lastMsg != -1) { if(num != lastMsg + 1) { - numMissed = num - lastMsg; + numMissed = num - lastMsg - 1; lostMsgs += numMissed; log.log("Missed messages " + numMissed + " before " + num + "\n"); for(i = 0; i < numMissed; i++) { diff --git a/regression-tests/12-rpl/08-rpl-dao-route-loss-2.csc b/regression-tests/12-rpl/08-rpl-dao-route-loss-2.csc index 130eef941..2f42e92ea 100644 --- a/regression-tests/12-rpl/08-rpl-dao-route-loss-2.csc +++ b/regression-tests/12-rpl/08-rpl-dao-route-loss-2.csc @@ -327,7 +327,7 @@ while(true) { node8.getInterfaces().getPosition().setCoordinates(58, 108, 0); } else if(msg.startsWith("Sending")) { hops = 0; - } else if(msg.startsWith("#L")) { + } else if(msg.startsWith("#L") && msg.endsWith("1; red")) { hops++; } else if(msg.startsWith("Data")) { // log.log("" + msg + "\n"); @@ -339,7 +339,7 @@ while(true) { // log.log("Num " + num + "\n"); if(lastMsg != -1) { if(num != lastMsg + 1) { - numMissed = num - lastMsg; + numMissed = num - lastMsg - 1; lostMsgs += numMissed; log.log("Missed messages " + numMissed + " before " + num + "\n"); for(i = 0; i < numMissed; i++) { diff --git a/regression-tests/12-rpl/08-rpl-dao-route-loss-3.csc b/regression-tests/12-rpl/08-rpl-dao-route-loss-3.csc index d67d25f01..63fb1e042 100644 --- a/regression-tests/12-rpl/08-rpl-dao-route-loss-3.csc +++ b/regression-tests/12-rpl/08-rpl-dao-route-loss-3.csc @@ -327,7 +327,7 @@ while(true) { node8.getInterfaces().getPosition().setCoordinates(58, 108, 0); } else if(msg.startsWith("Sending")) { hops = 0; - } else if(msg.startsWith("#L")) { + } else if(msg.startsWith("#L") && msg.endsWith("1; red")) { hops++; } else if(msg.startsWith("Data")) { // log.log("" + msg + "\n"); @@ -339,7 +339,7 @@ while(true) { // log.log("Num " + num + "\n"); if(lastMsg != -1) { if(num != lastMsg + 1) { - numMissed = num - lastMsg; + numMissed = num - lastMsg - 1; lostMsgs += numMissed; log.log("Missed messages " + numMissed + " before " + num + "\n"); for(i = 0; i < numMissed; i++) { diff --git a/regression-tests/12-rpl/08-rpl-dao-route-loss-4.csc b/regression-tests/12-rpl/08-rpl-dao-route-loss-4.csc index bef4be8b8..8b33f560a 100644 --- a/regression-tests/12-rpl/08-rpl-dao-route-loss-4.csc +++ b/regression-tests/12-rpl/08-rpl-dao-route-loss-4.csc @@ -327,7 +327,7 @@ while(true) { node8.getInterfaces().getPosition().setCoordinates(58, 108, 0); } else if(msg.startsWith("Sending")) { hops = 0; - } else if(msg.startsWith("#L")) { + } else if(msg.startsWith("#L") && msg.endsWith("1; red")) { hops++; } else if(msg.startsWith("Data")) { // log.log("" + msg + "\n"); @@ -339,7 +339,7 @@ while(true) { // log.log("Num " + num + "\n"); if(lastMsg != -1) { if(num != lastMsg + 1) { - numMissed = num - lastMsg; + numMissed = num - lastMsg - 1; lostMsgs += numMissed; log.log("Missed messages " + numMissed + " before " + num + "\n"); for(i = 0; i < numMissed; i++) { diff --git a/regression-tests/12-rpl/08-rpl-dao-route-loss-5.csc b/regression-tests/12-rpl/08-rpl-dao-route-loss-5.csc index c2623f780..56925381b 100644 --- a/regression-tests/12-rpl/08-rpl-dao-route-loss-5.csc +++ b/regression-tests/12-rpl/08-rpl-dao-route-loss-5.csc @@ -327,7 +327,7 @@ while(true) { node8.getInterfaces().getPosition().setCoordinates(58, 108, 0); } else if(msg.startsWith("Sending")) { hops = 0; - } else if(msg.startsWith("#L")) { + } else if(msg.startsWith("#L") && msg.endsWith("1; red")) { hops++; } else if(msg.startsWith("Data")) { // log.log("" + msg + "\n"); @@ -339,7 +339,7 @@ while(true) { // log.log("Num " + num + "\n"); if(lastMsg != -1) { if(num != lastMsg + 1) { - numMissed = num - lastMsg; + numMissed = num - lastMsg - 1; lostMsgs += numMissed; log.log("Missed messages " + numMissed + " before " + num + "\n"); for(i = 0; i < numMissed; i++) { From 700c22490c82899d80b3eb912004c7295d7dd021 Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Sun, 10 May 2015 23:11:31 +0200 Subject: [PATCH 2/2] 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");