updated test: shell command echo no longer includes a newline -> updated expected final file size, improved debugging output

This commit is contained in:
Fredrik Osterlind 2012-05-29 13:50:36 +02:00
parent f8e0da428a
commit b27c92af12

View file

@ -1,11 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<simconf> <simconf>
<project>[CONTIKI_DIR]/tools/cooja/apps/mrm</project>
<project>[CONTIKI_DIR]/tools/cooja/apps/mspsim</project>
<project>[CONTIKI_DIR]/tools/cooja/apps/avrora</project>
<simulation> <simulation>
<title>My simulation</title> <title>My simulation</title>
<delaytime>0</delaytime> <delaytime>-2147483648</delaytime>
<randomseed>generated</randomseed> <randomseed>generated</randomseed>
<motedelay_us>1000000</motedelay_us> <motedelay_us>1000000</motedelay_us>
<radiomedium> <radiomedium>
@ -21,24 +18,27 @@
<motetype> <motetype>
se.sics.cooja.mspmote.SkyMoteType se.sics.cooja.mspmote.SkyMoteType
<identifier>sky1</identifier> <identifier>sky1</identifier>
<description>Sky Mote Type #sky1</description> <description>Contiki shell with download command</description>
<source>[CONTIKI_DIR]/examples/sky-shell/sky-checkpoint.c</source> <source EXPORT="discard">[CONTIKI_DIR]/examples/sky-shell/sky-checkpoint.c</source>
<commands>make clean TARGET=sky <commands EXPORT="discard">make sky-checkpoint.sky TARGET=sky</commands>
make sky-checkpoint.sky TARGET=sky</commands> <firmware EXPORT="copy">[CONTIKI_DIR]/examples/sky-shell/sky-checkpoint.sky</firmware>
<firmware>[CONTIKI_DIR]/examples/sky-shell/sky-checkpoint.sky</firmware>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface> <moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.interfaces.RimeAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface> <moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface> <moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>se.sics.cooja.interfaces.MoteAttributes</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspMoteID</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.MspMoteID</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyButton</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.SkyButton</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyFlash</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.SkyFlash</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyCoffeeFilesystem</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyByteRadio</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.SkyByteRadio</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspSerial</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.MspSerial</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyLED</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.SkyLED</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspDebugOutput</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyTemperature</moteinterface>
</motetype> </motetype>
<mote> <mote>
se.sics.cooja.mspmote.SkyMote
<breakpoints /> <breakpoints />
<interface_config> <interface_config>
se.sics.cooja.interfaces.Position se.sics.cooja.interfaces.Position
@ -50,10 +50,13 @@ make sky-checkpoint.sky TARGET=sky</commands>
se.sics.cooja.mspmote.interfaces.MspMoteID se.sics.cooja.mspmote.interfaces.MspMoteID
<id>1</id> <id>1</id>
</interface_config> </interface_config>
<interface_config>
se.sics.cooja.mspmote.interfaces.MspSerial
<history>l~;asd~;~K~;download 2.0 file25.txt | write file26.txt | null~;ls~;~K~;download 2.0 file25.txt | write file26.txt | null~;~K~;download 2.0 file25.txt | write file26.txt~;~K~;download 2.0 file25.txt | write file26.txt~;~K~;read file26.txt~;download 2.0 file25.txt | write file26.txt~;~K~;download 2.0 file25.txt | write file26.txt~;~K~;download 2.0 file25.txt | write file26.txt~;a~;~K~;download 2.0 file25.txt | write file26.txt~;~K~;download 2.0 file23.txt | write file26.txt~;download 2.0 file25.txt | write file26.txt~;~K~;download 2.0 file25.txt | write file26.txt~;download 2.0 file25.txt~;download 2.0 file27.txt~;ls~;read file30.txt~;read file30.txt 0 13~;read file30.txt 0 12~;</history>
</interface_config>
<motetype_identifier>sky1</motetype_identifier> <motetype_identifier>sky1</motetype_identifier>
</mote> </mote>
<mote> <mote>
se.sics.cooja.mspmote.SkyMote
<breakpoints /> <breakpoints />
<interface_config> <interface_config>
se.sics.cooja.interfaces.Position se.sics.cooja.interfaces.Position
@ -65,17 +68,20 @@ make sky-checkpoint.sky TARGET=sky</commands>
se.sics.cooja.mspmote.interfaces.MspMoteID se.sics.cooja.mspmote.interfaces.MspMoteID
<id>2</id> <id>2</id>
</interface_config> </interface_config>
<interface_config>
se.sics.cooja.mspmote.interfaces.MspSerial
<history>ls~;read file25.txt~;</history>
</interface_config>
<motetype_identifier>sky1</motetype_identifier> <motetype_identifier>sky1</motetype_identifier>
</mote> </mote>
</simulation> </simulation>
<plugin> <plugin>
se.sics.cooja.plugins.SimControl se.sics.cooja.plugins.SimControl
<width>268</width> <width>268</width>
<z>5</z> <z>2</z>
<height>201</height> <height>201</height>
<location_x>0</location_x> <location_x>0</location_x>
<location_y>1</location_y> <location_y>1</location_y>
<minimized>false</minimized>
</plugin> </plugin>
<plugin> <plugin>
se.sics.cooja.plugins.MoteInterfaceViewer se.sics.cooja.plugins.MoteInterfaceViewer
@ -85,11 +91,10 @@ make sky-checkpoint.sky TARGET=sky</commands>
<scrollpos>0,0</scrollpos> <scrollpos>0,0</scrollpos>
</plugin_config> </plugin_config>
<width>378</width> <width>378</width>
<z>2</z> <z>1</z>
<height>485</height> <height>361</height>
<location_x>2</location_x> <location_x>2</location_x>
<location_y>201</location_y> <location_y>201</location_y>
<minimized>false</minimized>
</plugin> </plugin>
<plugin> <plugin>
se.sics.cooja.plugins.MoteInterfaceViewer se.sics.cooja.plugins.MoteInterfaceViewer
@ -100,10 +105,9 @@ make sky-checkpoint.sky TARGET=sky</commands>
</plugin_config> </plugin_config>
<width>395</width> <width>395</width>
<z>3</z> <z>3</z>
<height>486</height> <height>361</height>
<location_x>379</location_x> <location_x>379</location_x>
<location_y>201</location_y> <location_y>201</location_y>
<minimized>false</minimized>
</plugin> </plugin>
<plugin> <plugin>
se.sics.cooja.plugins.Visualizer se.sics.cooja.plugins.Visualizer
@ -113,37 +117,30 @@ make sky-checkpoint.sky TARGET=sky</commands>
<skin>se.sics.cooja.plugins.skins.TrafficVisualizerSkin</skin> <skin>se.sics.cooja.plugins.skins.TrafficVisualizerSkin</skin>
<skin>se.sics.cooja.plugins.skins.AddressVisualizerSkin</skin> <skin>se.sics.cooja.plugins.skins.AddressVisualizerSkin</skin>
<skin>se.sics.cooja.plugins.skins.LogVisualizerSkin</skin> <skin>se.sics.cooja.plugins.skins.LogVisualizerSkin</skin>
<viewport>10.082791180977951 0.0 0.0 10.082791180977951 266.248788516359 -780.5960558101059</viewport> <skin>se.sics.cooja.plugins.skins.LEDVisualizerSkin</skin>
<skin>se.sics.cooja.plugins.skins.GridVisualizerSkin</skin>
<viewport>3.7763262850104686 0.0 0.0 3.7763262850104686 110.98456498740039 -253.59028307494597</viewport>
</plugin_config> </plugin_config>
<width>505</width> <width>221</width>
<z>1</z> <z>7</z>
<height>200</height> <height>200</height>
<location_x>269</location_x> <location_x>269</location_x>
<location_y>1</location_y> <location_y>1</location_y>
<minimized>false</minimized>
</plugin> </plugin>
<plugin> <plugin>
se.sics.cooja.plugins.ScriptRunner se.sics.cooja.plugins.ScriptRunner
<plugin_config> <plugin_config>
<script>TIMEOUT(150000, log.log("last msg: " + msg + "\n")); <script>TIMEOUT(250000, log.log("last msg: " + msg + "\n"));
/* Wait for nodes to boot */ /* Wait for nodes to boot */
mote1 = null; GENERATE_MSG(5000, "continue");
mote2 = null;
while (mote1 == null || mote2 == null) {
if (id == 1) {
mote1 = mote;
}
if (id == 2) {
mote2 = mote;
}
YIELD();
}
GENERATE_MSG(2000, "continue");
YIELD_THEN_WAIT_UNTIL(msg.equals("continue")); YIELD_THEN_WAIT_UNTIL(msg.equals("continue"));
mote1 = sim.getMoteWithID(1);
mote2 = sim.getMoteWithID(2);
/* Generate initial file */ /* Generate initial file */
fileID = 10; fileID = 10;
log.log("Generating initial file at mote 1\n");
command = "echo *mote1data" + fileID + " | write file" + fileID + ".txt"; command = "echo *mote1data" + fileID + " | write file" + fileID + ".txt";
log.log("mote1&gt; " + command + "\n"); log.log("mote1&gt; " + command + "\n");
write(mote1, command); write(mote1, command);
@ -151,39 +148,86 @@ YIELD_THEN_WAIT_UNTIL(id == 1 &amp;&amp; msg.contains("Contiki&gt;"));
/* Download and append files */ /* Download and append files */
while (fileID &lt; 30) { while (fileID &lt; 30) {
/* Mote 1 -&gt; Mote 2 */ /* Mote 1 -&gt; Mote 2: conf */
srcFile = "file" + fileID + ".txt"; srcFile = "file" + fileID + ".txt";
fileID++; fileID++;
dstFile = "file" + fileID + ".txt"; dstFile = "file" + fileID + ".txt";
/* Mote 1 -&gt; Mote 2: download */
log.log("\nDownloading from mote 1 to mote 2\n");
command = "download 1.0 " + srcFile + " | write " + dstFile + " | null"; command = "download 1.0 " + srcFile + " | write " + dstFile + " | null";
log.log("mote2&gt; " + command + "\n"); log.log("mote2&gt; " + command + "\n");
write(mote2, command); write(mote2, command);
YIELD_THEN_WAIT_UNTIL(id == 2 &amp;&amp; msg.contains("Contiki&gt;")); YIELD_THEN_WAIT_UNTIL(id == 2 &amp;&amp; msg.contains("Contiki&gt;"));
/* Mote 1 -&gt; Mote 2: echo download */
command = "echo downloaded " + srcFile + "@1.0 -&gt; " + dstFile;
log.log("mote2&gt; " + command + "\n");
write(mote2, command);
YIELD_THEN_WAIT_UNTIL(id == 2 &amp;&amp; msg.contains("Contiki&gt;"));
/* Mote 2: append */
log.log("Appending to file at mote 2\n");
command = "echo *mote2data" + fileID + " | append " + dstFile + " | null"; command = "echo *mote2data" + fileID + " | append " + dstFile + " | null";
log.log("mote2&gt; " + command + "\n"); log.log("mote2&gt; " + command + "\n");
write(mote2, command); write(mote2, command);
YIELD_THEN_WAIT_UNTIL(id == 2 &amp;&amp; msg.contains("Contiki&gt;")); YIELD_THEN_WAIT_UNTIL(id == 2 &amp;&amp; msg.contains("Contiki&gt;"));
/* Mote 2 -&gt; Mote 1 */ /* Mote 2: echo append */
command = "echo appended to " + dstFile;
log.log("mote2&gt; " + command + "\n");
write(mote2, command);
YIELD_THEN_WAIT_UNTIL(id == 2 &amp;&amp; msg.contains("Contiki&gt;"));
/* Delay */
GENERATE_MSG(5000, "continue");
YIELD_THEN_WAIT_UNTIL(msg.equals("continue"));
/* Mote 2 -&gt; Mote 1: conf */
srcFile = "file" + fileID + ".txt"; srcFile = "file" + fileID + ".txt";
fileID++; fileID++;
dstFile = "file" + fileID + ".txt"; dstFile = "file" + fileID + ".txt";
/* Mote 2 -&gt; Mote 1: download */
log.log("\nDownloading from mote 2 to mote 1\n");
command = "download 2.0 " + srcFile + " | write " + dstFile + " | null"; command = "download 2.0 " + srcFile + " | write " + dstFile + " | null";
log.log("mote1&gt; " + command + "\n"); log.log("mote1&gt; " + command + "\n");
write(mote1, command); write(mote1, command);
YIELD_THEN_WAIT_UNTIL(id == 1 &amp;&amp; msg.contains("Contiki&gt;")); YIELD_THEN_WAIT_UNTIL(id == 1 &amp;&amp; msg.contains("Contiki&gt;"));
/* Mote 2 -&gt; Mote 1: echo download */
command = "echo downloaded " + srcFile + "@2.0 -&gt; " + dstFile;
log.log("mote1&gt; " + command + "\n");
write(mote1, command);
YIELD_THEN_WAIT_UNTIL(id == 1 &amp;&amp; msg.contains("Contiki&gt;"));
/* Mote 1: append */
log.log("Appending to file at mote 1\n");
command = "echo *mote1data" + fileID + " | append " + dstFile + " | null"; command = "echo *mote1data" + fileID + " | append " + dstFile + " | null";
log.log("mote1&gt; " + command + "\n"); log.log("mote1&gt; " + command + "\n");
write(mote1, command); write(mote1, command);
YIELD_THEN_WAIT_UNTIL(id == 1 &amp;&amp; msg.contains("Contiki&gt;")); YIELD_THEN_WAIT_UNTIL(id == 1 &amp;&amp; msg.contains("Contiki&gt;"));
/* Mote 1: echo append */
command = "echo appended to " + dstFile;
log.log("mote1&gt; " + command + "\n");
write(mote1, command);
YIELD_THEN_WAIT_UNTIL(id == 1 &amp;&amp; msg.contains("Contiki&gt;"));
/* Delay */
GENERATE_MSG(5000, "continue");
YIELD_THEN_WAIT_UNTIL(msg.equals("continue"));
} }
/* List files, verify contents */ /* List files, verify contents */
log.log("Locating file30.txt on mote 1\n"); log.log("Locating file30.txt on mote 1\n");
write(mote1, "ls"); write(mote1, "ls");
YIELD_THEN_WAIT_UNTIL(id == 1 &amp;&amp; msg.contains("file30.txt")); YIELD_THEN_WAIT_UNTIL(id == 1 &amp;&amp; msg.contains("file30.txt"));
if (!msg.contains("273 ")) { if (!msg.contains("252 ")) {
log.log("Bad file size, should be 273 bytes: " + msg + "\n"); log.log("Bad file size, should be 252 bytes: " + msg + "\n");
log.testFailed(); log.testFailed();
} }
YIELD_THEN_WAIT_UNTIL(id == 1 &amp;&amp; msg.contains("Contiki&gt;")); YIELD_THEN_WAIT_UNTIL(id == 1 &amp;&amp; msg.contains("Contiki&gt;"));
@ -193,7 +237,7 @@ GENERATE_MSG(3000, "continue");
YIELD_THEN_WAIT_UNTIL(msg.equals("continue")); YIELD_THEN_WAIT_UNTIL(msg.equals("continue"));
fileID = 10; fileID = 10;
command = "read file30.txt 0 13"; command = "read file30.txt 0 12";
log.log("mote1&gt; " + command + "\n"); log.log("mote1&gt; " + command + "\n");
write(mote1, command); write(mote1, command);
while (fileID &lt; 30) { while (fileID &lt; 30) {
@ -210,41 +254,46 @@ log.log("Test finished at time: " + mote.getSimulation().getSimulationTime() + "
log.testOK(); /* Report test success and quit */</script> log.testOK(); /* Report test success and quit */</script>
<active>true</active> <active>true</active>
</plugin_config> </plugin_config>
<width>729</width> <width>506</width>
<z>0</z> <z>0</z>
<height>811</height> <height>689</height>
<location_x>774</location_x> <location_x>774</location_x>
<location_y>1</location_y> <location_y>-1</location_y>
<minimized>false</minimized>
</plugin> </plugin>
<plugin> <plugin>
se.sics.cooja.plugins.TimeLine se.sics.cooja.plugins.TimeLine
<plugin_config> <plugin_config>
<mote>0</mote> <mote>0</mote>
<mote>1</mote> <mote>1</mote>
<showRadioRXTX /> <showLEDs />
<showRadioHW />
<split>1</split> <split>1</split>
<zoom>12</zoom> <zoomfactor>22313.016014842982</zoomfactor>
</plugin_config> </plugin_config>
<width>772</width> <width>772</width>
<z>7</z> <z>5</z>
<height>125</height> <height>125</height>
<location_x>2</location_x> <location_x>3</location_x>
<location_y>687</location_y> <location_y>562</location_y>
<minimized>false</minimized>
</plugin> </plugin>
<plugin> <plugin>
se.sics.cooja.plugins.LogListener se.sics.cooja.plugins.LogListener
<plugin_config> <plugin_config>
<filter /> <filter />
<coloring />
</plugin_config> </plugin_config>
<width>1503</width> <width>1279</width>
<z>4</z> <z>4</z>
<height>245</height> <height>287</height>
<location_x>0</location_x> <location_x>1</location_x>
<location_y>812</location_y> <location_y>686</location_y>
<minimized>false</minimized> </plugin>
<plugin>
PowerTracker
<width>287</width>
<z>6</z>
<height>199</height>
<location_x>490</location_x>
<location_y>2</location_y>
</plugin> </plugin>
</simconf> </simconf>