From: Matthieu Baerts <matttbe@kernel.org>
To: Geliang Tang <geliang@kernel.org>, mptcp@lists.linux.dev
Cc: Geliang Tang <tanggeliang@kylinos.cn>
Subject: Re: [PATCH mptcp-next v4 4/4] selftests: mptcp: add mptcp_lib_events helper
Date: Thu, 22 Feb 2024 12:15:20 +0100 [thread overview]
Message-ID: <360e0345-0a2e-4369-9c1d-421f5fd4412f@kernel.org> (raw)
In-Reply-To: <c415e047-b5ee-4aa1-919b-2a1e829d16e2@kernel.org>
On 22/02/2024 12:07 pm, Matthieu Baerts wrote:
> Hi Geliang,
>
> On 22/02/2024 4:40 am, Geliang Tang wrote:
>> From: Geliang Tang <tanggeliang@kylinos.cn>
>>
>> To avoid duplicated code in different MPTCP selftests, we can add and
>> use helpers defined in mptcp_lib.sh.
>>
>> This patch unifies "pm_nl_ctl events" related code in userspace_pm.sh
>> and mptcp_join.sh into a helper mptcp_lib_events(). Define it in
>> mptcp_lib.sh and use it in both scripts.
>
> (...)
>
>> diff --git a/tools/testing/selftests/net/mptcp/mptcp_lib.sh b/tools/testing/selftests/net/mptcp/mptcp_lib.sh
>> index f65a31594829..5b5ad9947c21 100644
>> --- a/tools/testing/selftests/net/mptcp/mptcp_lib.sh
>> +++ b/tools/testing/selftests/net/mptcp/mptcp_lib.sh
>> @@ -399,3 +399,17 @@ mptcp_lib_ns_exit() {
>> rm -f /tmp/"$netns".{nstat,out}
>> done
>> }
>> +
>> +mptcp_lib_events() {
>> + local ns="${1}"
>> + local evts="${2}"
>> + declare -n pid="${3}"
>> +
>> + :>"${evts}"
>> +
>> + if [ ${pid} -ne 0 ]; then
>
> Yet another new shellcheck warning introduced here:
>
>>
>> In mptcp_lib.sh line 410:
>> if [ ${pid} -ne 0 ]; then
>> ^----^ SC2086 (info): Double quote to prevent globbing and word splitting.
>>
>> Did you mean:
>> if [ "${pid}" -ne 0 ]; then
>
> I guess the CI should check that and report it, so I would not have to
> fix that just before applying patches.
In fact, we don't need this check because mptcp_lib_kill_wait() does
nothing if the pid is set to 0. So I simplified the fix by removing the
condition.
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
next prev parent reply other threads:[~2024-02-22 11:15 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-22 3:40 [PATCH mptcp-next v4 0/4] add helpers and vars in mptcp_lib.sh, part 2 Geliang Tang
2024-02-22 3:40 ` [PATCH mptcp-next v4 1/4] selftests: mptcp: add local variables rndh Geliang Tang
2024-02-22 3:40 ` [PATCH mptcp-next v4 2/4] selftests: mptcp: add mptcp_lib_ns_init/exit helpers Geliang Tang
2024-02-22 10:34 ` Matthieu Baerts
2024-02-22 3:40 ` [PATCH mptcp-next v4 3/4] selftests: mptcp: more operations in ns_init/exit Geliang Tang
2024-02-22 3:40 ` [PATCH mptcp-next v4 4/4] selftests: mptcp: add mptcp_lib_events helper Geliang Tang
2024-02-22 4:31 ` selftests: mptcp: add mptcp_lib_events helper: Tests Results MPTCP CI
2024-02-22 11:07 ` [PATCH mptcp-next v4 4/4] selftests: mptcp: add mptcp_lib_events helper Matthieu Baerts
2024-02-22 11:15 ` Matthieu Baerts [this message]
2024-02-22 10:30 ` [PATCH mptcp-next v4 0/4] add helpers and vars in mptcp_lib.sh, part 2 Matthieu Baerts
2024-02-22 11:39 ` Matthieu Baerts
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=360e0345-0a2e-4369-9c1d-421f5fd4412f@kernel.org \
--to=matttbe@kernel.org \
--cc=geliang@kernel.org \
--cc=mptcp@lists.linux.dev \
--cc=tanggeliang@kylinos.cn \
/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