summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:25:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:25:49 +0000
commit04fc174d50fd19d6ae78fd2fd2faae221acff807 (patch)
tree23e5482ac4eb332df0fc69bf932118f0d4e42eb0 /t
parentAdding upstream version 2.1.9+dfsg. (diff)
downloadiperf-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.sh16
-rwxr-xr-xt/t14_udp_triptimes.sh12
-rwxr-xr-xt/t15_udp_enhanced.sh12
-rwxr-xr-xt/t16_udp_histograms.sh13
4 files changed, 48 insertions, 5 deletions
diff --git a/t/base.sh b/t/base.sh
index 097a995..eee1878 100644
--- a/t/base.sh
+++ b/t/base.sh
@@ -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