All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Li Wang <liwang@redhat.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v4] lib: LTP_SINGLE_FS_TYPE and LTP_FORCE_SINGLE_FS_TYPE
Date: Tue, 27 May 2025 11:34:36 +0200	[thread overview]
Message-ID: <20250527093436.GC173684@pevik> (raw)
In-Reply-To: <CAEemH2eyj5k5tUAQyo+b-JXKF5-GcLzQA5SXbP7xpqU1xU73NQ@mail.gmail.com>

Hi Li, Cyril,

> Petr Vorel <pvorel@suse.cz> wrote:

> > > -     skip_fuse = tst_fs_in_skiplist("fuse", skiplist);
> > >       only_fs = getenv("LTP_SINGLE_FS_TYPE");
> > > +     force_only_fs = getenv("LTP_FORCE_SINGLE_FS_TYPE");
> > > +
> > > +     if (only_fs && force_only_fs) {
> > > +             tst_brk(TBROK,
> > > +                     "Only one of LTP_SINGLE_FS_TYPE and LTP_FORCE_SINGLE_FS_TYPE can be set");
> > > +             return NULL;
> > > +     }
> > > +
> > > +     skip_fuse = tst_fs_in_skiplist("fuse", skiplist);

> > >       if (only_fs) {
> > >               tst_res(TINFO, "WARNING: testing only %s", only_fs);
> > > -             if (tst_fs_is_supported(only_fs))
> > > +             if (fs_could_be_used(only_fs, skiplist, skip_fuse))
> > >                       fs_types[0] = only_fs;

> One more thing I'm a bit hesitant about, do we need to explicitly set
> fs_types[1] to NULL here?

Although it looks reasonable, I suppose it's not needed because array is static,
therefore members are NULL, right?

static const char *fs_types[ARRAY_SIZE(fs_type_whitelist)];

Also I tested it on statmount02.c, which has:

	.all_filesystems = 1,
	.skip_filesystems = (const char *const []) {
		"fuse",
		"btrfs",
		NULL
	},

and it works as expected:

# LTP_SINGLE_FS_TYPE=ntfs ./statmount02
...
tst_test.c:1953: TINFO: LTP version: 20250130-278-gada0e52d26
...
tst_supported_fs_types.c:190: 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_supported_fs_types.c:163: TINFO: Skipping FUSE based ntfs as requested by the test
tst_test.c:1917: TCONF: There are no supported filesystems

# LTP_FORCE_SINGLE_FS_TYPE=ntfs ./statmount02
...
tst_test.c:1953: TINFO: LTP version: 20250130-278-gada0e52d26
...
tst_supported_fs_types.c:197: TINFO: WARNING: force testing only ntfs
tst_test.c:1888: TINFO: === Testing on ntfs ===
tst_test.c:1217: 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.
statmount02.c:51: TINFO: Mounting /dev/loop0 to /tmp/LTP_sta2GSo2A/mntpoint fstyp=ntfs flags=1
statmount02.c:51: TINFO: Trying FUSE...
statmount02.c:35: TPASS: statmount(sx_mount->data.stx_mnt_id, STATMOUNT_SB_BASIC, st_mount, sizeof(struct statmount), 0) passed
statmount02.c:41: TPASS: st_mount->mask == STATMOUNT_SB_BASIC (1)
statmount02.c:42: TPASS: st_mount->size == sizeof(struct statmount) (512)
statmount02.c:43: TPASS: st_mount->sb_dev_major == sx_mount->data.stx_dev_major (7)
statmount02.c:44: TPASS: st_mount->sb_dev_minor == sx_mount->data.stx_dev_minor (0)
statmount02.c:45: TPASS: st_mount->sb_magic == sf_mount->f_type (1702057286)
statmount02.c:46: TFAIL: st_mount->sb_flags (0) != MS_RDONLY (1)
statmount02.c:60: TINFO: Umounting /tmp/LTP_sta2GSo2A/mntpoint

Kind regards,
Petr

> > >               return fs_types;
> > >       }

> > > -     for (i = 0; fs_type_whitelist[i]; i++) {
> > > -             if (tst_fs_in_skiplist(fs_type_whitelist[i], skiplist)) {
> > > -                     tst_res(TINFO, "Skipping %s as requested by the test",
> > > -                             fs_type_whitelist[i]);
> > > -                     continue;
> > > -             }
> > > -
> > > -             sup = tst_fs_is_supported(fs_type_whitelist[i]);
> > > -
> > > -             if (skip_fuse && sup == TST_FS_FUSE) {
> > > -                     tst_res(TINFO,
> > > -                             "Skipping FUSE based %s as requested by the test",
> > > -                             fs_type_whitelist[i]);
> > > -                     continue;
> > > -             }
> > > +     if (force_only_fs) {
> > > +             tst_res(TINFO, "WARNING: force testing only %s", force_only_fs);
> > > +             fs_types[0] = force_only_fs;

> fs_type[1] = NULL; ?

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

  parent reply	other threads:[~2025-05-27  9:35 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-26 14:34 [LTP] [PATCH v4] lib: LTP_SINGLE_FS_TYPE and LTP_FORCE_SINGLE_FS_TYPE Cyril Hrubis
2025-05-26 15:51 ` Petr Vorel
2025-05-27  8:55   ` Li Wang via ltp
2025-05-28 13:16     ` Cyril Hrubis
2025-05-27  9:07   ` Li Wang via ltp
2025-05-27  9:31     ` Cyril Hrubis
2025-05-27  9:38       ` Li Wang via ltp
2025-05-27  9:42         ` Cyril Hrubis
2025-05-27  9:34     ` Petr Vorel [this message]
2025-05-27  9:57       ` Li Wang via ltp
2025-05-27 11:00         ` Petr Vorel
2025-05-27 11:16           ` Cyril Hrubis
2025-05-27 11:32             ` Petr Vorel
2025-05-27 11:43               ` Cyril Hrubis
2025-05-27 12:04                 ` Petr Vorel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250527093436.GC173684@pevik \
    --to=pvorel@suse.cz \
    --cc=liwang@redhat.com \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.