Skip to contentSkip to conversation

syscalls/ustat: Skip tests on Btrfs using .skip_filesystems

PATCH In review Disha Goel 2 participants 3 messages Mar 23 – Apr 9

lore
Share & tools
lore

Disha Goel

author
#0 lore raw

PATCH v2 1/1 syscalls/ustat: Skip tests on Btrfs using .skip_filesystems

The ustat(2) system call is known to fail with EINVAL on Btrfs because it uses anonymous device IDs for subvolumes, which this legacy syscall cannot resolve to a physical block device.

Currently, this results in a TFAIL, which causes false negatives in automated CI environments (e.g., SLES). This patch utilizes the LTP library's .skip_filesystems mechanism to gracefully skip the tests (TCONF) when executed on Btrfs.

---
Changelog v1 -> v2:
- Removed manual statfs/tst_brk logic in setup().
- Implemented .skip_filesystems in the tst_test structure for both ustat01 and ustat02.

Link to v1:
https://lore.kernel.org/all/[email protected]/

---
 testcases/kernel/syscalls/ustat/ustat01.c | 4 ++++
 testcases/kernel/syscalls/ustat/ustat02.c | 4 ++++
 2 files changed, 8 insertions(+)
testcases/kernel/syscalls/ustat/ustat01.c +4 -0
index 161006058..55095191b 100644
@@ -44,6 +44,10 @@ static void setup(void)
 static struct tst_test test = {
 	.test_all = run,
 	.setup = setup,
+	.skip_filesystems = (const char *const[]) {
+                "btrfs",
+                NULL
+        },
 	.tags = (const struct tst_tag[]) {
 		{"known-fail", "ustat() is known to fail with EINVAL on Btrfs, see "
 			"https://lore.kernel.org/linux-btrfs/[email protected]/"
testcases/kernel/syscalls/ustat/ustat02.c +4 -0
index 84becaa1f..82dcfb6b4 100644
@@ -61,6 +61,10 @@ static struct tst_test test = {
 	.test = run,
 	.setup = setup,
 	.tcnt = ARRAY_SIZE(tc),
+	.skip_filesystems = (const char *const[]) {
+                "btrfs",
+                NULL
+        },
 	.tags = (const struct tst_tag[]) {
 		{"known-fail", "ustat() is known to fail with EINVAL on Btrfs, see "
 			"https://lore.kernel.org/linux-btrfs/[email protected]/"
Signature · 5 lines
2.45.1


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