summaryrefslogtreecommitdiff
path: root/common/scripts/netperf2LAVA.py
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/netperf2LAVA.py
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/netperf2LAVA.py')
-rwxr-xr-xcommon/scripts/netperf2LAVA.py13
1 files changed, 11 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"