aboutgitcodebugslistschat
path: root/test/lib
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2024-07-24 22:40:32 +0200
committerStefano Brivio <sbrivio@redhat.com>2024-07-25 12:30:38 +0200
commitf72d35a78d4436c662cfafbceb829144cd4011fd (patch)
treefdc1b66d52152128ca4ad89d945a1d4399039971 /test/lib
parent606e0c7b95b64ab2352decca00e47455660f77c2 (diff)
downloadpasst-f72d35a78d4436c662cfafbceb829144cd4011fd.tar
passt-f72d35a78d4436c662cfafbceb829144cd4011fd.tar.gz
passt-f72d35a78d4436c662cfafbceb829144cd4011fd.tar.bz2
passt-f72d35a78d4436c662cfafbceb829144cd4011fd.tar.lz
passt-f72d35a78d4436c662cfafbceb829144cd4011fd.tar.xz
passt-f72d35a78d4436c662cfafbceb829144cd4011fd.tar.zst
passt-f72d35a78d4436c662cfafbceb829144cd4011fd.zip
test: iperf3 3.16 introduces multiple threads, drop our own implementation of that
Starting from iperf3 version 3.16, -P / --parallel spawns multiple clients as separate threads, instead of multiple streams serviced by the same thread. So we can drop our lib/test implementation to spawn several iperf3 client and server processes and finally simplify things quite a bit. Adjust number of threads and UDP sending bandwidth to values that seem to be more or less matching previous throughput tests on my setup. Signed-off-by: Stefano Brivio <sbrivio@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Tested-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'test/lib')
-rwxr-xr-xtest/lib/perf_report2
-rwxr-xr-xtest/lib/test31
2 files changed, 10 insertions, 23 deletions
diff --git a/test/lib/perf_report b/test/lib/perf_report
index 67f9f4e..4d79fa2 100755
--- a/test/lib/perf_report
+++ b/test/lib/perf_report
@@ -18,7 +18,7 @@ PERF_LINK_COUNT=0
PERF_JS="${LOGDIR}/web/perf.js"
PERF_TEMPLATE_HTML="document.write('"'
-Throughput in Gbps, latency in µs. Threads are <span style="font-family: monospace;">iperf3</span> processes, <i>passt</i> and <i>pasta</i> are currently single-threaded.<br/>
+Throughput in Gbps, latency in µs. Threads are <span style="font-family: monospace;">iperf3</span> threads, <i>passt</i> and <i>pasta</i> are currently single-threaded.<br/>
Click on numbers to show test execution. Measured at head, commit <span style="font-family: monospace;">__commit__</span>.
<style type="text/CSS">
diff --git a/test/lib/test b/test/lib/test
index 1d571c3..c525f8e 100755
--- a/test/lib/test
+++ b/test/lib/test
@@ -15,18 +15,13 @@
# test_iperf3s() - Start iperf3 server
# $1: Destination/server context
-# $2: Port number, ${i} is translated to process index
-# $3: Number of processes to run in parallel
+# $2: Port number
test_iperf3s() {
__sctx="${1}"
__port="${2}"
- __procs="$((${3} - 1))"
pane_or_context_run_bg "${__sctx}" \
- 'for i in $(seq 0 '${__procs}'); do' \
- ' iperf3 -s -p'${__port}' &' \
- ' echo $! > s${i}.pid; ' \
- 'done' \
+ 'iperf3 -s -p'${__port}' & echo $! > s.pid' \
sleep 1 # Wait for server to be ready
}
@@ -36,7 +31,7 @@ test_iperf3s() {
test_iperf3k() {
__sctx="${1}"
- pane_or_context_run "${__sctx}" 'kill -INT $(cat s*.pid); rm s*.pid'
+ pane_or_context_run "${__sctx}" 'kill -INT $(cat s.pid); rm s.pid'
sleep 3 # Wait for kernel to free up ports
}
@@ -46,37 +41,29 @@ test_iperf3k() {
# $2: Source/client context
# $3: Destination name or address for client
# $4: Port number, ${i} is translated to process index
-# $5: Number of processes to run in parallel
-# $6: Run time, in seconds
+# $5: Run time, in seconds
# $@: Client options
test_iperf3() {
__var="${1}"; shift
__cctx="${1}"; shift
__dest="${1}"; shift
__port="${1}"; shift
- __procs="$((${1} - 1))"; shift
__time="${1}"; shift
- pane_or_context_run "${__cctx}" 'rm -f c*.json'
+ pane_or_context_run "${__cctx}" 'rm -f c.json'
# A 1s wait for connection on what's basically a local link
# indicates something is pretty wrong
__timeout=1000
pane_or_context_run "${__cctx}" \
- '(' \
- ' for i in $(seq 0 '${__procs}'); do' \
- ' iperf3 -J -c '${__dest}' -p '${__port} \
- ' --connect-timeout '${__timeout} \
- ' -t'${__time}' -i0 -T c${i} '"${@}" \
- ' > c${i}.json &' \
- ' done;' \
- ' wait' \
- ')'
+ 'iperf3 -J -c '${__dest}' -p '${__port} \
+ ' --connect-timeout '${__timeout} \
+ ' -t'${__time}' -i0 '"${@}"' > c.json' \
__jval=".end.sum_received.bits_per_second"
__bw=$(pane_or_context_output "${__cctx}" \
- 'cat c*.json | jq -rMs "map('${__jval}') | add"')
+ 'cat c.json | jq -rMs "map('${__jval}') | add"')
TEST_ONE_subs="$(list_add_pair "${TEST_ONE_subs}" "__${__var}__" "${__bw}" )"
}