From 57584c7af622e53f91a08e72398f670108e57d7f Mon Sep 17 00:00:00 2001 From: fros4943 Date: Thu, 15 Jan 2009 13:20:18 +0000 Subject: [PATCH] added wget contiki test --- .../contiki_tests/ip_sky_webserver_wget.csc | 138 ++++++++++++++++++ .../contiki_tests/ip_sky_webserver_wget.info | 1 + .../contiki_tests/ip_sky_webserver_wget.js | 32 ++++ 3 files changed, 171 insertions(+) create mode 100644 tools/cooja/contiki_tests/ip_sky_webserver_wget.csc create mode 100644 tools/cooja/contiki_tests/ip_sky_webserver_wget.info create mode 100644 tools/cooja/contiki_tests/ip_sky_webserver_wget.js diff --git a/tools/cooja/contiki_tests/ip_sky_webserver_wget.csc b/tools/cooja/contiki_tests/ip_sky_webserver_wget.csc new file mode 100644 index 000000000..f93823f79 --- /dev/null +++ b/tools/cooja/contiki_tests/ip_sky_webserver_wget.csc @@ -0,0 +1,138 @@ + + + + My simulation + 0 + 1 + 123456 + 1000 + + se.sics.cooja.radiomediums.UDGM + 50.0 + 100.0 + 1.0 + 1.0 + + + se.sics.cooja.mspmote.SkyMoteType + sky1 + Sky Mote Type #1 + ../../../examples/sky-shell-webserver/sky-shell-webserver.c + make sky-shell-webserver.sky TARGET=sky + + + se.sics.cooja.mspmote.SkyMote + sky1 + + se.sics.cooja.interfaces.Position + 67.00582793711605 + 61.11208446062922 + 0.0 + + + se.sics.cooja.mspmote.interfaces.MspMoteID + 1 + + + + se.sics.cooja.mspmote.SkyMote + sky1 + + se.sics.cooja.interfaces.Position + 38.40617555763694 + 38.97825356716085 + 0.0 + + + se.sics.cooja.mspmote.interfaces.MspMoteID + 2 + + + + se.sics.cooja.mspmote.SkyMote + sky1 + + se.sics.cooja.interfaces.Position + 17.479600645822952 + 16.52364251581611 + 0.0 + + + se.sics.cooja.mspmote.interfaces.MspMoteID + 3 + + + + se.sics.cooja.mspmote.SkyMote + sky1 + + se.sics.cooja.interfaces.Position + 99.0932428018975 + 84.52903598560302 + 0.0 + + + se.sics.cooja.mspmote.interfaces.MspMoteID + 4 + + + + + se.sics.cooja.plugins.SimControl + 248 + 1 + 200 + 0 + 0 + false + + + se.sics.cooja.plugins.LogListener + + + 256 + + 998 + 4 + 166 + 0 + 704 + false + + + se.sics.cooja.radiomediums.UDGM$VisUDGM + 300 + 3 + 169 + 693 + 6 + false + + + se.sics.cooja.plugins.MoteInterfaceViewer + 2 + + Serial port + + 758 + 5 + 245 + 2 + 202 + false + + + se.sics.cooja.plugins.MoteInterfaceViewer + 3 + + Serial port + + 683 + 2 + 244 + 312 + 452 + false + + + diff --git a/tools/cooja/contiki_tests/ip_sky_webserver_wget.info b/tools/cooja/contiki_tests/ip_sky_webserver_wget.info new file mode 100644 index 000000000..8911bf1d7 --- /dev/null +++ b/tools/cooja/contiki_tests/ip_sky_webserver_wget.info @@ -0,0 +1 @@ +Four Sky nodes running both the shell and a CFS webserver. Test uses shell commands write and wget to generate and transfer files. diff --git a/tools/cooja/contiki_tests/ip_sky_webserver_wget.js b/tools/cooja/contiki_tests/ip_sky_webserver_wget.js new file mode 100644 index 000000000..3f9681052 --- /dev/null +++ b/tools/cooja/contiki_tests/ip_sky_webserver_wget.js @@ -0,0 +1,32 @@ +TIMEOUT(30000, log.log("last message: " + msg + "\n")); + +mote1 = null; +mote4 = null; + +/* Wait until both node 1 and 4 have booted */ +while (true) { + if (msg.contains('Starting')) { + if (id == 1) mote1 = mote; + if (id == 4) mote4 = mote; + } + if (mote1 != null && mote4 != null) break; + YIELD(); +} +log.log("Mote 1 and mote 4 booted\n"); + +/* Wait one second */ +GENERATE_MSG(1000, "continue"); +WAIT_UNTIL(msg.equals("continue")); + +/* Create file on node 1 */ +log.log("Creating data on node 1\n"); +write(mote1, "echo data generated at node 1 | write node1file.txt\n"); + +/* Fetch file to node 2 */ +log.log("Fetching data to node 4\n"); +write(mote4, "wget 172.16.1.0/node1file.txt | write node2file.txt\n"); + +WAIT_UNTIL(id == 4 && msg.contains("data generated at node 1")); +log.log("Node 4 received data!\n"); + +log.testOK();