| | 57 | |
| | 58 | == Sample Experiment Script == |
| | 59 | |
| | 60 | The following is an example of a script that can be used to run a repeatable experiment: |
| | 61 | |
| | 62 | {{{ |
| | 63 | # script to run the experiment |
| | 64 | |
| | 65 | # image the nodes |
| | 66 | ./orbitImage nodeList baseline.ndz |
| | 67 | |
| | 68 | # wait until all the experiment nodes have booted |
| | 69 | ./orbitPower nodeList on |
| | 70 | |
| | 71 | # Configure my wireless interface by running commands |
| | 72 | # on all experiment nodes and waiting until they complete. |
| | 73 | ./orbitRunWait nodeList "iwconfig ath0 essid 'oontest'" |
| | 74 | ./orbitRunWait nodeList "iwconfig ath0 channel 1" |
| | 75 | ./orbitRunWait nodeList "iwconfig ath0 mode 'ad-hoc'" |
| | 76 | ./orbitRunWait nodeList "iwconfig ath0 rate '11M'" |
| | 77 | ./orbitRunWait nodeList "ifconfig ath0 192.168.%x.%y" |
| | 78 | |
| | 79 | # Copy the latest version of my application to each node |
| | 80 | ./orbitPutFile nodeList myApp /root |
| | 81 | |
| | 82 | # Run my app on each experiment node, but don’t block |
| | 83 | ./orbitRun nodeList "./myApp -i ath0" |
| | 84 | |
| | 85 | # delay while it does its thing |
| | 86 | sleep 60s |
| | 87 | |
| | 88 | # Some random command to ping every node from the console |
| | 89 | ./orbitCmd nodeList "ping node%x-%y" |
| | 90 | |
| | 91 | # Kill off all the instances of my app running on the nodes |
| | 92 | ./orbitKillAll nodeList "./myApp -i ath0" |
| | 93 | |
| | 94 | # copy and merge the logs from each node into one file on the console |
| | 95 | # this merged file can then be processed by your data analysis tools |
| | 96 | ./orbitGetFileMerged nodelist ./route_logs.csv |
| | 97 | ./orbitGetFileMerged nodelist ./error_rates.csv |
| | 98 | |
| | 99 | # shutdown the nodes in the experiment |
| | 100 | ./orbitPower nodeList off |
| | 101 | }}} |
| | 102 | |
| | 103 | For more experiments I'd highly recommend removing the './orbitImage' and './orbitPower' commands to speed up the test/debug process considerably. |