Hi Qianheng,
On Wed, Sep 02, 2026 at 11:05:42AM +0800, Qianheng Peng wrote:
> >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"
AFAIK, the setting file is usually used for setting timeout value. As
you can see in runner.sh, it checks kselftest_timeout after reading setting
file.
> 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
I’m not sure if this was the original intention. The configuration file
lives under the test directory, which typically holds multiple tests.
What if individual tests require different parameters? How would you
supply distinct arguments in the config file using only a single
`cmd_args` variable?
> 2) or using arguments by export `KSELFTEST_${BASENAME_SANITIZED}_ARGS`
> But now users has been forced to use `KSELFTEST_${BASENAME_SANITIZED}_ARGS`.
In contrast, `KSELFTEST_${BASENAME_SANITIZED}_ARGS` can target each specific
test case individually.
Perhaps I have misunderstood the design. Please feel free to correct me.
Thanks
Hangbin
>
> 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