From: Shuah Khan <skhan@linuxfoundation.org>
To: "Jori Koolstra" <jkoolstra@xs4all.nl>,
"Shuah Khan" <shuah@kernel.org>,
"David Ahern" <dsahern@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
"Hangbin Liu" <hangbin.liu@linux.dev>,
"Ricardo B. Marlière" <ricardo@marliere.net>
Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH 1/3] selftests: use local variables consistently in runner.sh
Date: Fri, 20 Nov 2026 13:01:21 -0700 [thread overview]
Message-ID: <f3bdc42c-8c28-4b5c-bfa0-41ac31b37a43@linuxfoundation.org> (raw)
In-Reply-To: <1254980601.2097872.1795173276553@kpc.webmail.kpnmail.nl>
On 11/20/26 04:14, Jori Koolstra wrote:
>
>> Op 18-11-2026 11:13 EST schreef Shuah Khan <skhan@linuxfoundation.org>:
>>
>>
>> On 11/18/26 06:40, Jori Koolstra (CIQ) wrote:
>>> run_one() and run_many() assign their working variables without
>>> declaring them local, so they leak into the global namespace of
>>> whichever shell sources runner.sh, i.e. run_kselftest.sh or the
>>> RUN_TESTS recipe in lib.mk.
>>>
>>
>> Hmm. so if a timeout value of say 60 seconds comes from a test
>> settings file, does it persist? Can you see that if you run a
>> few tests using TARGETS variable?
>>
>
> No, because it is doing
>
> export kselftest_timeout="$kselftest_default_timeout"
>
> at the start of run_once(). I was just trying to get it to be a bit more
> consistent and less bug-prone. We could also add readonly, which is in
> POSIX. But that seemed too much.
>
>>> Declare these variables local so that local is used consistently
>>> throughout the file and the sourcing shell's namespace is not polluted.
>>> This does not add a new requirement on the shell: local is already used
>>> in run_many(), in_netns() and run_in_netns().
>>
>> Makes sense.
>>
>>>
>>> Also, obey the convention to use upper case names for variables that are
>>> constant once assigned.
>>
>> Can you elaborate on this convention?
>>
>
> It seems to be what was used for runner.sh, local variables set once are in
> uppercase.
Drop the change. There is no need to add churn to fix something
that doesn't need to be fixed. There is no strict convention here.
>
>> I don't want to see these changes combined. We don't combine
>> cleanup and convention changes with real changes.
>>
>
> I'll separate it out.
Send just the real change patch.
thanks,
-- Shuah
next prev parent reply other threads:[~2026-11-20 20:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 13:40 [PATCH 0/3] selftests: add option to print the time spent per test Jori Koolstra (CIQ)
2026-11-18 13:40 ` [PATCH 1/3] selftests: use local variables consistently in runner.sh Jori Koolstra (CIQ)
2026-11-18 16:13 ` Shuah Khan
2026-11-20 11:14 ` Jori Koolstra
2026-11-20 20:01 ` Shuah Khan [this message]
2026-11-18 13:40 ` [PATCH 2/3] selftests: pass the timeout override to tests run in a netns Jori Koolstra (CIQ)
2026-11-18 13:40 ` [PATCH 3/3] selftests: add option to print the time spent per test Jori Koolstra (CIQ)
2026-11-18 16:15 ` [PATCH 0/3] " Shuah Khan
2026-11-20 11:27 ` Jori Koolstra
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=f3bdc42c-8c28-4b5c-bfa0-41ac31b37a43@linuxfoundation.org \
--to=skhan@linuxfoundation.org \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=hangbin.liu@linux.dev \
--cc=jkoolstra@xs4all.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=ricardo@marliere.net \
--cc=shuah@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®