diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:25:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:25:49 +0000 |
commit | 04fc174d50fd19d6ae78fd2fd2faae221acff807 (patch) | |
tree | 23e5482ac4eb332df0fc69bf932118f0d4e42eb0 /t | |
parent | Adding upstream version 2.1.9+dfsg. (diff) | |
download | iperf-upstream.tar.xz iperf-upstream.zip |
Adding upstream version 2.2.0+dfsg.upstream/2.2.0+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 't')
-rw-r--r-- | t/base.sh | 16 | ||||
-rwxr-xr-x | t/t14_udp_triptimes.sh | 12 | ||||
-rwxr-xr-x | t/t15_udp_enhanced.sh | 12 | ||||
-rwxr-xr-x | t/t16_udp_histograms.sh | 13 |
4 files changed, 48 insertions, 5 deletions
@@ -17,17 +17,20 @@ run_iperf() { mode=server server=(-s) client=(-c) + match="" # Split server and client args lists - for a; do - case $a in + while [ $# -gt 0 ]; do + case $1 in (-c) mode=client;; (-s) mode=server;; + (-match) shift; match=$1;; (*) case $mode in - (server) server+=($a);; - (client) client+=($a);; + (server) server+=($1);; + (client) client+=($1);; esac esac + shift done # Start server # Wait for "listening" @@ -43,5 +46,8 @@ run_iperf() { if [[ "$results" =~ unrecognized|ignoring|failed|not\ valid ]]; then exit 1 fi + if [[ -n "$match" && ! ("$results" =~ "$match") ]]; then + exit 1 + fi + exit 0 } - diff --git a/t/t14_udp_triptimes.sh b/t/t14_udp_triptimes.sh new file mode 100755 index 0000000..9fcac04 --- /dev/null +++ b/t/t14_udp_triptimes.sh @@ -0,0 +1,12 @@ +#!/bin/bash -e +. $(dirname $0)/base.sh + +# usage: +# run_iperf -s server args -c client args +# +# client args should contain $ip or -V $ip6 +# results returned in $results + +run_iperf \ + -s -P 1 -u -i 1 -t 3 \ + -c $ip -P 1 -u -b 10m -i 1 -t 2 --trip-times diff --git a/t/t15_udp_enhanced.sh b/t/t15_udp_enhanced.sh new file mode 100755 index 0000000..4706c50 --- /dev/null +++ b/t/t15_udp_enhanced.sh @@ -0,0 +1,12 @@ +#!/bin/bash -e +. $(dirname $0)/base.sh + +# usage: +# run_iperf -s server args -c client args +# +# client args should contain $ip or -V $ip6 +# results returned in $results + +run_iperf \ + -s -P 1 -u -i 1 -t 3 -e \ + -c $ip -P 1 -u -b 10m -i 1 -t 2 -e diff --git a/t/t16_udp_histograms.sh b/t/t16_udp_histograms.sh new file mode 100755 index 0000000..a23e072 --- /dev/null +++ b/t/t16_udp_histograms.sh @@ -0,0 +1,13 @@ +#!/bin/bash -e +. $(dirname $0)/base.sh + +# usage: +# run_iperf -s server args -c client args +# +# client args should contain $ip or -V $ip6 +# results returned in $results + +run_iperf \ + -match "T8(f)-PDF:" \ + -s -P 1 -u -i 1 -t 3 --histograms \ + -c $ip -P 1 -u -b 10m -i 1 -t 2 --trip-times |