diff options
author | Neil Williams <codehelp@debian.org> | 2013-08-23 09:52:10 +0100 |
---|---|---|
committer | Neil Williams <codehelp@debian.org> | 2013-08-23 09:52:10 +0100 |
commit | 2c7cc3d964d44f37954cb9d50ff12bb382bae321 (patch) | |
tree | 20f8dd67ba86e3c3b2f3a0bcc608d3017442f312 | |
parent | bfce917b043cc0ad4c57617e93875d9f3bf8a10b (diff) |
port changes from lng code to use on imx53 tests.
-rw-r--r-- | netperf/imx53-netperf-group.json | 64 | ||||
-rwxr-xr-x | netperf/netperf-client.sh | 24 | ||||
-rw-r--r-- | netperf/netperf-multinode-c-network.yaml | 6 | ||||
-rw-r--r-- | netperf/netperf-multinode-s-network.yaml | 3 | ||||
-rwxr-xr-x | netperf/netperf2LAVA.py | 55 |
5 files changed, 152 insertions, 0 deletions
diff --git a/netperf/imx53-netperf-group.json b/netperf/imx53-netperf-group.json new file mode 100644 index 0000000..071b705 --- /dev/null +++ b/netperf/imx53-netperf-group.json @@ -0,0 +1,64 @@ +{ + "timeout": 900, + "job_name": "netperf imx53 tests", + "logging_level": "DEBUG", + "device_group": [ + { + "role": "client", + "count": 1, + "device_type": "panda", + "tags": [ + "test-client" + ] + }, + { + "role": "server", + "count": 1, + "device_type": "panda", + "tags": [ + "test-server" + ] + } + ], + "actions": [ + { + "command": "deploy_linaro_image", + "parameters": { + "image": "file:///home/codehelp/images/mx53loco-ubuntu-desktop.img.gz" + } + }, + { + "command": "lava_test_shell", + "parameters": { + "testdef_repos": [ + { + "git-repo": "git://git.linaro.org/people/guoqing.zhu/netperf-multinode.git", + "testdef": "netperf/netperf-multinode-c-network.yaml" + } + ], + "timeout": 1800, + "role": "client" + } + }, + { + "command": "lava_test_shell", + "parameters": { + "testdef_repos": [ + { + "git-repo": "git://git.linaro.org/people/guoqing.zhu/netperf-multinode.git", + "testdef": "netperf/netperf-multinode-s-network.yaml" + } + ], + "timeout": 1800, + "role": "server" + } + }, + { + "command": "submit_results_on_host", + "parameters": { + "stream": "/anonymous/codehelp/", + "server": "http://multinode.validation.linaro.org/RPC2/" + } + } + ] +} diff --git a/netperf/netperf-client.sh b/netperf/netperf-client.sh new file mode 100755 index 0000000..7fd2fe3 --- /dev/null +++ b/netperf/netperf-client.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +set -e + +#local_ip=$(ifconfig|grep "inet addr"|grep -v "127.0.0.1"|cut -d: -f2|cut -d' ' -f1) + +#echo "local ip:"${local_ip} +#for line in `grep ":ip=" /tmp/lava_multi_node_cache.txt |cut -d'=' -f2` ; do +# if [ "${local_ip}" != "${line}" ]; then +# remote_ip=${line} +# echo "remote ip:"${remote_ip} +# fi +#done + +remote_ip=$(cat /tmp/remote_ip) + +cd build/bin + +./netperf -H ${remote_ip} -l 60 | ../../netperf/netperf2LAVA.py +./netperf -t UDP_STREAM -H ${remote_ip} -- -m 1024 | ../../netperf/netperf2LAVA.py +./netperf -t TCP_RR -H ${remote_ip} | ../../netperf/netperf2LAVA.py +./netperf -t TCP_RR -H ${remote_ip} -- -r 32,1024| ../../netperf/netperf2LAVA.py +./netperf -t TCP_CRR -H ${remote_ip} | ../../netperf/netperf2LAVA.py +./netperf -t UDP_RR -H ${remote_ip} | ../../netperf/netperf2LAVA.py diff --git a/netperf/netperf-multinode-c-network.yaml b/netperf/netperf-multinode-c-network.yaml index 97dd13f..6b94d07 100644 --- a/netperf/netperf-multinode-c-network.yaml +++ b/netperf/netperf-multinode-c-network.yaml @@ -5,12 +5,15 @@ metadata: install: steps: + - 'mkdir netperf || true' + - 'cd netperf' - 'curl ftp://ftp.netperf.org/netperf/netperf-2.6.0.tar.gz > netperf-2.6.0.tar.gz' - 'tar --strip-components=1 -zxf netperf-2.6.0.tar.gz' - 'mkdir build' - './configure --prefix=$(readlink -f build)' - 'make all' - 'make SKIP_IDCHECK=1 install' + - 'cd ..' deps: - gzip - flex @@ -30,3 +33,6 @@ run: - lava-sync ready - lava-test-case multinode-lava-network --shell ./netperf/netperf-client-napi.sh - lava-sync done + +parse: + "pattern": "^test_case_id:(?P<test_case_id>.+) units:(?P<units>.+) measurement:(?P<measurement>[0-9]+.[0-9]+) result:(?P<result>\\w+)" diff --git a/netperf/netperf-multinode-s-network.yaml b/netperf/netperf-multinode-s-network.yaml index 5ca07c3..e6d90f4 100644 --- a/netperf/netperf-multinode-s-network.yaml +++ b/netperf/netperf-multinode-s-network.yaml @@ -33,3 +33,6 @@ run: - lava-test-case multinode-lava-network --shell ./netperf/netperf-server.sh - lava-sync ready - lava-sync done + +parse: + "pattern": "^test_case_id:(?P<test_case_id>.+) units:(?P<units>.+) measurement:(?P<measurement>[0-9]+.[0-9]+) result:(?P<result>\\w+)" diff --git a/netperf/netperf2LAVA.py b/netperf/netperf2LAVA.py new file mode 100755 index 0000000..ce47012 --- /dev/null +++ b/netperf/netperf2LAVA.py @@ -0,0 +1,55 @@ +#!/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_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_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_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 " + "measuremnt:" + "0" + " result:fail" |