diff options
author | Guoqing Zhu <guoqing.zhu@linaro.org> | 2013-09-16 23:03:45 +0800 |
---|---|---|
committer | Fathi Boudra <fathi.boudra@linaro.org> | 2013-09-16 20:43:04 +0300 |
commit | c044f89d2872a01a6ae3336ee8eccfcdb9d6ff52 (patch) | |
tree | 15dfb7a76d2d5171a08567db27e311dc9144eaaf | |
parent | 67fac535b00957a8a45f11adb8c71f80e6ed0eb5 (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>
-rwxr-xr-x | common/scripts/netperf2LAVA.py | 13 | ||||
-rwxr-xr-x | common/scripts/replay.sh | 36 | ||||
-rw-r--r-- | ubuntu/replay-client-multinode.yaml | 39 | ||||
-rw-r--r-- | ubuntu/replay-server-multinode.yaml | 31 |
4 files changed, 117 insertions, 2 deletions
diff --git a/common/scripts/netperf2LAVA.py b/common/scripts/netperf2LAVA.py index ee1199d..3eeeb12 100755 --- a/common/scripts/netperf2LAVA.py +++ b/common/scripts/netperf2LAVA.py @@ -2,13 +2,16 @@ import re import sys -#Parse netperf results looking for the data in the form of +#Parse netperf/ping/tcpreplay results looking for the data in the form of +#line = "Actual: 113000 packets (7810000 bytes) sent in 4.75 seconds. Rated: 1644210.5 bps, 12.54 Mbps, 23789.47 pps" +#line = "rtt min/avg/max/mdev = 4.037/4.037/4.037/0.000 ms" #line = "87380 16384 2048 10.00 4289.48 51.12 51.12 3.905 3.905" ./netperf -l 10 -c -C -- -m 2048 -D #line = "180224 8192 10.00 1654855 0 10845.1 52.60 1.589" ./netperf -t UDP_STREAM -l 10 -c -C -- -m 8192 -D #line = "180224 10.00 1649348 10809.0 52.60 1.589" rcv side of UDP_STREAM #line = "16384 87380 1 1 10.00 47469.68 29.84 29.84 25.146 25.146" ./netperf -t TCP_RR -l 10 -c -C -- -r 1,1 found_result = "false" +parser_replay = re.compile("Rated:\s+(?P<throughput1>\d+\.\d+)\s+\S+\s+(?P<throughput2>\d+\.\d+)\s+\S+\s+(?P<throughput3>\d+\.\d+)") parser_rtt = re.compile("^rtt\s+\S+\s+\=\s+(?P<min>\d+\.\d+)\/(?P<avg>\d+\.\d+)\/(?P<max>\d+\.\d+)\/(?P<mdev>\d+\.\d+)") parser_tcp = re.compile("^\s*(?P<Recv>\d+)\s+(?P<Send>\d+)\s+(?P<Msg>\d+)\s+(?P<time>\d+\.\d+)\s+(?P<throughput>\d+\.\d+)\s+(?P<cpu_s>\d+\.\d+)\s+(?P<cpu_r>\d+\.\d+)\s+(?P<srv_s>\d+\.\d+)\s+(?P<dem_r>\d+\.\d+)\s*$") parser_udp_l = re.compile("^\s*(?P<Sock>\d+)\s+(?P<Msg>\d+)\s+(?P<time>\d+\.\d+)\s+(?P<Okey>\d+)\s+(?P<Errs>\d+)\s+(?P<throughput>\d+\.\d+)\s+(?P<cpu_s>\d+\.\d+)\s+(?P<srv_s>\d+\.\d+)\s*$") @@ -18,7 +21,7 @@ parser_rr_tcp = re.compile("TCP REQUEST/RESPONSE") parser_rr_udp = re.compile("UDP REQUEST/RESPONSE") for line in sys.stdin: - for parser in [parser_rtt, parser_tcp, parser_udp_l, parser_udp_r, parser_rr, parser_rr_tcp, parser_rr_udp]: + for parser in [parser_replay, parser_rtt, parser_tcp, parser_udp_l, parser_udp_r, parser_rr, parser_rr_tcp, parser_rr_udp]: result = parser.search(line) if result is not None: if parser is parser_rr_tcp: @@ -27,6 +30,12 @@ for line in sys.stdin: if parser is parser_rr_udp: rr_type = "UDP_RR" break + if parser is parser_replay: + print "test_case_id:tcpreplay rated throughput1" + " units:bps " + "measurement:" + result.group('throughput1') + " result:pass" + print "test_case_id:tcpreplay rated throughput2" + " units:Mbps " + "measurement:" + result.group('throughput2') + " result:pass" + print "test_case_id:tcpreplay rated throughput3" + " units:pps " + "measurement:" + result.group('throughput3') + " result:pass" + found_result = "true" + break if parser is parser_rtt: print "test_case_id:PING_RTT min" + " units:ms " + "measurement:" + result.group('min') + " result:pass" print "test_case_id:PING_RTT avg" + " units:ms " + "measurement:" + result.group('avg') + " result:pass" 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 + diff --git a/ubuntu/replay-client-multinode.yaml b/ubuntu/replay-client-multinode.yaml new file mode 100644 index 0000000..9c1b692 --- /dev/null +++ b/ubuntu/replay-client-multinode.yaml @@ -0,0 +1,39 @@ +metadata: + format: Lava-Test Test Definition 1.0 + name: tcpreplay-client-multinode + description: "Basic MultiNode tcpreplay test on client side" + maintainer: + - guoqing.zhu@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 + +run: + steps: + - wget -O telnet.cap http://packetlife.net/captures/telnet.cap + - 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 + +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 new file mode 100644 index 0000000..4d8b877 --- /dev/null +++ b/ubuntu/replay-server-multinode.yaml @@ -0,0 +1,31 @@ +metadata: + format: Lava-Test Test Definition 1.0 + name: tcpreplay-server-multinode + description: "Basic MultiNode tcpreplay test on server side" + maintainer: + - guoqing.zhu@linaro.org + os: + - ubuntu + scope: + - functional + - performance + - latency + - cpu utilization + devices: + - kvm + - arndale + - panda + - beaglebone-black + - beagle-xm + - mx53loco + +run: + steps: + - ifconfig -a + - route + - lava-network broadcast eth0 + - lava-network collect eth0 + - lava-sync done + +parse: + "pattern": "^test_case_id:(?P<test_case_id>.+) units:(?P<units>.+) measurement:(?P<measurement>\\d+\\.\\d+) result:(?P<result>\\w+)" |