On 2026-09-02 1:32 UTC, Hangbin Liu wrote:
>On Tue, Sep 01, 2026 at 08:07:22PM +0800, Qianheng Peng wrote:
>> 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.
>
>Oh, I see what you mean now.
>
> kselftest_cmd_args_ref="KSELFTEST_${BASENAME_SANITIZED}_ARGS"
>
>This is used to retrieve parameters for a *specific* test. When a test does not
>require extra parameters, `KSELFTEST_${BASENAME_SANITIZED}_ARGS` is not set.
>This has the same effect as when a user exports it but does not assign a value.
>
>Therefore, I do not think we need to add a check for this case. Users should
>understand the semantics when exporting the
>`KSELFTEST_${BASENAME_SANITIZED}_ARGS`
>variable.
>
>Thanks
>Hangbin
Yes, if just only adding a check, that really makes no sense.
But there is a issue for the follow case:
---------------------------------------------------------------------------
User wrote "cmd_args=nice_value" in settings file and want to use the
`nice_value` as arguments for a test program.So the user didn't need to
export something like `KSELFTEST_XXXX_ARGS` because kselftest_cmd_args should
get the `nice_value` as we can see
eval "kselftest_$field"="$value"
But in current runner.sh, kselftest_cmd_args has always been set up by
`KSELFTEST_XXXX_ARGS` as we can see
kselftest_cmd_args_ref="KSELFTEST_${BASENAME_SANITIZED}_ARGS"
eval kselftest_cmd_args="\$${kselftest_cmd_args_ref:-}"
As `KSELFTEST_XXXX_ARGS` was empty, the user unexpectedly lost `nice_value`
written in settings file.
---------------------------------------------------------------------------
According to the implement of runner.sh, it may want to give users two choices:
1) using arguments in settings file
2) or using arguments by export `KSELFTEST_${BASENAME_SANITIZED}_ARGS`
But now users has been forced to use `KSELFTEST_${BASENAME_SANITIZED}_ARGS`.
For the case above and making users happy, I did two things in the patch:
1) If `KSELFTEST_${BASENAME_SANITIZED}_ARGS was empty, keep the value from
settings file
2) If not, set kselftest_cmd_args by `KSELFTEST_${BASENAME_SANITIZED}_ARGS`
Thanks and regards,
Qianheng