summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWeilong Chen <weilong.chen@linaro.org>2014-04-17 19:52:29 +0800
committerMilosz Wasilewski <milosz.wasilewski@linaro.org>2014-05-07 14:23:51 +0000
commit183d092e5529867cd9eb49c55a0c6bad132ab8f3 (patch)
treea9942a7fa369dedae377c4980e6f90ba72c4e2cc
parent97cd698f46250318184f064e0c9b16dbe593bfe2 (diff)
BP: TCP Replay to pump pcap traffic for tests
Establish basic sanity and regression tests, this is a special case test since it actually generates traffic for other test cases Change-Id: I711c5a4683b116ad54cc8c69e020dcf041fa7317 Signed-off-by: Weilong Chen <weilong.chen@linaro.org>
-rwxr-xr-xcommon/scripts/generator.sh41
-rw-r--r--common/scripts/pcapfiles/iperf.pcapbin0 -> 80664 bytes
-rw-r--r--openembedded/replay-client-multinode.yaml30
-rw-r--r--openembedded/replay-server-multinode.yaml26
-rw-r--r--ubuntu/replay-client-multinode.yaml33
-rw-r--r--ubuntu/replay-server-multinode.yaml23
6 files changed, 118 insertions, 35 deletions
diff --git a/common/scripts/generator.sh b/common/scripts/generator.sh
new file mode 100755
index 0000000..61808c8
--- /dev/null
+++ b/common/scripts/generator.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+set -x
+usage()
+{
+ echo "usage:\n" \
+ " - $1 (interface.Primary traffic output interface.)\n" \
+ " - $2 (address.The IP address that the packages will be replayed to.)\n" \
+ " - $3 (rate.Replay packets at a given packets/sec.It takes an integer number or 'max' as its argument.)\n" \
+ " - $4 (loop number.Loop through the capture file X times.)"
+}
+
+if [ $# -ne 4 ]; then
+ echo "param miss!"
+ usage
+ exit 1
+fi
+
+INTF=$1
+ADDR=$2
+RATE=$3
+LOOP=$4
+
+local_ip=$(ifconfig $INTF |grep "inet addr"|grep -v "127.0.0.1"|cut -d: -f2|cut -d' ' -f1)
+remote_ip=$ADDR
+local_mac=$(ifconfig $INTF | grep "HWaddr" | awk '{print $5}')
+ping -c 1 ${remote_ip}
+if [ $? -ne 0 ]; then
+ echo "Address $remote_ip isn't reachable"
+ exit 1
+fi
+remote_mac=$(arp -a | grep "${remote_ip}" | awk '{print $4}')
+
+opt="-t"
+if [ $RATE != 'max' ]; then
+ opt="-p $RATE"
+fi
+infile="./common/scripts/pcapfiles/iperf.pcap"
+tcpreplay -V
+tcpprep -a client -i $infile -o tmpcap.cache
+tcprewrite --enet-smac=$local_mac,$remote_mac --enet-dmac=$remote_mac,$local_mac --endpoints=$local_ip:$remote_ip -c tmpcap.cache -i $infile -o out.tmpcap.pcap --skipbroadcast
+tcpreplay -i eth0 -l 100 $opt -c tmpcap.cache out.tmpcap.pcap | ./common/scripts/netperf2LAVA.py
diff --git a/common/scripts/pcapfiles/iperf.pcap b/common/scripts/pcapfiles/iperf.pcap
new file mode 100644
index 0000000..95dc994
--- /dev/null
+++ b/common/scripts/pcapfiles/iperf.pcap
Binary files differ
diff --git a/openembedded/replay-client-multinode.yaml b/openembedded/replay-client-multinode.yaml
new file mode 100644
index 0000000..24e4050
--- /dev/null
+++ b/openembedded/replay-client-multinode.yaml
@@ -0,0 +1,30 @@
+metadata:
+ format: Lava-Test Test Definition 1.0
+ name: tcpreplay-client-multinode
+ description: "Basic MultiNode tcpreplay test on client side"
+ maintainer:
+ - weilong.chen@linaro.org
+ os:
+ - openembedded
+ scope:
+ - performance
+ devices:
+ - kvm
+ - arndale
+params:
+ ETH: eth0
+ REP: 100
+run:
+ steps:
+ - lava-sync start
+ - ifconfig -a
+ - route
+ - lava-network broadcast $ETH
+ - lava-network collect $ETH
+ - line=`lava-group | grep server | awk '{print $1}'`
+ - STR=`lava-network query $line ipv4`
+ - remote_ip=`echo $STR | sed -e 's/.*addr://'`
+ - lava-test-case multinode-lava-network --shell ./common/scripts/generator.sh $ETH $remote_ip max $REP
+ - lava-sync done
+parse:
+ "pattern": "^test_case_id:(?P<test_case_id>.+) units:(?P<units>.+) measurement:(?P<measurement>\\d+\\.\\d+) result:(?P<result>\\w+)"
diff --git a/openembedded/replay-server-multinode.yaml b/openembedded/replay-server-multinode.yaml
new file mode 100644
index 0000000..595a7ca
--- /dev/null
+++ b/openembedded/replay-server-multinode.yaml
@@ -0,0 +1,26 @@
+metadata:
+ format: Lava-Test Test Definition 1.0
+ name: tcpreplay-server-multinode
+ description: "Basic MultiNode tcpreplay test on server side"
+ maintainer:
+ - weilong.chen@linaro.org
+ os:
+ - openembedded
+ scope:
+ - performance
+ devices:
+ - kvm
+ - arndale
+params:
+ ETH: eth0
+run:
+ steps:
+ - lava-sync start
+ - ifconfig -a
+ - route
+ - lava-network broadcast $ETH
+ - lava-network collect $ETH
+ - echo "test-0:ignore"
+ - lava-sync done
+parse:
+ "pattern": "(?P<test_case_id>.*-*):\\s+(?P<result>(pass|fail))"
diff --git a/ubuntu/replay-client-multinode.yaml b/ubuntu/replay-client-multinode.yaml
index 9c1b692..a6246b4 100644
--- a/ubuntu/replay-client-multinode.yaml
+++ b/ubuntu/replay-client-multinode.yaml
@@ -3,37 +3,28 @@ metadata:
name: tcpreplay-client-multinode
description: "Basic MultiNode tcpreplay test on client side"
maintainer:
- - guoqing.zhu@linaro.org
+ - weilong.chen@linaro.org
os:
- ubuntu
scope:
- - functional
- performance
- - latency
- - cpu utilization
devices:
- kvm
- arndale
- - panda
- - beaglebone-black
- - beagle-xm
- - mx53loco
-
-install:
- deps:
- - wget
- - tcpreplay
- - python-minimal
-
+params:
+ ETH: eth0
+ REP: 100
run:
steps:
- - wget -O telnet.cap http://packetlife.net/captures/telnet.cap
+ - lava-sync start
- ifconfig -a
- route
- - lava-network broadcast eth0
- - lava-network collect eth0
- - lava-test-case multinode-lava-network --shell ./common/scripts/replay.sh
- - lava-sync done
-
+ - lava-network broadcast $ETH
+ - lava-network collect $ETH
+ - line=`lava-group | grep server | awk '{print $1}'`
+ - STR=`lava-network query $line ipv4`
+ - remote_ip=`echo $STR | sed -e 's/.*addr://'`
+ - lava-test-case multinode-lava-network --shell ./common/scripts/generator.sh $ETH $remote_ip max $REP
+ - lava-sync done
parse:
"pattern": "^test_case_id:(?P<test_case_id>.+) units:(?P<units>.+) measurement:(?P<measurement>\\d+\\.\\d+) result:(?P<result>\\w+)"
diff --git a/ubuntu/replay-server-multinode.yaml b/ubuntu/replay-server-multinode.yaml
index 4d8b877..5ac8675 100644
--- a/ubuntu/replay-server-multinode.yaml
+++ b/ubuntu/replay-server-multinode.yaml
@@ -3,29 +3,24 @@ metadata:
name: tcpreplay-server-multinode
description: "Basic MultiNode tcpreplay test on server side"
maintainer:
- - guoqing.zhu@linaro.org
+ - weilong.chen@linaro.org
os:
- ubuntu
scope:
- - functional
- performance
- - latency
- - cpu utilization
devices:
- kvm
- arndale
- - panda
- - beaglebone-black
- - beagle-xm
- - mx53loco
-
+params:
+ ETH: eth0
run:
steps:
+ - lava-sync start
- ifconfig -a
- route
- - lava-network broadcast eth0
- - lava-network collect eth0
- - lava-sync done
-
+ - lava-network broadcast $ETH
+ - lava-network collect $ETH
+ - echo "test-0:ignore"
+ - lava-sync done
parse:
- "pattern": "^test_case_id:(?P<test_case_id>.+) units:(?P<units>.+) measurement:(?P<measurement>\\d+\\.\\d+) result:(?P<result>\\w+)"
+ "pattern": "(?P<test_case_id>.*-*):\\s+(?P<result>(pass|fail))"