All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH v1] mem/swapping01: Make sure swap is supported by kernel
@ 2022-02-10 13:38 Bogdan Lezhepekov via ltp
  2022-02-10 16:11 ` Cyril Hrubis
  0 siblings, 1 reply; 11+ messages in thread
From: Bogdan Lezhepekov via ltp @ 2022-02-10 13:38 UTC (permalink / raw)
  To: ltp

Previous version caused false positive result
on machines support no swap in kernel.

Signed-off-by: Bogdan Lezhepekov <bogdan.lezhepekov@suse.com>
---
 testcases/kernel/mem/swapping/swapping01.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/testcases/kernel/mem/swapping/swapping01.c b/testcases/kernel/mem/swapping/swapping01.c
index 1a494bf69..3b4f0a61a 100644
--- a/testcases/kernel/mem/swapping/swapping01.c
+++ b/testcases/kernel/mem/swapping/swapping01.c
@@ -155,11 +155,18 @@ 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,
 	.tags = (const struct tst_tag[]) {
 		{"linux-git", "50a15981a1fa"},
 		{}
-- 
2.35.1


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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-02-12  2:19 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-10 13:38 [LTP] [PATCH v1] mem/swapping01: Make sure swap is supported by kernel Bogdan Lezhepekov via ltp
2022-02-10 16:11 ` Cyril Hrubis
2022-02-10 16:30   ` Bogdan Lezhepekov via ltp
2022-02-11  0:39   ` Li Wang
2022-02-11  1:21     ` xuyang2018.jy
2022-02-11  7:35       ` Bogdan Lezhepekov via ltp
2022-02-11  8:30         ` xuyang2018.jy
2022-02-11  8:59           ` Petr Vorel
2022-02-11 13:15             ` Cyril Hrubis
2022-02-11 13:16               ` Bogdan Lezhepekov via ltp
2022-02-12  2:19                 ` Li Wang

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.