[PATCH mptcp-next v2] Squash to "selftests: mptcp: add mptcp_lib_get_counter"

Geliang Tang posted 1 patch 5 months, 3 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/multipath-tcp/mptcp_net-next tags/patchew/a345cc5ff04729307b7b5b3a26f81e4e653dbefb.1699408002.git.geliang.tang@suse.com
Maintainers: Matthieu Baerts <matttbe@kernel.org>, Mat Martineau <martineau@kernel.org>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Shuah Khan <shuah@kernel.org>
tools/testing/selftests/net/mptcp/userspace_pm.sh | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
[PATCH mptcp-next v2] Squash to "selftests: mptcp: add mptcp_lib_get_counter"
Posted by Geliang Tang 5 months, 3 weeks ago
Please add this line into the commit log:

'''
Use this helper in test_prio() in userspace_pm.sh too instead of
open-coding.
'''

Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
 v2:
 - add test_skip
---
 tools/testing/selftests/net/mptcp/userspace_pm.sh | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/tools/testing/selftests/net/mptcp/userspace_pm.sh b/tools/testing/selftests/net/mptcp/userspace_pm.sh
index f9156f544ebf..6167837f48e1 100755
--- a/tools/testing/selftests/net/mptcp/userspace_pm.sh
+++ b/tools/testing/selftests/net/mptcp/userspace_pm.sh
@@ -874,9 +874,10 @@ test_prio()
 
 	# Check TX
 	print_test "MP_PRIO TX"
-	count=$(ip netns exec "$ns2" nstat -as | grep MPTcpExtMPPrioTx | awk '{print $2}')
-	[ -z "$count" ] && count=0
-	if [ $count != 1 ]; then
+	count=$(mptcp_lib_get_counter "$ns2" "MPTcpExtMPPrioTx")
+	if [ -z "$count" ]; then
+		test_skip
+	elif [ $count != 1 ]; then
 		test_fail "Count != 1: ${count}"
 	else
 		test_pass
@@ -884,9 +885,10 @@ test_prio()
 
 	# Check RX
 	print_test "MP_PRIO RX"
-	count=$(ip netns exec "$ns1" nstat -as | grep MPTcpExtMPPrioRx | awk '{print $2}')
-	[ -z "$count" ] && count=0
-	if [ $count != 1 ]; then
+	count=$(mptcp_lib_get_counter "$ns1" "MPTcpExtMPPrioRx")
+	if [ -z "$count" ]; then
+		test_skip
+	elif [ $count != 1 ]; then
 		test_fail "Count != 1: ${count}"
 	else
 		test_pass
-- 
2.35.3
Re: [PATCH mptcp-next v2] Squash to "selftests: mptcp: add mptcp_lib_get_counter"
Posted by Matthieu Baerts 5 months, 3 weeks ago
Hi Geliang,

On 08/11/2023 02:47, Geliang Tang wrote:
> Please add this line into the commit log:
> 
> '''
> Use this helper in test_prio() in userspace_pm.sh too instead of
> open-coding.
> '''

Thank you for the new version. It looks good to me!

New patches for t/upstream:
- e26f5d7bb384: Squash to "selftests: mptcp: add mptcp_lib_get_counter"
- 0b2fef7131ad: tg:msg: update after the recent squash-to patch
- Results: 15e4d31937fc..4d89b70d7306 (export)

Tests are now in progress:

https://cirrus-ci.com/github/multipath-tcp/mptcp_net-next/export/20231108T104316

Cheers,
Matt