diff mbox series

[v2,2/2] tst_supported_fs_types: Ignore empty $LTP_SINGLE_FS_TYPE value

Message ID 20250225114418.2940134-2-pvorel@suse.cz
State Accepted
Headers show
Series [v2,1/2] tst_test: Add $LTP_SINGLE_ITERATION to limit variant | expand

Commit Message

Petr Vorel Feb. 25, 2025, 11:44 a.m. UTC
Previously empty $LTP_SINGLE_FS_TYPE value caused no testing:

    # LTP_SINGLE_FS_TYPE= ./getdents02
    ...
    LTP_SINGLE_VARIANT= LTP_SINGLE_FS_TYPE= ./getdents02
    tst_kconfig.c:88: TINFO: Parsing kernel config '/boot/config-6.12.10-amd64'
    tst_test.c:1722: TINFO: Overall timeout per run is 0h 00m 30s
    tst_supported_fs_types.c:161: TINFO: WARNING: testing only
    tst_supported_fs_types.c:128: TINFO: Filesystem  is not supported
    tst_test.c:1861: TCONF: There are no supported filesystems

Now value is ignored:

    # LTP_SINGLE_FS_TYPE= ./getdents02
    ...
    tst_supported_fs_types.c:97: TINFO: Kernel supports ext2
    tst_supported_fs_types.c:62: TINFO: mkfs.ext2 does exist
    tst_supported_fs_types.c:97: TINFO: Kernel supports ext3
    tst_supported_fs_types.c:62: TINFO: mkfs.ext3 does exist
    tst_supported_fs_types.c:97: TINFO: Kernel supports ext4
    tst_supported_fs_types.c:62: TINFO: mkfs.ext4 does exist
    tst_supported_fs_types.c:97: TINFO: Kernel supports xfs
    tst_supported_fs_types.c:62: TINFO: mkfs.xfs does exist
    tst_supported_fs_types.c:97: TINFO: Kernel supports btrfs
    tst_supported_fs_types.c:62: TINFO: mkfs.btrfs does exist
    tst_supported_fs_types.c:97: TINFO: Kernel supports bcachefs
    tst_supported_fs_types.c:62: TINFO: mkfs.bcachefs does exist
    tst_supported_fs_types.c:97: TINFO: Kernel supports vfat
    tst_supported_fs_types.c:62: TINFO: mkfs.vfat does exist
    tst_supported_fs_types.c:97: TINFO: Kernel supports exfat
    tst_supported_fs_types.c:62: TINFO: mkfs.exfat does exist
    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:97: TINFO: Kernel supports tmpfs
    tst_supported_fs_types.c:49: TINFO: mkfs is not needed for tmpfs
    tst_test.c:1834: TINFO: === Testing on ext2 ===

Fixes: 1199657e91 ("lib: Add support for debugging .all_filesystems")
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
The same as v1.

 lib/tst_supported_fs_types.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andrea Cervesato Dec. 18, 2025, 12:30 p.m. UTC | #1
Hi!

This one is good, it can be merged.

Reviewed-by: Andrea Cervesato <andrea.cervesato@suse.com>
Petr Vorel Jan. 5, 2026, 2:30 p.m. UTC | #2
Hi Andrea,

thanks for a review, this patch merged!

Kind regards,
Petr
diff mbox series

Patch

diff --git a/lib/tst_supported_fs_types.c b/lib/tst_supported_fs_types.c
index bbbb8df19f..5e51595d82 100644
--- a/lib/tst_supported_fs_types.c
+++ b/lib/tst_supported_fs_types.c
@@ -157,7 +157,7 @@  const char **tst_get_supported_fs_types(const char *const *skiplist)
 	skip_fuse = tst_fs_in_skiplist("fuse", skiplist);
 	only_fs = getenv("LTP_SINGLE_FS_TYPE");
 
-	if (only_fs) {
+	if (only_fs && only_fs[0] != '\0') {
 		tst_res(TINFO, "WARNING: testing only %s", only_fs);
 		if (tst_fs_is_supported(only_fs))
 			fs_types[0] = only_fs;