All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
To: mptcp@lists.linux.dev, Mat Martineau <martineau@kernel.org>,
	 Geliang Tang <geliang@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	 Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	 Paolo Abeni <pabeni@redhat.com>,
	Davide Caratti <dcaratti@redhat.com>,
	 Shuah Khan <shuah@kernel.org>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	 linux-kselftest@vger.kernel.org,
	 "Matthieu Baerts (NGI0)" <matttbe@kernel.org>,
	stable@vger.kernel.org
Subject: [PATCH net 12/13] selftests: mptcp: diag: unique 'in use' subtest names
Date: Thu, 15 Feb 2024 19:25:39 +0100	[thread overview]
Message-ID: <20240215-upstream-net-20240215-misc-fixes-v1-12-8c01a55d8f6a@kernel.org> (raw)
In-Reply-To: <20240215-upstream-net-20240215-misc-fixes-v1-0-8c01a55d8f6a@kernel.org>

It is important to have a unique (sub)test name in TAP, because some CI
environments drop tests with duplicated name.

Some 'in use' subtests from the diag selftest had the same names, e.g.:

    chk 0 msk in use after flush

Now the previous value is taken, to have different names, e.g.:

    chk 2->0 msk in use after flush

While at it, avoid repeating the full message, declare it once in the
helper.

Fixes: ce9902573652 ("selftests: mptcp: diag: format subtests results in TAP")
Cc: stable@vger.kernel.org
Reviewed-by: Geliang Tang <geliang@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
 tools/testing/selftests/net/mptcp/diag.sh | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/tools/testing/selftests/net/mptcp/diag.sh b/tools/testing/selftests/net/mptcp/diag.sh
index e0615c6ffb8d..266656a16229 100755
--- a/tools/testing/selftests/net/mptcp/diag.sh
+++ b/tools/testing/selftests/net/mptcp/diag.sh
@@ -166,9 +166,13 @@ chk_msk_listen()
 chk_msk_inuse()
 {
 	local expected=$1
-	local msg="$2"
+	local msg="....chk ${2:-${expected}} msk in use"
 	local listen_nr
 
+	if [ "${expected}" -eq 0 ]; then
+		msg+=" after flush"
+	fi
+
 	listen_nr=$(ss -N "${ns}" -Ml | grep -c LISTEN)
 	expected=$((expected + listen_nr))
 
@@ -179,7 +183,7 @@ chk_msk_inuse()
 		sleep 0.1
 	done
 
-	__chk_nr get_msk_inuse $expected "$msg" 0
+	__chk_nr get_msk_inuse $expected "${msg}" 0
 }
 
 # $1: cestab nr
@@ -227,11 +231,11 @@ wait_connected $ns 10000
 chk_msk_nr 2 "after MPC handshake "
 chk_msk_remote_key_nr 2 "....chk remote_key"
 chk_msk_fallback_nr 0 "....chk no fallback"
-chk_msk_inuse 2 "....chk 2 msk in use"
+chk_msk_inuse 2
 chk_msk_cestab 2
 flush_pids
 
-chk_msk_inuse 0 "....chk 0 msk in use after flush"
+chk_msk_inuse 0 "2->0"
 chk_msk_cestab 0
 
 echo "a" | \
@@ -247,11 +251,11 @@ echo "b" | \
 				127.0.0.1 >/dev/null &
 wait_connected $ns 10001
 chk_msk_fallback_nr 1 "check fallback"
-chk_msk_inuse 1 "....chk 1 msk in use"
+chk_msk_inuse 1
 chk_msk_cestab 1
 flush_pids
 
-chk_msk_inuse 0 "....chk 0 msk in use after flush"
+chk_msk_inuse 0 "1->0"
 chk_msk_cestab 0
 
 NR_CLIENTS=100
@@ -273,11 +277,11 @@ for I in `seq 1 $NR_CLIENTS`; do
 done
 
 wait_msk_nr $((NR_CLIENTS*2)) "many msk socket present"
-chk_msk_inuse $((NR_CLIENTS*2)) "....chk many msk in use"
+chk_msk_inuse $((NR_CLIENTS*2)) "many"
 chk_msk_cestab $((NR_CLIENTS*2))
 flush_pids
 
-chk_msk_inuse 0 "....chk 0 msk in use after flush"
+chk_msk_inuse 0 "many->0"
 chk_msk_cestab 0
 
 mptcp_lib_result_print_all_tap

-- 
2.43.0


  parent reply	other threads:[~2024-02-15 18:26 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-15 18:25 [PATCH net 00/13] mptcp: misc. fixes for v6.8 Matthieu Baerts (NGI0)
2024-02-15 18:25 ` [PATCH net 01/13] mptcp: add needs_id for userspace appending addr Matthieu Baerts (NGI0)
2024-02-15 18:25 ` [PATCH net 02/13] mptcp: add needs_id for netlink " Matthieu Baerts (NGI0)
2024-02-15 18:25 ` [PATCH net 03/13] mptcp: fix lockless access in subflow ULP diag Matthieu Baerts (NGI0)
2024-02-19 17:21   ` Eric Dumazet
2024-02-19 17:35     ` Eric Dumazet
2024-02-19 18:04       ` Paolo Abeni
2024-02-19 18:33         ` Eric Dumazet
2024-02-20 17:33           ` Paolo Abeni
2024-02-20 18:03             ` Eric Dumazet
2024-02-15 18:25 ` [PATCH net 04/13] mptcp: fix data races on local_id Matthieu Baerts (NGI0)
2024-02-15 18:25 ` [PATCH net 05/13] mptcp: fix data races on remote_id Matthieu Baerts (NGI0)
2024-02-15 18:25 ` [PATCH net 06/13] mptcp: fix duplicate subflow creation Matthieu Baerts (NGI0)
2024-02-15 18:25 ` [PATCH net 07/13] selftests: mptcp: pm nl: also list skipped tests Matthieu Baerts (NGI0)
2024-02-15 18:25 ` [PATCH net 08/13] selftests: mptcp: pm nl: avoid error msg on older kernels Matthieu Baerts (NGI0)
2024-02-15 18:25 ` [PATCH net 09/13] selftests: mptcp: diag: fix bash warnings " Matthieu Baerts (NGI0)
2024-02-15 18:25 ` [PATCH net 10/13] selftests: mptcp: simult flows: fix some subtest names Matthieu Baerts (NGI0)
2024-02-15 18:25 ` [PATCH net 11/13] selftests: mptcp: userspace_pm: unique " Matthieu Baerts (NGI0)
2024-02-15 18:25 ` Matthieu Baerts (NGI0) [this message]
2024-02-15 18:25 ` [PATCH net 13/13] selftests: mptcp: diag: unique 'cestab' " Matthieu Baerts (NGI0)
2024-02-18 10:30 ` [PATCH net 00/13] mptcp: misc. fixes for v6.8 patchwork-bot+netdevbpf

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=20240215-upstream-net-20240215-misc-fixes-v1-12-8c01a55d8f6a@kernel.org \
    --to=matttbe@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dcaratti@redhat.com \
    --cc=edumazet@google.com \
    --cc=geliang@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=martineau@kernel.org \
    --cc=mptcp@lists.linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shuah@kernel.org \
    --cc=stable@vger.kernel.org \
    /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.