[LTP] [PATCH v1] syscalls/swapping01: Use .needs_kconfigs instead of .setup
Bogdan Lezhepekov
blezhepekov@suse.de
Fri Feb 11 17:24:26 CET 2022
needs_kconfigs is more beneficial for docparser
Signed-off-by: Bogdan Lezhepekov <blezhepekov@suse.de>
---
testcases/kernel/mem/swapping/swapping01.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/testcases/kernel/mem/swapping/swapping01.c b/testcases/kernel/mem/swapping/swapping01.c
index 3b4f0a61a..f6133cc0d 100644
--- a/testcases/kernel/mem/swapping/swapping01.c
+++ b/testcases/kernel/mem/swapping/swapping01.c
@@ -155,18 +155,15 @@ static void check_swapping(void)
SAFE_WAITPID(pid, &status, 0);
}
-static void setup(void)
-{
- if (access("/proc/swaps", F_OK))
- tst_brk(TCONF, "swap not supported by kernel");
-}
-
static struct tst_test test = {
.needs_root = 1,
.forks_child = 1,
.min_mem_avail = 10,
.test_all = test_swapping,
- .setup = setup,
+ .needs_kconfigs = (const char *[]) {
+ "CONFIG_SWAP=y",
+ NULL
+ },
.tags = (const struct tst_tag[]) {
{"linux-git", "50a15981a1fa"},
{}
--
2.35.1
More information about the ltp
mailing list