[LTP] [PATCH v5 05/10] tst_supported_fs: Support skip list when query single fs

Petr Vorel pvorel@suse.cz
Tue Sep 13 15:46:05 CEST 2022


Hi,

there are 2 errors, 2) needs more thinking.

> And use this feature in zram01.sh
1) zram01.sh check in "all_filesystem" mode, thus it should not be changed here,
but in the separate commit.

> +/*
> + * Check filesystem support (@see tst_fs_is_supported()), but consider also
> + * filesystems to skip.
> + *
> + * @fs_type A filesystem name to check the support for.
> + * @skiplist A NULL terminated array of filesystems to skip.
> + */
> +enum tst_fs_impl tst_fs_is_supported_skiplist(const char *fs_type, const char
> +					      *const *skiplist);
> +
>  /*
>   * Returns NULL-terminated array of kernel-supported filesystems.
>   *
> diff --git a/lib/tst_supported_fs_types.c b/lib/tst_supported_fs_types.c
> index 9726d193a..cde162555 100644
> --- a/lib/tst_supported_fs_types.c
> +++ b/lib/tst_supported_fs_types.c
> @@ -134,6 +134,22 @@ enum tst_fs_impl tst_fs_is_supported(const char *fs_type)
>  	return TST_FS_UNSUPPORTED;
>  }

> +enum tst_fs_impl tst_fs_is_supported_skiplist(const char *fs_type, const char
> +					      *const *skiplist)
> +{
> +	int ret;
> +
> +	ret = tst_fs_is_supported(fs_type);
2) while this function might be useful in the future, now it's not what is
needed... Because for single filesystem does not need check for mkfs.foo.
> +
> +	if (!ret)
> +		return ret;
> +
> +	if (tst_fs_in_skiplist(fs_type, skiplist))
> +		return TST_FS_UNSUPPORTED;
> +
> +	return ret;
> +}

There should be new function with code moved from do_test_setup():

void tst_fs_is_current_fs_supported(const char *fs_name, const char *const *skiplist)
{
	if (tst_fs_in_skiplist(fs_name, skiplist))
		tst_brk(TCONF, "%s is not supported by the test", fs_name);

	tst_res(TINFO, "%s is supported by the test", fs_name);
}

I know you want tst_res(TCONF) in the library, that means I'd have to
call tst_vbrk_(), right? Because we have message already printed.
Maybe different function prefix could help.

Kind regards,
Petr


More information about the ltp mailing list