summaryrefslogtreecommitdiff
path: root/ubuntu
diff options
context:
space:
mode:
authorFathi Boudra <fathi.boudra@linaro.org>2013-09-10 10:41:45 +0300
committerFathi Boudra <fathi.boudra@linaro.org>2013-09-10 10:41:45 +0300
commit52c864d3132554da585486351b20ee8498d77ee7 (patch)
tree1aae4c094d6b874d72f7027ca24729cfbc6b255b /ubuntu
parenta673869cb79f2eb7c6e22f4f2df651d040f57da2 (diff)
Move netper multinode under ubuntu directory
Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
Diffstat (limited to 'ubuntu')
-rw-r--r--ubuntu/netperf-client-multinode.yaml39
-rw-r--r--ubuntu/netperf-server-multinode.yaml39
-rwxr-xr-xubuntu/scripts/netperf-client.sh34
-rwxr-xr-xubuntu/scripts/netperf-server.sh5
-rwxr-xr-xubuntu/scripts/netperf2LAVA.py63
5 files changed, 180 insertions, 0 deletions
diff --git a/ubuntu/netperf-client-multinode.yaml b/ubuntu/netperf-client-multinode.yaml
new file mode 100644
index 0000000..89374ed
--- /dev/null
+++ b/ubuntu/netperf-client-multinode.yaml
@@ -0,0 +1,39 @@
+metadata:
+ format: Lava-Test Test Definition 1.0
+ name: netperf-client-multinode
+ description: "Basic MultiNode netperf/ping 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:
+ - curl
+ - python
+ - netperf
+
+run:
+ steps:
+ - ifconfig -a
+ - route
+ - lava-network broadcast eth0
+ - lava-network collect eth0
+ - lava-sync ready
+ - lava-test-case multinode-lava-network --shell ./lng-netperf/netperf-client.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/netperf-server-multinode.yaml b/ubuntu/netperf-server-multinode.yaml
new file mode 100644
index 0000000..c8ce158
--- /dev/null
+++ b/ubuntu/netperf-server-multinode.yaml
@@ -0,0 +1,39 @@
+metadata:
+ format: Lava-Test Test Definition 1.0
+ name: netperf-server-multinode
+ description: "Basic MultiNode netperf/ping 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
+
+install:
+ deps:
+ - curl
+ - python
+ - netperf
+
+run:
+ steps:
+ - ifconfig -a
+ - route
+ - lava-network broadcast eth0
+ - lava-network collect eth0
+ - lava-sync ready
+ - lava-test-case multinode-lava-network --shell ./lng-netperf/netperf-server.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/scripts/netperf-client.sh b/ubuntu/scripts/netperf-client.sh
new file mode 100755
index 0000000..324978a
--- /dev/null
+++ b/ubuntu/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} | ./lng-netperf/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 | ./lng-netperf/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 | ./lng-netperf/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 | ./lng-netperf/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 | ./lng-netperf/netperf2LAVA.py
diff --git a/ubuntu/scripts/netperf-server.sh b/ubuntu/scripts/netperf-server.sh
new file mode 100755
index 0000000..7e2fc3c
--- /dev/null
+++ b/ubuntu/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/ubuntu/scripts/netperf2LAVA.py b/ubuntu/scripts/netperf2LAVA.py
new file mode 100755
index 0000000..ee1199d
--- /dev/null
+++ b/ubuntu/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"