[LTP] [PATCH v3 1/3] Filter mkfs version in tst_fs
Cyril Hrubis
chrubis@suse.cz
Fri Oct 4 16:00:30 CEST 2024
Hi!
> + if (ver_parser >= ver_get)
> + break;
> +
> + check_msg = "%s required >= %d, but got %d, "
> + "the version is required in order run the test.";
I would drop the "the version is required in order to run the test."
part from these messages, since it does not add any more value on the
top of the first part of the meassage.
> diff --git a/lib/tst_test.c b/lib/tst_test.c
> index d226157e0..192fee309 100644
> --- a/lib/tst_test.c
> +++ b/lib/tst_test.c
> @@ -1250,6 +1250,7 @@ static const char *default_fs_type(void)
> static void do_setup(int argc, char *argv[])
> {
> char *tdebug_env = getenv("LTP_ENABLE_DEBUG");
> + int ret = 0;
>
> if (!tst_test)
> tst_brk(TBROK, "No tests to run");
> @@ -1310,7 +1311,7 @@ static void do_setup(int argc, char *argv[])
> int i;
>
> for (i = 0; (cmd = tst_test->needs_cmds[i]); ++i)
> - tst_check_cmd(cmd);
> + tst_check_cmd(cmd, 1);
> }
>
> if (tst_test->needs_drivers) {
> @@ -1415,8 +1416,15 @@ static void do_setup(int argc, char *argv[])
>
> tdev.fs_type = default_fs_type();
>
> - if (!tst_test->all_filesystems && count_fs_descs() <= 1)
> + if (!tst_test->all_filesystems && count_fs_descs() <= 1) {
> + if (tst_test->filesystems->mkfs_ver)
> + ret = tst_check_cmd(tst_test->filesystems->mkfs_ver, 0);
> +
> + if (ret)
> + return;
And if we are here, it means that the test runs only for a single
filesystem, so we should instead do:
if (tst_test->filesystem->mkfs_ver)
tst_check_mcd(tst_test->filesystems->mkfs_ver, 1);
The rest looks good.
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list