[PATCH mptcp-net v3 5/5] selftests: mptcp: connect: print pcap suffix

Matthieu Baerts (NGI0) posted 5 patches 1 week ago
[PATCH mptcp-net v3 5/5] selftests: mptcp: connect: print pcap suffix
Posted by Matthieu Baerts (NGI0) 1 week ago
To be able to find which capture files have been produced after several
runs.

This suffix was not printed anywhere before.

While at it, always use the same prefix by taking info from ns1, instead
of "$connector_ns", which is sometimes ns1, sometimes ns2 in the
subtests.

Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
 tools/testing/selftests/net/mptcp/mptcp_connect.sh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.sh b/tools/testing/selftests/net/mptcp/mptcp_connect.sh
index c2ab9f7f0d2133559bb18ce884b613d21d1ec5f0..47ecb5b3836eb5c64787bda0f6f1cc7c3af338aa 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_connect.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_connect.sh
@@ -211,6 +211,11 @@ if $checksum; then
 	done
 fi
 
+if $capture; then
+	rndh="${ns1:4}"
+	mptcp_lib_pr_info "Packet capture files will have this prefix: ${rndh}-"
+fi
+
 set_ethtool_flags() {
 	local ns="$1"
 	local dev="$2"
@@ -361,7 +366,6 @@ do_transfer()
 
 	if $capture; then
 		local capuser
-		local rndh="${connector_ns:4}"
 		if [ -z $SUDO_USER ] ; then
 			capuser=""
 		else

-- 
2.51.0
Re: [PATCH mptcp-net v3 5/5] selftests: mptcp: connect: print pcap suffix
Posted by Mat Martineau 6 days, 21 hours ago
On Wed, 10 Sep 2025, Matthieu Baerts (NGI0) wrote:

> To be able to find which capture files have been produced after several
> runs.
>
> This suffix was not printed anywhere before.
>

One quick change before upstreaming: s/suffix/prefix/

Otherwise LGTM:

Reviewed-by: Mat Martineau <martineau@kernel.org>

> While at it, always use the same prefix by taking info from ns1, instead
> of "$connector_ns", which is sometimes ns1, sometimes ns2 in the
> subtests.
>
> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
> ---
> tools/testing/selftests/net/mptcp/mptcp_connect.sh | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.sh b/tools/testing/selftests/net/mptcp/mptcp_connect.sh
> index c2ab9f7f0d2133559bb18ce884b613d21d1ec5f0..47ecb5b3836eb5c64787bda0f6f1cc7c3af338aa 100755
> --- a/tools/testing/selftests/net/mptcp/mptcp_connect.sh
> +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.sh
> @@ -211,6 +211,11 @@ if $checksum; then
> 	done
> fi
>
> +if $capture; then
> +	rndh="${ns1:4}"
> +	mptcp_lib_pr_info "Packet capture files will have this prefix: ${rndh}-"
> +fi
> +
> set_ethtool_flags() {
> 	local ns="$1"
> 	local dev="$2"
> @@ -361,7 +366,6 @@ do_transfer()
>
> 	if $capture; then
> 		local capuser
> -		local rndh="${connector_ns:4}"
> 		if [ -z $SUDO_USER ] ; then
> 			capuser=""
> 		else
>
> -- 
> 2.51.0
>
>
>