Hi Hangbin,
On Tue, 1 Sep 2026 17:46:14, Hangbin Liu wrote:
>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?

Sorry for my confusing commit message and poor English.
In fact the problem is not KSELFTEST_TEST_KMOD_SH_ARGS but empty
kselftest_cmd_args_ref.
If user does not export "KSELFTEST_${BASENAME_SANITIZED}_ARGS" (the
${BASENAME_SANITIZED} here can be anything like KMOD or RTCTEST) explicitly,
kselftest_cmd_args_ref will be empty by default and override kselftest_cmd_args.
So this patch will check whether kselftest_cmd_args_ref is empty before
starting one test.

Thanks,
Qianheng

>
>Thanks
>Hangbin
>
>> >
>> >Signed-off-by: QianhengPeng <[email protected]>
>> >---
>> > 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 via email to