Merge pull request #1062 from simonduq/travis-rpl-fix-logs

Fix log messages of Travis tests in 12-rpl
This commit is contained in:
Nicolas Tsiftes 2015-07-03 15:13:01 +02:00
commit 8b2af09ee1
12 changed files with 31 additions and 25 deletions

View file

@ -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++) {

View file

@ -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++) {

View file

@ -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++) {

View file

@ -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++) {

View file

@ -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++) {

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;

@ -310,7 +315,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 +326,8 @@ while(true) {
// log.log("Num " + num + "\n");
if(lastMsg != -1) {
if(num != lastMsg + 1) {
numMissed = num - lastMsg;
lastMissed = num;
numMissed = num - lastMsg - 1;
lostMsgs += numMissed;
log.log("Missed messages " + numMissed + " before " + num + "\n"); 
for(i = 0; i < numMissed; i++) {

View file

@ -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++) {

View file

@ -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++) {

View file

@ -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++) {

View file

@ -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++) {

View file

@ -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++) {

View file

@ -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++) {