summaryrefslogtreecommitdiff
path: root/common/scripts/replay.sh
diff options
context:
space:
mode:
authorGuoqing Zhu <guoqing.zhu@linaro.org>2013-09-16 23:03:45 +0800
committerFathi Boudra <fathi.boudra@linaro.org>2013-09-16 20:43:04 +0300
commitc044f89d2872a01a6ae3336ee8eccfcdb9d6ff52 (patch)
tree15dfb7a76d2d5171a08567db27e311dc9144eaaf /common/scripts/replay.sh
parent67fac535b00957a8a45f11adb8c71f80e6ed0eb5 (diff)
tcpreplay multinode test.
simple tcpreplay test with a telnet pcap file. Signed-off-by: Guoqing Zhu <guoqing.zhu@linaro.org> Acked-by: Fathi Boudra <fathi.boudra@linaro.org>
Diffstat (limited to 'common/scripts/replay.sh')
-rwxr-xr-xcommon/scripts/replay.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/common/scripts/replay.sh b/common/scripts/replay.sh
new file mode 100755
index 0000000..5776fd4
--- /dev/null
+++ b/common/scripts/replay.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+set -x
+
+local_ip=$(ifconfig|grep "inet addr"|grep -v "127.0.0.1"|cut -d: -f2|cut -d' ' -f1)
+
+for line in `lava-group | grep server | awk '{print $1}'` ; do
+ echo $line
+ # get the ipv4 for this device
+ STR=`lava-network query $line ipv4`
+ echo "STR: "$STR
+ # strip off the prefix for ipv4
+ DUT=`echo $STR | sed -e 's/.*addr://'`
+ echo "DUT: "$DUT
+ if [ "${local_ip}" != "${DUT}" ]; then
+ remote_ip=${DUT}
+ echo ${remote_ip}
+ break
+ fi
+done
+
+if [ -z ${remote_ip} ]
+then
+ echo "Missing remote ip!"
+ exit 1
+fi
+
+ifconfig -a
+local_mac=$(ifconfig eth0 | grep "HWaddr" | awk '{print $5}')
+ping -c 1 ${remote_ip} || exit 1
+remote_mac=$(arp -a | grep "${remote_ip}" | awk '{print $4}')
+
+tcpprep -a client -i telnet.cap -o telnet.cache
+tcprewrite --enet-smac=$local_mac,$remote_mac --enet-dmac=$remote_mac,$local_mac --endpoints=$local_ip:$remote_ip -c telnet.cache -i telnet.cap -o out.telnet.pcap --skipbroadcast
+tcpreplay -i eth0 -l 100 -t -c telnet.cache out.telnet.pcap | ./common/scripts/netperf2LAVA.py
+