MPTCP Linux Development
 help / color / mirror / Atom feed
* [RESEND PATCH mptcp-next] selftests: mptcp: join: simplify checksum_tests
@ 2024-07-28  3:49 Geliang Tang
  2024-07-28  4:40 ` MPTCP CI
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Geliang Tang @ 2024-07-28  3:49 UTC (permalink / raw)
  To: mptcp; +Cc: Geliang Tang

From: Geliang Tang <tanggeliang@kylinos.cn>

The four checksum tests are similar, only one line is different. So
a for-loop can be used to simplify these tests.

Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
RESEND:
 - update the email address.
---
 .../testing/selftests/net/mptcp/mptcp_join.sh | 43 +++++--------------
 1 file changed, 11 insertions(+), 32 deletions(-)

diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index 4df48f1f14ab..63b29504e547 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -337,7 +337,7 @@ reset_with_checksum()
 	local ns1_enable=$1
 	local ns2_enable=$2
 
-	reset "checksum test ${1} ${2}" || return 1
+	reset "checksum test ${ns1_enable} ${ns2_enable}" || return 1
 
 	ip netns exec $ns1 sysctl -q net.mptcp.checksum_enabled=$ns1_enable
 	ip netns exec $ns2 sysctl -q net.mptcp.checksum_enabled=$ns2_enable
@@ -2912,37 +2912,16 @@ syncookies_tests()
 
 checksum_tests()
 {
-	# checksum test 0 0
-	if reset_with_checksum 0 0; then
-		pm_nl_set_limits $ns1 0 1
-		pm_nl_set_limits $ns2 0 1
-		run_tests $ns1 $ns2 10.0.1.1
-		chk_join_nr 0 0 0
-	fi
-
-	# checksum test 1 1
-	if reset_with_checksum 1 1; then
-		pm_nl_set_limits $ns1 0 1
-		pm_nl_set_limits $ns2 0 1
-		run_tests $ns1 $ns2 10.0.1.1
-		chk_join_nr 0 0 0
-	fi
-
-	# checksum test 0 1
-	if reset_with_checksum 0 1; then
-		pm_nl_set_limits $ns1 0 1
-		pm_nl_set_limits $ns2 0 1
-		run_tests $ns1 $ns2 10.0.1.1
-		chk_join_nr 0 0 0
-	fi
-
-	# checksum test 1 0
-	if reset_with_checksum 1 0; then
-		pm_nl_set_limits $ns1 0 1
-		pm_nl_set_limits $ns2 0 1
-		run_tests $ns1 $ns2 10.0.1.1
-		chk_join_nr 0 0 0
-	fi
+	local checksum_enable
+	for checksum_enable in "0 0" "1 1" "0 1" "1 0"; do
+		# checksum test 0 0, 1 1, 0 1, 1 0
+		if reset_with_checksum ${checksum_enable}; then
+			pm_nl_set_limits $ns1 0 1
+			pm_nl_set_limits $ns2 0 1
+			run_tests $ns1 $ns2 10.0.1.1
+			chk_join_nr 0 0 0
+		fi
+	done
 }
 
 deny_join_id0_tests()
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [RESEND PATCH mptcp-next] selftests: mptcp: join: simplify checksum_tests
  2024-07-28  3:49 [RESEND PATCH mptcp-next] selftests: mptcp: join: simplify checksum_tests Geliang Tang
@ 2024-07-28  4:40 ` MPTCP CI
  2024-07-29 10:21 ` Matthieu Baerts
  2024-07-29 10:44 ` Matthieu Baerts
  2 siblings, 0 replies; 4+ messages in thread
From: MPTCP CI @ 2024-07-28  4:40 UTC (permalink / raw)
  To: Geliang Tang; +Cc: mptcp

Hi Geliang,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

- KVM Validation: normal: Success! ✅
- KVM Validation: debug: Success! ✅
- KVM Validation: btf (only bpftest_all): Success! ✅
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/10128796339

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/741a7b014af5
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=874289


If there are some issues, you can reproduce them using the same environment as
the one used by the CI thanks to a docker image, e.g.:

    $ cd [kernel source code]
    $ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
        --pull always mptcp/mptcp-upstream-virtme-docker:latest \
        auto-normal

For more details:

    https://github.com/multipath-tcp/mptcp-upstream-virtme-docker


Please note that despite all the efforts that have been already done to have a
stable tests suite when executed on a public CI like here, it is possible some
reported issues are not due to your modifications. Still, do not hesitate to
help us improve that ;-)

Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RESEND PATCH mptcp-next] selftests: mptcp: join: simplify checksum_tests
  2024-07-28  3:49 [RESEND PATCH mptcp-next] selftests: mptcp: join: simplify checksum_tests Geliang Tang
  2024-07-28  4:40 ` MPTCP CI
@ 2024-07-29 10:21 ` Matthieu Baerts
  2024-07-29 10:44 ` Matthieu Baerts
  2 siblings, 0 replies; 4+ messages in thread
From: Matthieu Baerts @ 2024-07-29 10:21 UTC (permalink / raw)
  To: Geliang Tang, mptcp; +Cc: Geliang Tang

Hi Geliang,

On 28/07/2024 05:49, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
> 
> The four checksum tests are similar, only one line is different. So
> a for-loop can be used to simplify these tests.

I usually prefer distinct tests, if we want to extend them, or easily
check something else, but these checksum tests are a bit particular.

Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RESEND PATCH mptcp-next] selftests: mptcp: join: simplify checksum_tests
  2024-07-28  3:49 [RESEND PATCH mptcp-next] selftests: mptcp: join: simplify checksum_tests Geliang Tang
  2024-07-28  4:40 ` MPTCP CI
  2024-07-29 10:21 ` Matthieu Baerts
@ 2024-07-29 10:44 ` Matthieu Baerts
  2 siblings, 0 replies; 4+ messages in thread
From: Matthieu Baerts @ 2024-07-29 10:44 UTC (permalink / raw)
  To: Geliang Tang, mptcp; +Cc: Geliang Tang

Hi Geliang,

On 28/07/2024 05:49, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
> 
> The four checksum tests are similar, only one line is different. So
> a for-loop can be used to simplify these tests.

Thank you for the patch. Now in our tree:

New patches for t/upstream:
- 58ec41767aea: selftests: mptcp: join: simplify checksum_tests
- Results: 65e9f14d80cb..005b14c6d7b9 (export)

Tests are now in progress:

- export:
https://github.com/multipath-tcp/mptcp_net-next/commit/7812921044e786f1d6fdf3c896dcbadcdf6fec16/checks

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-07-29 10:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-28  3:49 [RESEND PATCH mptcp-next] selftests: mptcp: join: simplify checksum_tests Geliang Tang
2024-07-28  4:40 ` MPTCP CI
2024-07-29 10:21 ` Matthieu Baerts
2024-07-29 10:44 ` Matthieu Baerts

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox