Linux Test Project
 help / color / mirror / Atom feed
* [LTP] [PATCH] lib: LTP_SINGLE_FS_TYPE fix fuse blacklist
@ 2025-05-21  9:53 Cyril Hrubis
  2025-05-22 16:14 ` Jan Polensky
  2025-05-22 17:31 ` Petr Vorel
  0 siblings, 2 replies; 7+ messages in thread
From: Cyril Hrubis @ 2025-05-21  9:53 UTC (permalink / raw)
  To: ltp

The case of LTP_SINGLE_FS_TYPE did not proplerly used the fuse
filesystem blacklist and we enabled fuse filesystem even for tests that
explicitly stated in the tst_test structure that they do not work with
fuse.

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
CC: Jan Polensky <japo@linux.ibm.com>
---
 lib/tst_supported_fs_types.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/tst_supported_fs_types.c b/lib/tst_supported_fs_types.c
index bbbb8df19..3a394283c 100644
--- a/lib/tst_supported_fs_types.c
+++ b/lib/tst_supported_fs_types.c
@@ -158,8 +158,10 @@ const char **tst_get_supported_fs_types(const char *const *skiplist)
 	only_fs = getenv("LTP_SINGLE_FS_TYPE");
 
 	if (only_fs) {
+		enum tst_fs_impl ret;
 		tst_res(TINFO, "WARNING: testing only %s", only_fs);
-		if (tst_fs_is_supported(only_fs))
+		ret = tst_fs_is_supported(only_fs);
+		if (ret == TST_FS_KERNEL || (ret == TST_FS_FUSE && !skip_fuse))
 			fs_types[0] = only_fs;
 		return fs_types;
 	}
-- 
2.45.2


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [LTP] [PATCH] lib: LTP_SINGLE_FS_TYPE fix fuse blacklist
  2025-05-21  9:53 [LTP] [PATCH] lib: LTP_SINGLE_FS_TYPE fix fuse blacklist Cyril Hrubis
@ 2025-05-22 16:14 ` Jan Polensky
  2025-05-22 17:31 ` Petr Vorel
  1 sibling, 0 replies; 7+ messages in thread
From: Jan Polensky @ 2025-05-22 16:14 UTC (permalink / raw)
  To: Cyril Hrubis, ltp

On Wed, May 21, 2025 at 11:53:02AM +0200, Cyril Hrubis wrote:
> The case of LTP_SINGLE_FS_TYPE did not proplerly used the fuse
> filesystem blacklist and we enabled fuse filesystem even for tests that
> explicitly stated in the tst_test structure that they do not work with
> fuse.
>
> Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
> CC: Jan Polensky <japo@linux.ibm.com>
> ---
Tested on x86_64 and s390x.
Reviewed-by: Jan Polensky <japo@linux.ibm.com>
Tested-by: Jan Polensky <japo@linux.ibm.com>

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [LTP] [PATCH] lib: LTP_SINGLE_FS_TYPE fix fuse blacklist
  2025-05-21  9:53 [LTP] [PATCH] lib: LTP_SINGLE_FS_TYPE fix fuse blacklist Cyril Hrubis
  2025-05-22 16:14 ` Jan Polensky
@ 2025-05-22 17:31 ` Petr Vorel
  2025-05-22 17:47   ` Cyril Hrubis
  1 sibling, 1 reply; 7+ messages in thread
From: Petr Vorel @ 2025-05-22 17:31 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: ltp

Hi Cyril, Jan, all,

> The case of LTP_SINGLE_FS_TYPE did not proplerly used the fuse
> filesystem blacklist and we enabled fuse filesystem even for tests that
> explicitly stated in the tst_test structure that they do not work with
> fuse.

> Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
> CC: Jan Polensky <japo@linux.ibm.com>
> ---
>  lib/tst_supported_fs_types.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

> diff --git a/lib/tst_supported_fs_types.c b/lib/tst_supported_fs_types.c
> index bbbb8df19..3a394283c 100644
> --- a/lib/tst_supported_fs_types.c
> +++ b/lib/tst_supported_fs_types.c
> @@ -158,8 +158,10 @@ const char **tst_get_supported_fs_types(const char *const *skiplist)
>  	only_fs = getenv("LTP_SINGLE_FS_TYPE");

>  	if (only_fs) {
> +		enum tst_fs_impl ret;
>  		tst_res(TINFO, "WARNING: testing only %s", only_fs);
> -		if (tst_fs_is_supported(only_fs))
> +		ret = tst_fs_is_supported(only_fs);
> +		if (ret == TST_FS_KERNEL || (ret == TST_FS_FUSE && !skip_fuse))
>  			fs_types[0] = only_fs;

Is it really good thing to do?
Because LTP_SINGLE_FS_TYPE forces whatever filesystems, it ignores
.skip_filesystems. E.g. creat09.c don't want to be tested on ntfs (and others
but we can force it):

	.skip_filesystems = (const char*[]) {
		"exfat",
		"ntfs",
		"vfat",
		NULL
	},

# LTP_SINGLE_FS_TYPE=ntfs ./creat09
...
tst_supported_fs_types.c:162: TINFO: WARNING: testing only ntfs
tst_supported_fs_types.c:132: TINFO: FUSE does support ntfs
tst_supported_fs_types.c:62: TINFO: mkfs.ntfs does exist
tst_test.c:1887: TINFO: === Testing on ntfs ===
tst_test.c:1216: TINFO: Formatting /dev/loop0 with ntfs opts='' extra opts=''
The partition start sector was not specified for /dev/loop0 and it could not be obtained automatically.  It has been set to 0.
The number of sectors per track was not specified for /dev/loop0 and it could not be obtained automatically.  It has been set to 0.
The number of heads was not specified for /dev/loop0 and it could not be obtained automatically.  It has been set to 0.
To boot from a device, Windows needs the 'partition start sector', the 'sectors per track' and the 'number of heads' to be set.
Windows will not be able to boot from this device.
tst_test.c:1228: TINFO: Mounting /dev/loop0 to /tmp/LTP_creI1VfeG/mntpoint fstyp=ntfs flags=0
tst_test.c:1228: TINFO: Trying FUSE...
creat09.c:71: TINFO: User nobody: uid = 65534, gid = 65534
creat09.c:73: TINFO: Found unused GID 11: SUCCESS (0)
creat09.c:82: TBROK: mntpoint/testdir: Setgid bit not set

If I add "fuse" among .skip_filesystems (NOTE: ntfs on SUT is fuse implementation),
with this patch it gets skipped:

# LTP_SINGLE_FS_TYPE=ntfs ./creat09_skip_fuse
tst_tmpdir.c:316: TINFO: Using /tmp/LTP_creMF902Y as tmpdir (tmpfs filesystem)
tst_device.c:98: TINFO: Found free device 0 '/dev/loop0'
tst_test.c:1952: TINFO: LTP version: 20250130-274-g62559c3849
tst_test.c:1955: TINFO: Tested kernel: 6.12.20-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.20-1 (2025-03-23) x86_64
tst_kconfig.c:88: TINFO: Parsing kernel config '/boot/config-6.12.20-amd64'
tst_test.c:1773: TINFO: Overall timeout per run is 0h 00m 31s
tst_supported_fs_types.c:162: TINFO: WARNING: testing only ntfs
tst_supported_fs_types.c:132: TINFO: FUSE does support ntfs
tst_supported_fs_types.c:62: TINFO: mkfs.ntfs does exist
tst_test.c:1916: TCONF: There are no supported filesystems

That's inconsistency.

Could we clearly define what we expect from LTP_SINGLE_FS_TYPE?
FYI I put links to the discussion in the ticket
https://github.com/linux-test-project/ltp/issues/1242

I understand the wish to use LTP_SINGLE_FS_TYPE for a proper testing.  If that
requires to respect .skip_filesystems, but
1) it should be done for all filesystems
2) we should have another variable to allow to force the user defined
filesystem, e.g.
LTP_SINGLE_FS_TYPE=ntfs LTP_SINGLE_FS_TYPE_FORCE_FS=1

Kind regards,
Petr

>  		return fs_types;
>  	}

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [LTP] [PATCH] lib: LTP_SINGLE_FS_TYPE fix fuse blacklist
  2025-05-22 17:31 ` Petr Vorel
@ 2025-05-22 17:47   ` Cyril Hrubis
  2025-05-22 19:26     ` Petr Vorel
  0 siblings, 1 reply; 7+ messages in thread
From: Cyril Hrubis @ 2025-05-22 17:47 UTC (permalink / raw)
  To: Petr Vorel; +Cc: ltp

Hi!
> > The case of LTP_SINGLE_FS_TYPE did not proplerly used the fuse
> > filesystem blacklist and we enabled fuse filesystem even for tests that
> > explicitly stated in the tst_test structure that they do not work with
> > fuse.
> 
> > Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
> > CC: Jan Polensky <japo@linux.ibm.com>
> > ---
> >  lib/tst_supported_fs_types.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> > diff --git a/lib/tst_supported_fs_types.c b/lib/tst_supported_fs_types.c
> > index bbbb8df19..3a394283c 100644
> > --- a/lib/tst_supported_fs_types.c
> > +++ b/lib/tst_supported_fs_types.c
> > @@ -158,8 +158,10 @@ const char **tst_get_supported_fs_types(const char *const *skiplist)
> >  	only_fs = getenv("LTP_SINGLE_FS_TYPE");
> 
> >  	if (only_fs) {
> > +		enum tst_fs_impl ret;
> >  		tst_res(TINFO, "WARNING: testing only %s", only_fs);
> > -		if (tst_fs_is_supported(only_fs))
> > +		ret = tst_fs_is_supported(only_fs);
> > +		if (ret == TST_FS_KERNEL || (ret == TST_FS_FUSE && !skip_fuse))
> >  			fs_types[0] = only_fs;
> 
> Is it really good thing to do?
> Because LTP_SINGLE_FS_TYPE forces whatever filesystems, it ignores
> .skip_filesystems. E.g. creat09.c don't want to be tested on ntfs (and others
> but we can force it):

Ah, right, we have to apply the skiplist as well, so on the top of that
we need, I will send a v2.

diff --git a/lib/tst_supported_fs_types.c b/lib/tst_supported_fs_types.c
index 3a394283c..736e68dec 100644
--- a/lib/tst_supported_fs_types.c
+++ b/lib/tst_supported_fs_types.c
@@ -159,10 +159,16 @@ const char **tst_get_supported_fs_types(const char *const *skiplist)

        if (only_fs) {
                enum tst_fs_impl ret;
+
                tst_res(TINFO, "WARNING: testing only %s", only_fs);
+
+               if (tst_fs_in_skiplist(only_fs, skiplist))
+                       return fs_types;
+
                ret = tst_fs_is_supported(only_fs);
                if (ret == TST_FS_KERNEL || (ret == TST_FS_FUSE && !skip_fuse))
                        fs_types[0] = only_fs;
+
                return fs_types;
        }

> Could we clearly define what we expect from LTP_SINGLE_FS_TYPE?
> FYI I put links to the discussion in the ticket
> https://github.com/linux-test-project/ltp/issues/1242
> 
> I understand the wish to use LTP_SINGLE_FS_TYPE for a proper testing.  If that
> requires to respect .skip_filesystems, but
> 1) it should be done for all filesystems
> 2) we should have another variable to allow to force the user defined
> filesystem, e.g.
> LTP_SINGLE_FS_TYPE=ntfs LTP_SINGLE_FS_TYPE_FORCE_FS=1

What about LTP_FORCE_SINGLE_FS_TYPE=ntfs that would do the same as
LTP_SINGLE_FS_TYPE=ntfs but would disable the skiplist?

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [LTP] [PATCH] lib: LTP_SINGLE_FS_TYPE fix fuse blacklist
  2025-05-22 17:47   ` Cyril Hrubis
@ 2025-05-22 19:26     ` Petr Vorel
  2025-05-22 19:57       ` Petr Vorel
  0 siblings, 1 reply; 7+ messages in thread
From: Petr Vorel @ 2025-05-22 19:26 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: ltp

> Hi!
> > > The case of LTP_SINGLE_FS_TYPE did not proplerly used the fuse
> > > filesystem blacklist and we enabled fuse filesystem even for tests that
> > > explicitly stated in the tst_test structure that they do not work with
> > > fuse.

> > > Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
> > > CC: Jan Polensky <japo@linux.ibm.com>
> > > ---
> > >  lib/tst_supported_fs_types.c | 4 +++-
> > >  1 file changed, 3 insertions(+), 1 deletion(-)

> > > diff --git a/lib/tst_supported_fs_types.c b/lib/tst_supported_fs_types.c
> > > index bbbb8df19..3a394283c 100644
> > > --- a/lib/tst_supported_fs_types.c
> > > +++ b/lib/tst_supported_fs_types.c
> > > @@ -158,8 +158,10 @@ const char **tst_get_supported_fs_types(const char *const *skiplist)
> > >  	only_fs = getenv("LTP_SINGLE_FS_TYPE");

> > >  	if (only_fs) {
> > > +		enum tst_fs_impl ret;
> > >  		tst_res(TINFO, "WARNING: testing only %s", only_fs);
> > > -		if (tst_fs_is_supported(only_fs))
> > > +		ret = tst_fs_is_supported(only_fs);
> > > +		if (ret == TST_FS_KERNEL || (ret == TST_FS_FUSE && !skip_fuse))
> > >  			fs_types[0] = only_fs;

> > Is it really good thing to do?
> > Because LTP_SINGLE_FS_TYPE forces whatever filesystems, it ignores
> > .skip_filesystems. E.g. creat09.c don't want to be tested on ntfs (and others
> > but we can force it):

> Ah, right, we have to apply the skiplist as well, so on the top of that
> we need, I will send a v2.

> diff --git a/lib/tst_supported_fs_types.c b/lib/tst_supported_fs_types.c
> index 3a394283c..736e68dec 100644
> --- a/lib/tst_supported_fs_types.c
> +++ b/lib/tst_supported_fs_types.c
> @@ -159,10 +159,16 @@ const char **tst_get_supported_fs_types(const char *const *skiplist)

>         if (only_fs) {
>                 enum tst_fs_impl ret;
> +
>                 tst_res(TINFO, "WARNING: testing only %s", only_fs);
> +
> +               if (tst_fs_in_skiplist(only_fs, skiplist))
> +                       return fs_types;
> +
>                 ret = tst_fs_is_supported(only_fs);
>                 if (ret == TST_FS_KERNEL || (ret == TST_FS_FUSE && !skip_fuse))
>                         fs_types[0] = only_fs;
> +
>                 return fs_types;
>         }

+1 for this.


> > Could we clearly define what we expect from LTP_SINGLE_FS_TYPE?
> > FYI I put links to the discussion in the ticket
> > https://github.com/linux-test-project/ltp/issues/1242

> > I understand the wish to use LTP_SINGLE_FS_TYPE for a proper testing.  If that
> > requires to respect .skip_filesystems, but
> > 1) it should be done for all filesystems
> > 2) we should have another variable to allow to force the user defined
> > filesystem, e.g.
> > LTP_SINGLE_FS_TYPE=ntfs LTP_SINGLE_FS_TYPE_FORCE_FS=1

> What about LTP_FORCE_SINGLE_FS_TYPE=ntfs that would do the same as
> LTP_SINGLE_FS_TYPE=ntfs but would disable the skiplist?

+1, it should go to the release.

But please update also doc doc/users/setup_tests.rst + -h help in lib/tst_test.c
and testcases/lib/tst_test.sh (variable will of course affect both).

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [LTP] [PATCH] lib: LTP_SINGLE_FS_TYPE fix fuse blacklist
  2025-05-22 19:26     ` Petr Vorel
@ 2025-05-22 19:57       ` Petr Vorel
  2025-05-26 10:09         ` Cyril Hrubis
  0 siblings, 1 reply; 7+ messages in thread
From: Petr Vorel @ 2025-05-22 19:57 UTC (permalink / raw)
  To: Cyril Hrubis, ltp, Li Wang, Jan Stancek, Andrea Cervesato,
	Jan Polensky

Hi Cyril, all,

...
> > > Could we clearly define what we expect from LTP_SINGLE_FS_TYPE?
> > > FYI I put links to the discussion in the ticket
> > > https://github.com/linux-test-project/ltp/issues/1242

> > > I understand the wish to use LTP_SINGLE_FS_TYPE for a proper testing.  If that
> > > requires to respect .skip_filesystems, but
> > > 1) it should be done for all filesystems
> > > 2) we should have another variable to allow to force the user defined
> > > filesystem, e.g.
> > > LTP_SINGLE_FS_TYPE=ntfs LTP_SINGLE_FS_TYPE_FORCE_FS=1

> > What about LTP_FORCE_SINGLE_FS_TYPE=ntfs that would do the same as
> > LTP_SINGLE_FS_TYPE=ntfs but would disable the skiplist?

Also, what if both are set? Should it be mutually exclusive?

Kind regards,
Petr

> +1, it should go to the release.

> But please update also doc doc/users/setup_tests.rst + -h help in lib/tst_test.c
> and testcases/lib/tst_test.sh (variable will of course affect both).

> Kind regards,
> Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [LTP] [PATCH] lib: LTP_SINGLE_FS_TYPE fix fuse blacklist
  2025-05-22 19:57       ` Petr Vorel
@ 2025-05-26 10:09         ` Cyril Hrubis
  0 siblings, 0 replies; 7+ messages in thread
From: Cyril Hrubis @ 2025-05-26 10:09 UTC (permalink / raw)
  To: Petr Vorel; +Cc: ltp

Hi!
> Also, what if both are set? Should it be mutually exclusive?

I suppose so, we should just error out in that case. Let me send v2.

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-05-26 10:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-21  9:53 [LTP] [PATCH] lib: LTP_SINGLE_FS_TYPE fix fuse blacklist Cyril Hrubis
2025-05-22 16:14 ` Jan Polensky
2025-05-22 17:31 ` Petr Vorel
2025-05-22 17:47   ` Cyril Hrubis
2025-05-22 19:26     ` Petr Vorel
2025-05-22 19:57       ` Petr Vorel
2025-05-26 10:09         ` Cyril Hrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox