| 1 |
#!/bin/bash |
| 2 |
|
| 3 |
usage () { |
| 4 |
cat >&2 <<EOF |
| 5 |
usage: $0 [OPTIONS] user@remote [user@remote...] |
| 6 |
|
| 7 |
OPTIONS |
| 8 |
-i IF use network interface IF (default: eth0) |
| 9 |
-b 100|1000 network bandwidth (100Mbps/1000Gbps) for calculating load |
| 10 |
% given load in bytes/second (default: 1000) |
| 11 |
-d DIR use DIR on remote (default: PWD) |
| 12 |
-p provision required binaries in DIR (default: false) |
| 13 |
first ssh's in to try mkdir -p DIR, then follows up with scp |
| 14 |
-t DUR run for DUR seconds per size (default 20) |
| 15 |
-a ASYNCLIST run for delivery async settings ASYNCLIST (default: "0 1") |
| 16 |
-m MODELIST run with subscriber mode settings MODELIST (default: "-1 0 1") |
| 17 |
-s SIZELIST run for sizes in SIZELIST (default: "0 16 32 64 128 256") |
| 18 |
-l LOOPBACK enable multicast loopback (true/false, default: true) |
| 19 |
-o DIR store results in dir.N where N is number of nodes |
| 20 |
|
| 21 |
Runs throughput-test with the specified options for each prefix of remote nodes. |
| 22 |
EOF |
| 23 |
exit 1 |
| 24 |
} |
| 25 |
|
| 26 |
export nwif=eth0 |
| 27 |
bandwidth=1000 |
| 28 |
remotedir="$PWD" |
| 29 |
provision=false |
| 30 |
asynclist="0 1" |
| 31 |
modelist="-1 0 1" |
| 32 |
sizelist="0 16 32 64 128 256" |
| 33 |
timeout=20 |
| 34 |
loopback=true |
| 35 |
resultdir="throughput-result" |
| 36 |
while getopts "i:b:d:pa:m:s:t:o:l:" opt ; do |
| 37 |
case $opt in |
| 38 |
i) nwif="$OPTARG" ;; |
| 39 |
b) bandwidth="$OPTARG" ;; |
| 40 |
d) remotedir="$OPTARG" ;; |
| 41 |
p) provision=true ;; |
| 42 |
a) asynclist="$OPTARG" ;; |
| 43 |
m) modelist="$OPTARG" ;; |
| 44 |
s) sizelist="$OPTARG" ;; |
| 45 |
l) loopback="OPTARG" ;; |
| 46 |
t) timeout="$OPTARG" ;; |
| 47 |
o) resultdir="$OPTARG" ;; |
| 48 |
h) usage ;; |
| 49 |
esac |
| 50 |
done |
| 51 |
shift $((OPTIND-1)) |
| 52 |
if [ $# -lt 1 ] ; then usage ; fi |
| 53 |
pubremote=$1 |
| 54 |
shift |
| 55 |
|
| 56 |
popt= |
| 57 |
$provision && popt=-p |
| 58 |
|
| 59 |
n=0 |
| 60 |
while [[ $n -le $# ]] ; do |
| 61 |
out=$resultdir.$(( $n + 1 )) |
| 62 |
mkdir $out |
| 63 |
|
| 64 |
otherhosts="" |
| 65 |
j=1 |
| 66 |
while [[ $j -le $n ]] ; do |
| 67 |
hostJ=`eval echo "\\$$j"` |
| 68 |
otherhosts="$otherhosts $hostJ" |
| 69 |
j=$(( $j + 1 )) |
| 70 |
done |
| 71 |
`dirname $0`/throughput-test -i "$nwif" -b "$bandwidth" -d "$remotedir" $popt -a "$asynclist" -m "$modelist" -s "$sizelist" -t "$timeout" -o $out $pubremote $otherhosts |
| 72 |
n=$(( $n + 1 )) |
| 73 |
done |