diff options
author | Arthur She <arthur.she@linaro.org> | 2014-11-14 10:55:13 -0800 |
---|---|---|
committer | Milosz Wasilewski <milosz.wasilewski@linaro.org> | 2014-11-24 13:41:08 +0000 |
commit | 0129466fa55ee57c20560e3fc6230cbdf4edb752 (patch) | |
tree | d3e1034a7c4a7ff23fb42a9291f97c49b9df2964 /common/scripts | |
parent | 274266f597e9a4f05f69fa8ae5e9aaecd1718ce1 (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
Diffstat (limited to 'common/scripts')
-rwxr-xr-x | common/scripts/iperf-client.sh | 23 | ||||
-rwxr-xr-x | common/scripts/iperf-server.sh | 20 |
2 files changed, 43 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` |