mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hangbin Liu <hangbin.liu@linux.dev>
To: Qianheng Peng <pengqh1@chinatelecom.cn>
Cc: shuah@kernel.org, broonie@kernel.org, jackmanb@google.com,
	liuhangbin@gmail.com, rbm@suse.com, skhan@linuxfoundation.org,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] selftests: runner.sh: avoid overriding kselftest_cmd_args with empty variable
Date: Tue, 1 Sep 2026 17:46:14 +0800	[thread overview]
Message-ID: <apae5q5R546M6283@fedora> (raw)
In-Reply-To: <20260901024452.485159-1-pengqh1@chinatelecom.cn>

Hi Qianheng
On Tue, Sep 01, 2026 at 10:44:52AM +0800, Qianheng Peng wrote:
> On Tue, 14 Jul 2026 14:34:43, Qianheng Peng wrote:
> >Normally the value of kselftest_cmd_args can be read from settings file,
> >but it will be overridden by KSELFTEST_TEST_KMOD_SH_ARGS which can be
> >empty if user did not give it a real value.So it should be better to
> >check if KSELFTEST_TEST_KMOD_SH_ARGS is emty before referring its
> >value to kselftest_cmd_args.

Where does KSELFTEST_TEST_KMOD_SH_ARGS from? kmod testing? If yes,
can we fix it there?

Thanks
Hangbin

> >
> >Signed-off-by: QianhengPeng <pengqh1@chinatelecom.cn>
> >---
> > tools/testing/selftests/kselftest/runner.sh | 10 +++++++++-
> > 1 file changed, 9 insertions(+), 1 deletion(-)
> >
> >diff --git a/tools/testing/selftests/kselftest/runner.sh b/tools/testing/selftests/kselftest/runner.sh
> >index 311811d..a99147a 100644
> >--- a/tools/testing/selftests/kselftest/runner.sh
> >+++ b/tools/testing/selftests/kselftest/runner.sh
> >@@ -103,6 +103,15 @@ run_one()
> > 		ktap_print_msg "timeout set to $kselftest_timeout" >> "$logfile"
> > 	fi
> > 
> >+	# Exported environment variable overrides the settings file
> >+	eval kselftest_eval_cmd_args="\$${kselftest_cmd_args_ref:-}"
> >+	if [ -n "$kselftest_eval_cmd_args" ]; then
> >+		kselftest_cmd_args=$kselftest_eval_cmd_args
> >+		ktap_print_msg "overriding cmd_args to $kselftest_cmd_args" >> "$logfile"
> >+	elif [ -n "$kselftest_cmd_args" ]; then
> >+		ktap_print_msg "cmd_args set to $kselftest_cmd_args" >> "$logfile"
> >+	fi
> >+
> > 	TEST_HDR_MSG="selftests: $DIR: $BASENAME_TEST"
> > 	echo "# $TEST_HDR_MSG"
> > 	if [ ! -e "$TEST" ]; then
> >@@ -113,7 +122,6 @@ run_one()
> > 		if [ -x /usr/bin/stdbuf ]; then
> > 			stdbuf="/usr/bin/stdbuf --output=L "
> > 		fi
> >-		eval kselftest_cmd_args="\$${kselftest_cmd_args_ref:-}"
> > 		if [ -x "$TEST" ]; then
> > 			cmd="$stdbuf ./$BASENAME_TEST $kselftest_cmd_args"
> > 		elif [ -x "./ksft_runner.sh" ]; then
> >-- 
> >1.8.3.1
> >
> 
> Gentle ping. This patch has been sent on July and has not got response since then.
> The patch still applies cleanly to current mainline.Glad to resend if it's preferable.
> 
> Thanks and Regards,
> Qianheng

  reply	other threads:[~2026-09-01  9:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-14  6:34 QianhengPeng
2026-09-01  2:44 ` Qianheng Peng
2026-09-01  9:46   ` Hangbin Liu [this message]
2026-09-01 12:07     ` Qianheng Peng
2026-09-02  1:32       ` Hangbin Liu
2026-09-02  3:05         ` Qianheng Peng
2026-09-02  6:22           ` Hangbin Liu
2026-09-02  9:24             ` Qianheng Peng

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=apae5q5R546M6283@fedora \
    --to=hangbin.liu@linux.dev \
    --cc=broonie@kernel.org \
    --cc=jackmanb@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=liuhangbin@gmail.com \
    --cc=pengqh1@chinatelecom.cn \
    --cc=rbm@suse.com \
    --cc=shuah@kernel.org \
    --cc=skhan@linuxfoundation.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®