[LTP] [PATCH v5 03/10] tst_supported_fs: Print TCONF if no filesystem supported

Petr Vorel pvorel@suse.cz
Tue Sep 13 15:08:18 CEST 2022


> > Hi!
> > > > Shouldn't we rather than this add tst_res(TCONF, "...") messages to the
> > > > lib/tst_supported_fs_types.c so that we get consistent messages between
> > > > C and shell?

> > > Well, in v4 I add TCONF in tst_fs_is_supported_skiplist()
> > > (lib/tst_supported_fs_types.c), but you asked for TST_FS_UNSUPPORTED [1].

> > I guess that we misunderstand each other. I'm fine with the library
> > printing messages, what I didn't like was the tst_brk() which made the
> > whole program execution flow obscured.

> OK, instead of this from v4:
> > +	if (tst_fs_in_skiplist(fs_type, skiplist)) {
> > +		tst_brk(TCONF, "%s is not supported by the test",
> > +			fs_type);

> I'll add in v6:
> > +	if (tst_fs_in_skiplist(fs_type, skiplist)) {
> > +		tst_res(TCONF, "%s is not supported by the test",
> > +			fs_type);
> > +		return TST_FS_UNSUPPORTED;
> > +	}

> I'll add tst_res(TINFO, "%s is supported by the test", fs_name);
> from do_test_setup() tst_fs_is_supported_skiplist() and call
> tst_fs_is_supported_skiplist() in do_test_setup().

> But not sure if there can be a cleanup of duplicity of:
> if (!filesystems[0])
> 	tst_brk(TCONF, "There are no supported filesystems")

In order to unify the API I suggest to move the check above to
tst_get_supported_fs_types() in lib/tst_supported_fs_types.c.
This function is used only on lib/tst_test.c (and will be now in
testcases/lib/tst_supported_fs.c) and uses static array fs_types.
I see no point to add wrapper which would contain this check just to keep
tst_get_supported_fs_types() without tst_brk().
@Cyril WDYT?

Kind regards,
Petr

> Kind regards,
> Petr


More information about the ltp mailing list