summaryrefslogtreecommitdiff
path: root/openembedded/scripts
diff options
context:
space:
mode:
authorGuoqing Zhu <guoqing.zhu@linaro.org>2013-09-13 00:00:54 +0800
committerFathi Boudra <fathi.boudra@linaro.org>2013-09-14 08:24:45 +0300
commitdf9b05d5334f112f09ead8072d80a0a31e129920 (patch)
treeb0dd3ffe366d14465a0b17935237daf771652297 /openembedded/scripts
parentf9c4efbb832cbc34daadb03750f825db58aae886 (diff)
openembedded/netperf: initial multinode test
Add netperf multinode test for openembedded. Signed-off-by: Guoqing Zhu <guoqing.zhu@linaro.org> Acked-by: Fathi Boudra <fathi.boudra@linaro.org>
Diffstat (limited to 'openembedded/scripts')
-rwxr-xr-xopenembedded/scripts/netperf-client.sh34
-rwxr-xr-xopenembedded/scripts/netperf-server.sh5
-rwxr-xr-xopenembedded/scripts/netperf2LAVA.py63
3 files changed, 102 insertions, 0 deletions
diff --git a/openembedded/scripts/netperf-client.sh b/openembedded/scripts/netperf-client.sh
new file mode 100755
index 0000000..2351fe4
--- /dev/null
+++ b/openembedded/scripts/netperf-client.sh
@@ -0,0 +1,34 @@
+#!/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
+ping -c 1 ${remote_ip} || exit 1
+ping -c 30 ${remote_ip} | ./openembedded/scripts/netperf2LAVA.py
+for m in 64 128 256 512 1024 2048 4096 8192 16384; do netperf -H ${remote_ip} -l 20 -c -C -- -m $m -D; done | ./openembedded/scripts/netperf2LAVA.py
+for m in 64 128 256 512 1024 2048 4096 8192 16384; do netperf -H ${remote_ip} -l 20 -t UDP_STREAM -c -C -- -m $m -D; done | ./openembedded/scripts/netperf2LAVA.py
+for m in 1 32 64 128 512 1024 4096 8192 16384; do netperf -t TCP_RR -H ${remote_ip} -l 20 -c -C -- -r $m,$m -D; done | ./openembedded/scripts/netperf2LAVA.py
+for m in 1 32 64 128 512 1024 4096 8192 16384; do netperf -t UDP_RR -H ${remote_ip} -l 20 -c -C -- -r $m,$m -D; done | ./openembedded/scripts/netperf2LAVA.py
diff --git a/openembedded/scripts/netperf-server.sh b/openembedded/scripts/netperf-server.sh
new file mode 100755
index 0000000..7e2fc3c
--- /dev/null
+++ b/openembedded/scripts/netperf-server.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+set -x
+
+netserver && echo 'test_case_id:netserver units:none measurement:0 result:pass' || echo 'test_case_id:netserver units:none measurement:0 result:fail'
diff --git a/openembedded/scripts/netperf2LAVA.py b/openembedded/scripts/netperf2LAVA.py
new file mode 100755
index 0000000..ee1199d
--- /dev/null
+++ b/openembedded/scripts/netperf2LAVA.py
@@ -0,0 +1,63 @@
+#!/usr/bin/python
+import re
+import sys
+
+#Parse netperf results looking for the data in the form of
+#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_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*$")
+parser_udp_r = re.compile("^\s*(?P<Sock>\d+)\s+(?P<time>\d+\.\d+)\s+(?P<Okey>\d+)\s+(?P<throughput>\d+\.\d+)\s+(?P<cpu_r>\d+\.\d+)\s+(?P<srv_r>\d+\.\d+)\s*$")
+parser_rr = re.compile("^\s*(?P<Send>\d+)\s+(?P<Recv>\d+)\s+(?P<Req>\d+)\s+(?P<Res>\d+)\s+(?P<time>\d+\.\d+)\s+(?P<trans>\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_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]:
+ result = parser.search(line)
+ if result is not None:
+ if parser is parser_rr_tcp:
+ rr_type = "TCP_RR"
+ break
+ if parser is parser_rr_udp:
+ rr_type = "UDP_RR"
+ 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"
+ print "test_case_id:PING_RTT max" + " units:ms " + "measurement:" + result.group('max') + " result:pass"
+ print "test_case_id:PING_RTT mdev" + " units:ms " + "measurement:" + result.group('mdev') + " result:pass"
+ found_result = "true"
+ break
+ if parser is parser_tcp:
+ print "test_case_id:TCP_STREAM throughput" + "(Msg Sz: " + result.group('Msg') + ")" + " units:10^bits/sec " + "measurement:" + result.group('throughput') + " result:pass"
+ print "test_case_id:TCP_STREAM snd cpu utilization" + "(Msg Sz: " + result.group('Msg') + ")" + " units:% " + "measurement:" + result.group('cpu_s') + " result:pass"
+ print "test_case_id:TCP_STREAM rcv cpu utilization" + "(Msg Sz: " + result.group('Msg') + ")" + " units:% " + "measurement:" + result.group('cpu_r') + " result:pass"
+ found_result = "true"
+ break
+ if parser is parser_udp_l:
+ print "test_case_id:UDP_STREAM snd throughput" + "(Msg Sz: " + result.group('Msg') + ")" + " units:10^bits/sec " + "measurement:" + result.group('throughput') + " result:pass"
+ print "test_case_id:UDP_STREAM snd cpu utilization" + "(Msg Sz: " + result.group('Msg') + ")" + " units:% " + "measurement:" + result.group('cpu_s') + " result:pass"
+ found_result = "true"
+ break
+ if parser is parser_udp_r:
+ print "test_case_id:UDP_STREAM rcv throughput" + " units:10^bits/sec " + "measurement:" + result.group('throughput') + " result:pass"
+ print "test_case_id:UDP_STREAM rcv cpu utilization" + " units:% " + "measurement:" + result.group('cpu_r') + " result:pass"
+ found_result = "true"
+ break
+ if parser is parser_rr:
+ print "test_case_id:" + rr_type + " transaction rate" + "(Req Sz: " + result.group('Req') + " Res Sz: " + result.group('Res') + ")" + " units:trans/sec " + "measurement:" + result.group('trans') + " result:pass"
+ print "test_case_id:" + rr_type + " snd cpu utilization" + "(Req Sz: " + result.group('Req') + " Res Sz: " + result.group('Res') + ")" + " units:% " + "measurement:" + result.group('cpu_s') + " result:pass"
+ print "test_case_id:" + rr_type + " rcv cpu utilization" + "(Req Sz: " + result.group('Req') + " Res Sz: " + result.group('Res') + ")" + " units:% " + "measurement:" + result.group('cpu_r') + " result:pass"
+ found_result = "true"
+ break
+ else:
+ continue
+
+if found_result == "false":
+ print "units:none " + "measurement:" + "0" + " result:fail"