[LTP] [RFC PATCH 1/1] tst_test.sh: Fix filesystem support detection

Li Wang liwang@redhat.com
Thu Sep 22 06:32:27 CEST 2022


On Wed, Sep 21, 2022 at 6:27 PM Petr Vorel <pvorel@suse.cz> wrote:

> Filesystem detection of locally used filesystem was broken on tests
> which did not use TST_ALL_FILESYSTEMS as it 1) expected used filesystem
> is $TST_FS_TYPE 2) this variable was not yet set.
>
> Also this check makes sense only if test defines TST_SKIP_FILESYSTEMS
> (to align with the condition in do_test_setup() in C API).
>
> Move filesystem check after (optional) cd "$TST_TMPDIR" (TMPDIR can have
> different filesystem).
>
> Not printing extra TINFO "$_tst_fs is supported by the test" (which is
> printed in C API) when test is supported, because there is already
> similar TINFO from testcases/lib/tst_supported_fs.c:
> tst_supported_fs.c:104: TINFO: btrfs is not skipped
>
> Fixes: 1f6bd6e66 ("tst_test.sh: Add $TST_ALL_FILESYSTEMS")
>
> Reported-by: Martin Doucha <mdoucha@suse.cz>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> First, sorry for introducing a regression.
>
> I don't like df and tail dependency. Also df output is stable (even on
> busybox), but I'd prefer to use code from do_test_setup() in
> lib/tst_test.c:
>
>         long fs_type = tst_fs_type(".");
>         const char *fs_name = tst_fs_type_name(fs_type);
>
> Instead adding yet another binary, I wonder if we could add extra getopt
> parameter to ask for current filesystem.
>
> i.e. to replace:
> -tst_supported_fs -s skip_list fs_type
> +tst_supported_fs -s skip_list -d DIR
>

+1, and Martin already sent out the achievement patch,
you can rebase this patch on that.

And I'd like to vote for merging your both patches for
adding to the new release.


-- 
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20220922/39ad2c00/attachment.htm>


More information about the ltp mailing list