* [PATCH] test/perf: Simplify iperf3 server lifetime management
@ 2025-03-12 5:26 David Gibson
2025-03-12 23:04 ` Stefano Brivio
0 siblings, 1 reply; 2+ messages in thread
From: David Gibson @ 2025-03-12 5:26 UTC (permalink / raw)
To: Stefano Brivio, passt-dev; +Cc: David Gibson
After we start the iperf3 server in the background, we have a sleep to
make sure it's ready to receive connections. We can simplify this slightly
by using the -D option to have iperf3 background itself rather than
backgrounding it manually. That won't return until the server is ready to
use.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
test/lib/test | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/test/lib/test b/test/lib/test
index 758250a2..73496741 100755
--- a/test/lib/test
+++ b/test/lib/test
@@ -20,10 +20,7 @@ test_iperf3s() {
__sctx="${1}"
__port="${2}"
- pane_or_context_run_bg "${__sctx}" \
- 'iperf3 -s -p'${__port}' & echo $! > s.pid' \
-
- sleep 1 # Wait for server to be ready
+ pane_or_context_run "${__sctx}" 'iperf3 -s -p'${__port}' -D -I s.pid'
}
# test_iperf3k() - Kill iperf3 server
@@ -31,7 +28,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)'
sleep 1 # Wait for kernel to free up ports
}
--
@@ -20,10 +20,7 @@ test_iperf3s() {
__sctx="${1}"
__port="${2}"
- pane_or_context_run_bg "${__sctx}" \
- 'iperf3 -s -p'${__port}' & echo $! > s.pid' \
-
- sleep 1 # Wait for server to be ready
+ pane_or_context_run "${__sctx}" 'iperf3 -s -p'${__port}' -D -I s.pid'
}
# test_iperf3k() - Kill iperf3 server
@@ -31,7 +28,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)'
sleep 1 # Wait for kernel to free up ports
}
--
2.48.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] test/perf: Simplify iperf3 server lifetime management
2025-03-12 5:26 [PATCH] test/perf: Simplify iperf3 server lifetime management David Gibson
@ 2025-03-12 23:04 ` Stefano Brivio
0 siblings, 0 replies; 2+ messages in thread
From: Stefano Brivio @ 2025-03-12 23:04 UTC (permalink / raw)
To: David Gibson; +Cc: passt-dev
On Wed, 12 Mar 2025 16:26:57 +1100
David Gibson <david@gibson.dropbear.id.au> wrote:
> After we start the iperf3 server in the background, we have a sleep to
> make sure it's ready to receive connections. We can simplify this slightly
> by using the -D option to have iperf3 background itself rather than
> backgrounding it manually. That won't return until the server is ready to
> use.
>
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Applied.
--
Stefano
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-03-12 23:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-12 5:26 [PATCH] test/perf: Simplify iperf3 server lifetime management David Gibson
2025-03-12 23:04 ` Stefano Brivio
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).