[LTP] [PATCH v3 3/4] Update test cases use new needs_cmds
Wei Gao
wegao@suse.com
Fri Oct 10 08:45:49 CEST 2025
Signed-off-by: Wei Gao <wegao@suse.com>
---
lib/newlib_tests/tst_needs_cmds01.c | 16 ++++++++--------
lib/newlib_tests/tst_needs_cmds02.c | 6 +++---
lib/newlib_tests/tst_needs_cmds03.c | 6 +++---
lib/newlib_tests/tst_needs_cmds04.c | 6 +++---
lib/newlib_tests/tst_needs_cmds05.c | 6 +++---
lib/newlib_tests/tst_needs_cmds06.c | 6 +++---
lib/newlib_tests/tst_needs_cmds07.c | 6 +++---
lib/newlib_tests/tst_needs_cmds08.c | 8 ++++----
testcases/kernel/device-drivers/zram/zram03.c | 8 ++++----
testcases/kernel/fs/squashfs/squashfs01.c | 6 +++---
testcases/kernel/security/aslr/aslr01.c | 6 +++---
testcases/kernel/syscalls/add_key/add_key05.c | 10 +++++-----
testcases/kernel/syscalls/fanotify/fanotify22.c | 6 +++---
testcases/kernel/syscalls/ioctl/ioctl09.c | 6 +++---
testcases/kernel/syscalls/madvise/madvise11.c | 8 ++++----
testcases/kernel/syscalls/quotactl/quotactl01.c | 6 +++---
testcases/kernel/syscalls/quotactl/quotactl04.c | 6 +++---
testcases/kernel/syscalls/quotactl/quotactl06.c | 6 +++---
testcases/kernel/syscalls/quotactl/quotactl08.c | 6 +++---
testcases/kernel/syscalls/quotactl/quotactl09.c | 6 +++---
testcases/kernel/syscalls/statx/statx05.c | 8 ++++----
testcases/kernel/syscalls/statx/statx07.c | 6 +++---
testcases/kernel/syscalls/statx/statx09.c | 6 +++---
23 files changed, 80 insertions(+), 80 deletions(-)
diff --git a/lib/newlib_tests/tst_needs_cmds01.c b/lib/newlib_tests/tst_needs_cmds01.c
index 777c69505..592456da6 100644
--- a/lib/newlib_tests/tst_needs_cmds01.c
+++ b/lib/newlib_tests/tst_needs_cmds01.c
@@ -12,13 +12,13 @@ static void do_test(void)
static struct tst_test test = {
.test_all = do_test,
- .needs_cmds = (const char *[]) {
- "mkfs.ext4",
- "mkfs.ext4 >= 1.0.0",
- "mkfs.ext4 <= 2.0.0",
- "mkfs.ext4 != 2.0.0",
- "mkfs.ext4 > 1.0.0",
- "mkfs.ext4 < 2.0.0",
- NULL
+ .needs_cmds = (struct tst_cmd[]) {
+ {.cmd = "mkfs.ext4"},
+ {.cmd = "mkfs.ext4 >= 1.0.0"},
+ {.cmd = "mkfs.ext4 <= 2.0.0"},
+ {.cmd = "mkfs.ext4 != 2.0.0"},
+ {.cmd = "mkfs.ext4 > 1.0.0"},
+ {.cmd = "mkfs.ext4 < 2.0.0"},
+ {}
}
};
diff --git a/lib/newlib_tests/tst_needs_cmds02.c b/lib/newlib_tests/tst_needs_cmds02.c
index 455a275ea..f1d6105c2 100644
--- a/lib/newlib_tests/tst_needs_cmds02.c
+++ b/lib/newlib_tests/tst_needs_cmds02.c
@@ -16,8 +16,8 @@ static void do_test(void)
static struct tst_test test = {
.test_all = do_test,
- .needs_cmds = (const char *[]) {
- "mkfs.ext45 >= 1.43.0",
- NULL
+ .needs_cmds = (struct tst_cmd[]) {
+ {.cmd = "mkfs.ext45 >= 1.43.0"},
+ {}
}
};
diff --git a/lib/newlib_tests/tst_needs_cmds03.c b/lib/newlib_tests/tst_needs_cmds03.c
index bdc1cdf6a..ac5f368e2 100644
--- a/lib/newlib_tests/tst_needs_cmds03.c
+++ b/lib/newlib_tests/tst_needs_cmds03.c
@@ -16,8 +16,8 @@ static void do_test(void)
static struct tst_test test = {
.test_all = do_test,
- .needs_cmds = (const char *[]) {
- "mkfs.ext4 ! 1.43.0",
- NULL
+ .needs_cmds = (struct tst_cmd[]) {
+ {.cmd = "mkfs.ext4 ! 1.43.0"},
+ {}
}
};
diff --git a/lib/newlib_tests/tst_needs_cmds04.c b/lib/newlib_tests/tst_needs_cmds04.c
index de10b8f3e..2aea51772 100644
--- a/lib/newlib_tests/tst_needs_cmds04.c
+++ b/lib/newlib_tests/tst_needs_cmds04.c
@@ -16,8 +16,8 @@ static void do_test(void)
static struct tst_test test = {
.test_all = do_test,
- .needs_cmds = (const char *[]) {
- "mkfs.ext4 > 1.43",
- NULL
+ .needs_cmds = (struct tst_cmd[]) {
+ {.cmd = "mkfs.ext4 > 1.43"},
+ {}
}
};
diff --git a/lib/newlib_tests/tst_needs_cmds05.c b/lib/newlib_tests/tst_needs_cmds05.c
index c3b2b3b9a..969d4e2f5 100644
--- a/lib/newlib_tests/tst_needs_cmds05.c
+++ b/lib/newlib_tests/tst_needs_cmds05.c
@@ -16,8 +16,8 @@ static void do_test(void)
static struct tst_test test = {
.test_all = do_test,
- .needs_cmds = (const char *[]) {
- "mkfs.ext4 > 1.43.0-1",
- NULL
+ .needs_cmds = (struct tst_cmd[]) {
+ {.cmd = "mkfs.ext4 > 1.43.0-1"},
+ {}
}
};
diff --git a/lib/newlib_tests/tst_needs_cmds06.c b/lib/newlib_tests/tst_needs_cmds06.c
index 40b1cf09c..91470ccf9 100644
--- a/lib/newlib_tests/tst_needs_cmds06.c
+++ b/lib/newlib_tests/tst_needs_cmds06.c
@@ -16,8 +16,8 @@ static void do_test(void)
static struct tst_test test = {
.test_all = do_test,
- .needs_cmds = (const char *[]) {
- "mkfs.ext4 > 1.43.0 2",
- NULL
+ .needs_cmds = (struct tst_cmd[]) {
+ {.cmd = "mkfs.ext4 > 1.43.0 2"},
+ {}
}
};
diff --git a/lib/newlib_tests/tst_needs_cmds07.c b/lib/newlib_tests/tst_needs_cmds07.c
index d0b4ce2ff..371bbdc1b 100644
--- a/lib/newlib_tests/tst_needs_cmds07.c
+++ b/lib/newlib_tests/tst_needs_cmds07.c
@@ -16,8 +16,8 @@ static void do_test(void)
static struct tst_test test = {
.test_all = do_test,
- .needs_cmds = (const char *[]) {
- "mkfs.ext45",
- NULL
+ .needs_cmds = (struct tst_cmd[]) {
+ {.cmd = "mkfs.ext45"},
+ {}
}
};
diff --git a/lib/newlib_tests/tst_needs_cmds08.c b/lib/newlib_tests/tst_needs_cmds08.c
index 38df2ef6d..412f9f293 100644
--- a/lib/newlib_tests/tst_needs_cmds08.c
+++ b/lib/newlib_tests/tst_needs_cmds08.c
@@ -18,9 +18,9 @@ static void do_test(void)
static struct tst_test test = {
.test_all = do_test,
- .needs_cmds = (const char *[]) {
- "mkfs.xfs",
- "mkfs.xfs >= 4.20.0",
- NULL
+ .needs_cmds = (struct tst_cmd[]) {
+ {.cmd = "mkfs.xfs"},
+ {.cmd = "mkfs.xfs >= 4.20.0"},
+ {}
}
};
diff --git a/testcases/kernel/device-drivers/zram/zram03.c b/testcases/kernel/device-drivers/zram/zram03.c
index 8cf26de4c..4dcf23b4e 100644
--- a/testcases/kernel/device-drivers/zram/zram03.c
+++ b/testcases/kernel/device-drivers/zram/zram03.c
@@ -240,9 +240,9 @@ static struct tst_test test = {
"zram",
NULL
},
- .needs_cmds = (const char *[]) {
- "modprobe",
- "rmmod",
- NULL
+ .needs_cmds = (struct tst_cmd[]) {
+ {.cmd = "modprobe"},
+ {.cmd = "rmmod"},
+ {}
}
};
diff --git a/testcases/kernel/fs/squashfs/squashfs01.c b/testcases/kernel/fs/squashfs/squashfs01.c
index fbcb76582..7a548d62c 100644
--- a/testcases/kernel/fs/squashfs/squashfs01.c
+++ b/testcases/kernel/fs/squashfs/squashfs01.c
@@ -102,9 +102,9 @@ static struct tst_test test = {
.needs_root = 1,
.needs_device = 1,
.dev_min_size = 1,
- .needs_cmds = (const char *const []) {
- "mksquashfs",
- NULL
+ .needs_cmds = (struct tst_cmd[]) {
+ {.cmd = "mksquashfs"},
+ {}
},
.needs_drivers = (const char *const []) {
"squashfs",
diff --git a/testcases/kernel/security/aslr/aslr01.c b/testcases/kernel/security/aslr/aslr01.c
index 6a396e29d..e6feb2d3c 100644
--- a/testcases/kernel/security/aslr/aslr01.c
+++ b/testcases/kernel/security/aslr/aslr01.c
@@ -277,8 +277,8 @@ static struct tst_test test = {
"CONFIG_HAVE_ARCH_MMAP_RND_BITS=y",
NULL
},
- .needs_cmds = (const char *[]) {
- "ldd",
- NULL
+ .needs_cmds = (struct tst_cmd[]) {
+ {.cmd = "ldd"},
+ {}
},
};
diff --git a/testcases/kernel/syscalls/add_key/add_key05.c b/testcases/kernel/syscalls/add_key/add_key05.c
index c9a2f840e..b51a84b97 100644
--- a/testcases/kernel/syscalls/add_key/add_key05.c
+++ b/testcases/kernel/syscalls/add_key/add_key05.c
@@ -231,11 +231,11 @@ static struct tst_test test = {
{&user_buf, .size = 64},
{}
},
- .needs_cmds = (const char *const []) {
- "useradd",
- "userdel",
- "groupdel",
- NULL
+ .needs_cmds = (struct tst_cmd[]) {
+ {.cmd = "useradd"},
+ {.cmd = "userdel"},
+ {.cmd = "groupdel"},
+ {}
},
.tags = (const struct tst_tag[]) {
{"linux-git", "a08bf91ce28"},
diff --git a/testcases/kernel/syscalls/fanotify/fanotify22.c b/testcases/kernel/syscalls/fanotify/fanotify22.c
index 357e74dbc..6578474a7 100644
--- a/testcases/kernel/syscalls/fanotify/fanotify22.c
+++ b/testcases/kernel/syscalls/fanotify/fanotify22.c
@@ -327,9 +327,9 @@ static struct tst_test test = {
{"linux-git", "76486b104168"},
{}
},
- .needs_cmds = (const char *[]) {
- "debugfs",
- NULL
+ .needs_cmds = (struct tst_cmd[]) {
+ {.cmd = "debugfs"},
+ {}
}
};
diff --git a/testcases/kernel/syscalls/ioctl/ioctl09.c b/testcases/kernel/syscalls/ioctl/ioctl09.c
index f86355f2c..1bd60fc84 100644
--- a/testcases/kernel/syscalls/ioctl/ioctl09.c
+++ b/testcases/kernel/syscalls/ioctl/ioctl09.c
@@ -108,9 +108,9 @@ static struct tst_test test = {
"loop",
NULL
},
- .needs_cmds = (const char *const []) {
- "parted",
- NULL
+ .needs_cmds = (struct tst_cmd[]) {
+ {.cmd = "parted"},
+ {}
},
.needs_tmpdir = 1,
};
diff --git a/testcases/kernel/syscalls/madvise/madvise11.c b/testcases/kernel/syscalls/madvise/madvise11.c
index 422589f5b..73d2d4294 100644
--- a/testcases/kernel/syscalls/madvise/madvise11.c
+++ b/testcases/kernel/syscalls/madvise/madvise11.c
@@ -421,10 +421,10 @@ static struct tst_test test = {
HW_MODULE,
NULL
},
- .needs_cmds = (const char *[]) {
- "modprobe",
- "rmmod",
- NULL
+ .needs_cmds = (struct tst_cmd[]) {
+ {.cmd = "modprobe"},
+ {.cmd = "rmmod"},
+ {}
},
.needs_kconfigs = (const char *[]) {
"CONFIG_MEMORY_FAILURE=y",
diff --git a/testcases/kernel/syscalls/quotactl/quotactl01.c b/testcases/kernel/syscalls/quotactl/quotactl01.c
index 9dcf74ceb..3091ac5bf 100644
--- a/testcases/kernel/syscalls/quotactl/quotactl01.c
+++ b/testcases/kernel/syscalls/quotactl/quotactl01.c
@@ -223,9 +223,9 @@ static struct tst_test test = {
{}
},
.mntpoint = MNTPOINT,
- .needs_cmds = (const char *const []) {
- "quotacheck",
- NULL
+ .needs_cmds = (struct tst_cmd[]) {
+ {.cmd = "quotacheck"},
+ {}
},
.setup = setup,
.cleanup = cleanup,
diff --git a/testcases/kernel/syscalls/quotactl/quotactl04.c b/testcases/kernel/syscalls/quotactl/quotactl04.c
index d2d7b3f3e..a70903330 100644
--- a/testcases/kernel/syscalls/quotactl/quotactl04.c
+++ b/testcases/kernel/syscalls/quotactl/quotactl04.c
@@ -165,8 +165,8 @@ static struct tst_test test = {
},
.mntpoint = MNTPOINT,
.test_variants = QUOTACTL_SYSCALL_VARIANTS,
- .needs_cmds = (const char *[]) {
- "mkfs.ext4 >= 1.43.0",
- NULL
+ .needs_cmds = (struct tst_cmd[]) {
+ {.cmd = "mkfs.ext4 >= 1.43.0"},
+ {}
}
};
diff --git a/testcases/kernel/syscalls/quotactl/quotactl06.c b/testcases/kernel/syscalls/quotactl/quotactl06.c
index 110a3aa9b..333f5720d 100644
--- a/testcases/kernel/syscalls/quotactl/quotactl06.c
+++ b/testcases/kernel/syscalls/quotactl/quotactl06.c
@@ -226,9 +226,9 @@ static struct tst_test test = {
},
.mntpoint = MNTPOINT,
.mount_device = 1,
- .needs_cmds = (const char *const []) {
- "quotacheck",
- NULL
+ .needs_cmds = (struct tst_cmd[]) {
+ {.cmd = "quotacheck"},
+ {}
},
.needs_root = 1,
.test_variants = QUOTACTL_FMT_VARIANTS,
diff --git a/testcases/kernel/syscalls/quotactl/quotactl08.c b/testcases/kernel/syscalls/quotactl/quotactl08.c
index 63087345f..ce7a8b008 100644
--- a/testcases/kernel/syscalls/quotactl/quotactl08.c
+++ b/testcases/kernel/syscalls/quotactl/quotactl08.c
@@ -220,8 +220,8 @@ static struct tst_test test = {
.setup = setup,
.cleanup = cleanup,
.test_variants = QUOTACTL_SYSCALL_VARIANTS,
- .needs_cmds = (const char *[]) {
- "mkfs.ext4 >= 1.43.0",
- NULL
+ .needs_cmds = (struct tst_cmd[]) {
+ {.cmd = "mkfs.ext4 >= 1.43.0"},
+ {}
}
};
diff --git a/testcases/kernel/syscalls/quotactl/quotactl09.c b/testcases/kernel/syscalls/quotactl/quotactl09.c
index 673666347..fd6629c0c 100644
--- a/testcases/kernel/syscalls/quotactl/quotactl09.c
+++ b/testcases/kernel/syscalls/quotactl/quotactl09.c
@@ -185,8 +185,8 @@ static struct tst_test test = {
.mount_device = 1,
.needs_root = 1,
.test_variants = QUOTACTL_SYSCALL_VARIANTS,
- .needs_cmds = (const char *[]) {
- "mkfs.ext4 >= 1.43.0",
- NULL
+ .needs_cmds = (struct tst_cmd[]) {
+ {.cmd = "mkfs.ext4 >= 1.43.0"},
+ {}
}
};
diff --git a/testcases/kernel/syscalls/statx/statx05.c b/testcases/kernel/syscalls/statx/statx05.c
index 2a4603226..07b5e7b94 100644
--- a/testcases/kernel/syscalls/statx/statx05.c
+++ b/testcases/kernel/syscalls/statx/statx05.c
@@ -123,9 +123,9 @@ static struct tst_test test = {
{.type = "ext4"},
{}
},
- .needs_cmds = (const char *[]) {
- "mkfs.ext4 >= 1.43.0",
- "e4crypt",
- NULL
+ .needs_cmds = (struct tst_cmd[]) {
+ {.cmd = "mkfs.ext4 >= 1.43.0"},
+ {.cmd = "e4crypt"},
+ {}
}
};
diff --git a/testcases/kernel/syscalls/statx/statx07.c b/testcases/kernel/syscalls/statx/statx07.c
index bab64591f..755644cf9 100644
--- a/testcases/kernel/syscalls/statx/statx07.c
+++ b/testcases/kernel/syscalls/statx/statx07.c
@@ -171,8 +171,8 @@ static struct tst_test test = {
{}
},
.needs_root = 1,
- .needs_cmds = (const char *[]) {
- "exportfs",
- NULL
+ .needs_cmds = (struct tst_cmd[]) {
+ {.cmd = "exportfs"},
+ {}
}
};
diff --git a/testcases/kernel/syscalls/statx/statx09.c b/testcases/kernel/syscalls/statx/statx09.c
index ee4be4250..8838d5450 100644
--- a/testcases/kernel/syscalls/statx/statx09.c
+++ b/testcases/kernel/syscalls/statx/statx09.c
@@ -162,8 +162,8 @@ static struct tst_test test = {
"CONFIG_FS_VERITY",
NULL
},
- .needs_cmds = (const char *[]) {
- "mkfs.ext4 >= 1.45.2",
- NULL
+ .needs_cmds = (struct tst_cmd[]) {
+ {.cmd = "mkfs.ext4 >= 1.45.2"},
+ {}
}
};
--
2.51.0
More information about the ltp
mailing list