[LTP] [PATCH v4 2/5] lib: Introduce KCONFIG_SKIP_CHECK environment variable
xuyang2018.jy@fujitsu.com
xuyang2018.jy@fujitsu.com
Fri Jan 14 06:36:45 CET 2022
Hi Petr
> Hi Xu,
>
>> This environment variable is designed to add kernel config check functionality
>> switch. So we can skip kconfig check completely and it is useful especially
>> for the embedded platforms that they don't have kernel config.
>
> very nit: I'd write it a bit simpler. Maybe:
> Add environment variable to disable kernel config check functionality.
> It is useful for embedded platforms which don't have kernel config installed.
>
>> +++ b/doc/user-guide.txt
>> @@ -10,6 +10,7 @@ For running LTP network tests see `testcases/network/README.md`.
>> |==============================================================================
>> | 'KCONFIG_PATH' | The path to the kernel config file, (if not set, it tries
>> the usual paths '/boot/config-RELEASE' or '/proc/config.gz').
>> +| 'KCONFIG_SKIP_CHECK' | Skip kernel config check, the default is empty (don't skip).
> s/empty/not set/ ?
> maybe: Skip kernel config check if variable set (not set by default).
>
Sounds reasonable.
> ...
>
>> +static int kconfig_skip_check(void)
>> +{
>> + char *skipped = getenv("KCONFIG_SKIP_CHECK");
>> +
>> + if (skipped)
>> + return 1;
>> +
>> + return 0;
>> +}
>> +
>> static const char *kconfig_path(char *path_buf, size_t path_buf_len)
>> {
>> const char *path = getenv("KCONFIG_PATH");
>> @@ -485,6 +495,11 @@ int tst_kconfig_check(const char *const kconfigs[])
>> unsigned int i, var_cnt;
>> int ret = 0;
>
>> + if (kconfig_skip_check()) {
>> + tst_res(TINFO, "Skipping kernel config check as requested");
> I suppose you expect tests / library use kconfig_skip_check() in the future for
> some detection. If not I'd move tst_res(TINFO, ...) into kconfig_skip_check().
I don't have this plan. So move it into kconfig_skip_check().
Best Regards
Yang Xu
>
> Otherwise LGTM.
>
> Reviewed-by: Petr Vorel<pvorel@suse.cz>
>
> Kind regards,
> Petr
More information about the ltp
mailing list