summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur She <arthur.she@linaro.org>2014-11-14 10:55:13 -0800
committerMilosz Wasilewski <milosz.wasilewski@linaro.org>2014-11-24 13:41:08 +0000
commit0129466fa55ee57c20560e3fc6230cbdf4edb752 (patch)
treed3e1034a7c4a7ff23fb42a9291f97c49b9df2964
parent274266f597e9a4f05f69fa8ae5e9aaecd1718ce1 (diff)
iperf: Add iperf.yaml for both OE & Ubuntu
iperf.yaml is a multinode test job with a single yaml file. The roles in the test job must be 'server' & 'client'. Change-Id: I4ed29b59d946ad0186026fc2c4fb8f02574366a5
-rwxr-xr-xcommon/scripts/iperf-client.sh23
-rwxr-xr-xcommon/scripts/iperf-server.sh20
-rw-r--r--openembedded/iperf.yaml37
-rw-r--r--ubuntu/iperf.yaml32
4 files changed, 112 insertions, 0 deletions
diff --git a/common/scripts/iperf-client.sh b/common/scripts/iperf-client.sh
new file mode 100755
index 0000000..f2efb55
--- /dev/null
+++ b/common/scripts/iperf-client.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+#set -e
+#set -x
+
+LEN=${1}
+PACKET=${2}
+TIME=${3}
+TEST_CASE="Bandwidth"
+
+lava-wait server-ready
+server_ip=$(cat /tmp/lava_multi_node_cache.txt | cut -d = -f 2)
+opts="-c ${server_ip} -l ${LEN} -t ${TIME}"
+[ "${PACKET}" = "UDP" ] && opts="${opts} -u"
+echo "iperf client:"
+echo "Running iperf ${opts}"
+iperf ${opts} 2>&1 | tee result.log
+echo -n "${TEST_CASE}: "
+grep "^\[" result.log | tail -n 1 | awk '{print $7 " " $8 " pass"}'
+lava-test-case iperf-client --shell [ -z "`grep "Connection refused" result.log`" ] && true || false
+lava-test-case-attach iperf-client result.log
+lava-send client-done
+
diff --git a/common/scripts/iperf-server.sh b/common/scripts/iperf-server.sh
new file mode 100755
index 0000000..854b614
--- /dev/null
+++ b/common/scripts/iperf-server.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+#set -e
+#set -x
+
+LEN=${1}
+PACKET=${2}
+TIME=${3}
+
+opts="-s"
+[ "${PACKET}" = "UDP" ] && opts="${opts} -u"
+server_ip=$(ifconfig `route -n|grep "^0"|awk '{print $NF}'`|grep -o "inet addr:[0-9\.]*"|cut -d':' -f 2)
+echo "iperf server:"
+echo "Server IP: ${server_ip}"
+echo "Runing iperf ${opts}"
+iperf ${opts} &
+echo $! > /tmp/iperf-server.pid
+lava-send server-ready server_ip=${server_ip}
+lava-wait client-done
+lava-test-case iperf-server --shell kill -9 `cat /tmp/iperf-server.pid`
diff --git a/openembedded/iperf.yaml b/openembedded/iperf.yaml
new file mode 100644
index 0000000..ca17e1d
--- /dev/null
+++ b/openembedded/iperf.yaml
@@ -0,0 +1,37 @@
+metadata:
+ format: Lava-Test Test Definition 1.0
+ name: iperf-multinode
+ description:
+ "Basic MultiNode iperf test on server/client side.
+ The roles in the test job must be server & client"
+ maintainer:
+ - arthur.she@linaro.org
+ os:
+ - openembedded
+ scope:
+ - performance
+ devices:
+ - kvm
+ - arndale
+ - beaglebone-black
+
+install:
+ git-repos:
+ - https://github.com/esnet/iperf.git
+ steps:
+ - cd iperf
+ - ./configure --prefix=/usr
+ - make all install
+ - ln -s /usr/bin/iperf3 /usr/bin/iperf
+
+params:
+ LEN: 8K # [KM] length of buffer to read or write
+ PACKET: TCP # [TCP|UDP] packet type
+ TIME: 20 # time in seconds to transmit for
+
+run:
+ steps:
+ - ./common/scripts/iperf-$(lava-role).sh ${LEN} ${PACKET} ${TIME}
+
+parse:
+ pattern: '^(?P<test_case_id>[a-zA-Z]+):\s*(?P<measurement>[0-9.]+)\s+(?P<units>[\w\/]+)\s+(?P<result>pass)'
diff --git a/ubuntu/iperf.yaml b/ubuntu/iperf.yaml
new file mode 100644
index 0000000..cc8f65d
--- /dev/null
+++ b/ubuntu/iperf.yaml
@@ -0,0 +1,32 @@
+metadata:
+ format: Lava-Test Test Definition 1.0
+ name: iperf-multinode
+ description:
+ "Basic MultiNode iperf test on server/client side.
+ The roles in the test job must be server & client"
+ maintainer:
+ - arthur.she@linaro.org
+ os:
+ - ubuntu
+ scope:
+ - performance
+ devices:
+ - kvm
+ - arndale
+ - beaglebone-black
+
+install:
+ deps:
+ - iperf
+
+params:
+ LEN: 8K # [KM] length of buffer to read or write
+ PACKET: TCP # [TCP|UDP] packet type
+ TIME: 20 # time in seconds to transmit for
+
+run:
+ steps:
+ - ./common/scripts/iperf-$(lava-role).sh ${LEN} ${PACKET} ${TIME}
+
+parse:
+ pattern: '^(?P<test_case_id>[a-zA-Z]+):\s*(?P<measurement>[0-9.]+)\s+(?P<units>[\w\/]+)\s+(?P<result>pass)'