Re: [LTP] [PATCH 1/3] ioctl_ficlone02.c: set all_filesystems to zero

Petr Vorel
2024-12-09T06:14:41Z

> On Mon, Dec 02, 2024 at 03:42:08PM +0100, Petr Vorel wrote:
> > > Hi!
> > > > The code to skip filesystems in the case of all filesystems is in the
> > > > run_tcase_per_fs() function:

> > > > static int run_tcases_per_fs(void)
> > > > {
> > > > int ret = 0;
> > > > unsigned int i;
> > > > const char *const *filesystems = tst_get_supported_fs_types(tst_test->skip_filesystems);

> > > > The skip_filesystems array is passed to the tst_get_supporte_fs_types()
> > > > function which filters out them.

> > > Perhaps you mean that the skiplist does not work with .all_filesystems
> > > _and_ the LTP_SINGLE_FS_TYPE environment variable?

> > > I guess that we need:

> > > diff --git a/lib/tst_supported_fs_types.c b/lib/tst_supported_fs_types.c
> > > index bbbb8df19..49b1d7205 100644
> > > --- a/lib/tst_supported_fs_types.c
> > > +++ b/lib/tst_supported_fs_types.c
> > > @@ -159,6 +159,10 @@ const char **tst_get_supported_fs_types(const char *const *skiplist)

> > > if (only_fs) {
> > > tst_res(TINFO, "WARNING: testing only %s", only_fs);
> > > +
> > > + if (tst_fs_in_skiplist(only_fs, skiplist))
> > > + tst_brk(TCONF, "Requested filesystems is in test skiplist");
> > > +

> > It's a nice feature to be able to force testing on filesystem even it's set to
> > be skipped without need to manually enable the filesystem and recompile.
> > (It helps testing with LTP compiled as a package without need to compile LTP.)
> > Therefore I would avoid this.

> > @Zorro Lang or are you testing whole syscalls on particular filesystem via
> > LTP_SINGLE_FS_TYPE=xfs ?

> Oh, yes, I always use LTP with different LTP_SINGLE_FS_TYPE. So that's might be
> the problem?

Thanks for confirming your use case.

Well, "Testing only" in the help (-h) was added there to suggest it's for
testing/debugging LTP, not a production testing. But newer mind, I'll implement
Cyril's suggestion, real usage justify it. + I'll add LTP_FORCE_SINGLE_FS_TYPE.

We could allow more filesystems, e.g. instead of running LTP few times with
different LTP_SINGLE_FS_TYPE value: e.g.

for fs in ext4 xfs btrfs; do LTP_SINGLE_FS_TYPE=fs ioctl_ficlone02; done

we could introduce support for particular filesystems
LTP_FILESYSTEMS="ext4,xfs,btrfs" ioctl_ficlone02

(Probably define new variable because "SINGLE" is misleading when supporting
more filesystems. Also when we touch it, I would consider renaming variable
FILESYSTEMS is more obvious for newcomers than "FS_TYPE".)

WDYT?

Kind regards,
Petr

> Thanks,
> Zorro