From: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
To: MPTCP Upstream <mptcp@lists.linux.dev>
Cc: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
Subject: [PATCH mptcp-next 1/2] selftests: mptcp: join: do_transfer: reduce code dup
Date: Thu, 09 Oct 2025 19:33:24 +0200 [thread overview]
Message-ID: <20251009-bind-extra-listen-v1-1-5ad2077d77a9@kernel.org> (raw)
In-Reply-To: <20251009-bind-extra-listen-v1-0-5ad2077d77a9@kernel.org>
The same extra long command is present twice, with one small different:
the var for the stdin file is different.
Use a new dedicated var in one command to avoid this code duplication.
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
tools/testing/selftests/net/mptcp/mptcp_join.sh | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index c90d8e8b95cb..c5169020a515 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -951,6 +951,7 @@ do_transfer()
local FAILING_LINKS=${FAILING_LINKS:-""}
local fastclose=${fastclose:-""}
local speed=${speed:-"fast"}
+ local in="${sin}"
port=$(get_port)
:> "$cout"
@@ -999,16 +1000,12 @@ do_transfer()
extra_srv_args="$extra_args $extra_srv_args"
if [ "$test_linkfail" -gt 1 ];then
- timeout ${timeout_test} \
- ip netns exec ${listener_ns} \
- ./mptcp_connect -t ${timeout_poll} -l -p $port -s ${srv_proto} \
- $extra_srv_args "::" < "$sinfail" > "$sout" &
- else
- timeout ${timeout_test} \
- ip netns exec ${listener_ns} \
- ./mptcp_connect -t ${timeout_poll} -l -p $port -s ${srv_proto} \
- $extra_srv_args "::" < "$sin" > "$sout" &
+ in="${sinfail}"
fi
+ timeout ${timeout_test} \
+ ip netns exec ${listener_ns} \
+ ./mptcp_connect -t ${timeout_poll} -l -p ${port} -s ${srv_proto} \
+ ${extra_srv_args} "::" < "${in}" > "${sout}" &
local spid=$!
mptcp_lib_wait_local_port_listen "${listener_ns}" "${port}"
--
2.51.0
next prev parent reply other threads:[~2025-10-09 17:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-09 17:33 [PATCH mptcp-next 0/2] selftests: mptcp: join: code dup + new 'bind' tests Matthieu Baerts (NGI0)
2025-10-09 17:33 ` Matthieu Baerts (NGI0) [this message]
2025-10-10 10:19 ` [PATCH mptcp-next 1/2] selftests: mptcp: join: do_transfer: reduce code dup Geliang Tang
2025-10-09 17:33 ` [PATCH mptcp-next 2/2] selftests: mptcp: join: validate extra bind cases Matthieu Baerts (NGI0)
2025-10-14 6:46 ` Geliang Tang
2025-10-14 9:57 ` Matthieu Baerts
2025-10-14 10:14 ` Geliang Tang
2025-10-09 18:48 ` [PATCH mptcp-next 0/2] selftests: mptcp: join: code dup + new 'bind' tests MPTCP CI
2025-10-14 10:43 ` Matthieu Baerts
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251009-bind-extra-listen-v1-1-5ad2077d77a9@kernel.org \
--to=matttbe@kernel.org \
--cc=mptcp@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.