From: Matthieu Baerts <matttbe@kernel.org>
To: Geliang Tang <geliang@kernel.org>, mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp-next v3 3/8] selftests: mptcp: join: reduce join_nr params
Date: Thu, 8 Aug 2024 12:22:19 +0200 [thread overview]
Message-ID: <2743512d-4772-4e42-9abd-6849c36f1885@kernel.org> (raw)
In-Reply-To: <23fc6138bd31d81783683cf041fbf75e8280a204.camel@kernel.org>
Hi Geliang,
On 08/08/2024 05:28, Geliang Tang wrote:
> On Tue, 2024-08-06 at 13:18 +0200, Matthieu Baerts (NGI0) wrote:
>> chk_join_nr() currently takes 9 positional parameters, 6 of them are
>> optional. It makes it hard to read:
>>
>> chk_join_nr 1 1 1 1 0 1 1 0 4
>>
>> Naming these vars helps to make it easier to read:
>>
>> join_csum_ns1=1 join_csum_ns2=0 \
>> join_fail_nr=1 join_rst_nr=1 join_infi_nr=0 \
>> join_corrupted_pkts=4 \
>> chk_join_nr 1 1 1
>>
>> It will then be easier to add new optional parameters.
>>
>> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
>> ---
>> tools/testing/selftests/net/mptcp/mptcp_join.sh | 31
>> ++++++++++++++++++-------
>> 1 file changed, 22 insertions(+), 9 deletions(-)
>>
>> diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh
>> b/tools/testing/selftests/net/mptcp/mptcp_join.sh
>> index a1f80dac59a7..0401ba1aaf1b 100755
>> --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
>> +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
>> @@ -61,6 +61,12 @@ unset sflags
>> unset fastclose
>> unset fullmesh
>> unset speed
>> +unset join_csum_ns1
>> +unset join_csum_ns2
>> +unset join_fail_nr
>> +unset join_rst_nr
>> +unset join_infi_nr
>> +unset join_corrupted_pkts
>>
>> # generated using "nfbpf_compile '(ip && (ip[54] & 0xf0) == 0x30) ||
>> # (ip6 && (ip6[74] & 0xf0) ==
>> 0x30)'"
>> @@ -1314,12 +1320,12 @@ chk_join_nr()
>> local syn_nr=$1
>> local syn_ack_nr=$2
>> local ack_nr=$3
>> - local csum_ns1=${4:-0}
>> - local csum_ns2=${5:-0}
>> - local fail_nr=${6:-0}
>> - local rst_nr=${7:-0}
>> - local infi_nr=${8:-0}
>> - local corrupted_pkts=${9:-0}
>> + local csum_ns1=${join_csum_ns1:-0}
>> + local csum_ns2=${join_csum_ns2:-0}
>> + local fail_nr=${join_fail_nr:-0}
>> + local rst_nr=${join_rst_nr:-0}
>> + local infi_nr=${join_infi_nr:-0}
>> + local corrupted_pkts=${join_corrupted_pkts:-0}
>> local count
>> local with_cookie
>>
>> @@ -3138,7 +3144,8 @@ fastclose_tests()
>> MPTCP_LIB_SUBTEST_FLAKY=1
>> test_linkfail=1024 fastclose=server \
>> run_tests $ns1 $ns2 10.0.1.1
>> - chk_join_nr 0 0 0 0 0 0 1
>> + join_rst_nr=1 \
>> + chk_join_nr 0 0 0
>> chk_fclose_nr 1 1 invert
>> chk_rst_nr 1 1
>> fi
>> @@ -3157,7 +3164,10 @@ fail_tests()
>> MPTCP_LIB_SUBTEST_FLAKY=1
>> test_linkfail=128 \
>> run_tests $ns1 $ns2 10.0.1.1
>> - chk_join_nr 0 0 0 +1 +0 1 0 1 "$(pedit_action_pkts)"
>> + join_csum_ns1=+1 join_csum_ns2=+0 \
>> + join_fail_nr=1 join_rst_nr=0 join_infi_nr=1
>> \
>
> Can we drop this "join_rst_nr=0"?
We could, but I prefer not: I think it is better to specify all
variables here, to make it clear we expect no RST, compared to the next
test where instead we expect an infinite mapping. It is easier to
compare the expectations from the two tests.
It is different from the 'fastclose_tests()' test, where it is just an
exception there, just one test where there is a rst.
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
next prev parent reply other threads:[~2024-08-08 10:22 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-06 11:18 [PATCH mptcp-next v3 0/8] mptcp: MIB counters for sent MP_JOIN Matthieu Baerts (NGI0)
2024-08-06 11:18 ` [PATCH mptcp-next v3 1/8] selftests: mptcp: join: no extra msg if no counter Matthieu Baerts (NGI0)
2024-08-08 2:38 ` Geliang Tang
2024-08-08 10:17 ` Matthieu Baerts
2024-08-09 2:30 ` Geliang Tang
2024-08-09 11:32 ` Matthieu Baerts
2024-08-09 11:52 ` Geliang Tang
2024-08-06 11:18 ` [PATCH mptcp-next v3 2/8] mptcp: MIB counters for sent MP_JOIN Matthieu Baerts (NGI0)
2024-08-08 2:46 ` Geliang Tang
2024-08-08 10:18 ` Matthieu Baerts
2024-08-06 11:18 ` [PATCH mptcp-next v3 3/8] selftests: mptcp: join: reduce join_nr params Matthieu Baerts (NGI0)
2024-08-08 3:28 ` Geliang Tang
2024-08-08 10:22 ` Matthieu Baerts [this message]
2024-08-09 2:32 ` Geliang Tang
2024-08-06 11:18 ` [PATCH mptcp-next v3 4/8] selftests: mptcp: join: one line for join check Matthieu Baerts (NGI0)
2024-08-09 2:10 ` Geliang Tang
2024-08-09 11:39 ` Matthieu Baerts
2024-08-06 11:18 ` [PATCH mptcp-next v3 5/8] selftests: mptcp: join: validate MPJ SYN TX MIB counters Matthieu Baerts (NGI0)
2024-08-09 2:21 ` Geliang Tang
2024-08-09 11:42 ` Matthieu Baerts
2024-08-06 11:18 ` [PATCH mptcp-next v3 6/8] selftests: mptcp: join: more explicit check name Matthieu Baerts (NGI0)
2024-08-09 2:00 ` Geliang Tang
2024-08-06 11:18 ` [PATCH mptcp-next v3 7/8] selftests: mptcp: join: specify host being checked Matthieu Baerts (NGI0)
2024-08-06 11:18 ` [PATCH mptcp-next v3 8/8] selftests: mptcp: join: mute errors when ran in the background Matthieu Baerts (NGI0)
2024-08-06 12:08 ` [PATCH mptcp-next v3 0/8] mptcp: MIB counters for sent MP_JOIN MPTCP CI
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=2743512d-4772-4e42-9abd-6849c36f1885@kernel.org \
--to=matttbe@kernel.org \
--cc=geliang@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox