test update: delay a few seconds before pinging the node

This commit is contained in:
fros4943 2009-05-18 08:03:40 +00:00
parent 2b1053f0e3
commit fa4a22412a

View File

@ -5,16 +5,24 @@ nrReplies = 0;
ipAddress = "172.16.1.0"; ipAddress = "172.16.1.0";
osName = java.lang.System.getProperty("os.name").toLowerCase(); osName = java.lang.System.getProperty("os.name").toLowerCase();
if (osName.startsWith("win")) { if (osName.startsWith("win")) {
pingOnceCmd = "ping -n 1 " + ipAddress;
pingCmd = "ping -n 10 " + ipAddress; pingCmd = "ping -n 10 " + ipAddress;
} else { } else {
pingOnceCmd = "ping -c 1 " + ipAddress;
pingCmd = "ping -c 10 " + ipAddress; pingCmd = "ping -c 10 " + ipAddress;
} }
replyMsg = "from " + ipAddress; replyMsg = "from " + ipAddress;
/* mote startup */ /* wait for mote startup */
WAIT_UNTIL(msg.contains('Sky telnet process')); WAIT_UNTIL(msg.contains('Sky telnet process'));
/* override simulation delay, test times out is too fast otherwise */ /* make gateway */
pingOnceProcess = new java.lang.Runtime.getRuntime().exec(pingOnceCmd);
GENERATE_MSG(5000, "continue");
WAIT_UNTIL(msg.equals("continue"));
log.log("cont\n");
/* override simulation delay, test will time out is too fast otherwise */
mote.getSimulation().setDelayTime(1); mote.getSimulation().setDelayTime(1);
/* start ping process */ /* start ping process */