public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/3] swapping01: skip test if zram-swap is being used
@ 2021-12-09  7:43 Yang Xu
  2021-12-09  7:43 ` [LTP] [PATCH 2/3] zram/zram_lib.sh: Skip test if zram module can not be removed Yang Xu
                   ` (2 more replies)
  0 siblings, 3 replies; 32+ messages in thread
From: Yang Xu @ 2021-12-09  7:43 UTC (permalink / raw)
  To: ltp

For the swapping test we attempt to allocate 130% of the available RAM and
we make sure that the overflow would fit the swap, but as long as swap is
backed by RAM this obviously false. So skip it if zram-swap is being used.

Fixes: #888
Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
 testcases/kernel/mem/swapping/swapping01.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/testcases/kernel/mem/swapping/swapping01.c b/testcases/kernel/mem/swapping/swapping01.c
index 392b79d65..29c1e0443 100644
--- a/testcases/kernel/mem/swapping/swapping01.c
+++ b/testcases/kernel/mem/swapping/swapping01.c
@@ -67,6 +67,11 @@ static void test_swapping(void)
 #ifdef TST_ABI32
 	tst_brk(TCONF, "test is not designed for 32-bit system.");
 #endif
+	int ret;
+
+	ret = tst_system("zramctl | grep SWAP");
+	if (!ret)
+		tst_brk(TCONF, "zram-swap is being used!");
 
 	init_meminfo();
 
@@ -155,4 +160,8 @@ static struct tst_test test = {
 	.needs_root = 1,
 	.forks_child = 1,
 	.test_all = test_swapping,
+	.needs_cmds = (const char *[]) {
+		"zramctl",
+		NULL
+	}
 };
-- 
2.23.0


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

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

end of thread, other threads:[~2021-12-15 11:56 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-09  7:43 [LTP] [PATCH 1/3] swapping01: skip test if zram-swap is being used Yang Xu
2021-12-09  7:43 ` [LTP] [PATCH 2/3] zram/zram_lib.sh: Skip test if zram module can not be removed Yang Xu
2021-12-09 15:17   ` Cyril Hrubis
2021-12-09 21:11     ` Petr Vorel
2021-12-10  8:56       ` xuyang2018.jy
2021-12-10  9:03         ` Petr Vorel
2021-12-10  9:31           ` xuyang2018.jy
2021-12-13  7:40             ` Petr Vorel
2021-12-13  8:05               ` xuyang2018.jy
2021-12-13 10:34                 ` Petr Vorel
2021-12-14  3:45                   ` xuyang2018.jy
2021-12-14  6:35                     ` xuyang2018.jy
2021-12-15 11:56                     ` Petr Vorel
2021-12-10  8:27     ` xuyang2018.jy
2021-12-09  7:43 ` [LTP] [PATCH 3/3] zram/zram03: Convert into new api Yang Xu
2021-12-09 21:38   ` Petr Vorel
2021-12-10 10:55     ` xuyang2018.jy
2021-12-10 11:06       ` xuyang2018.jy
2021-12-13  7:30         ` Petr Vorel
2021-12-10 11:40     ` [LTP] [PATCH v2 1/3] swapping01: skip test if zram-swap is being used Yang Xu
2021-12-10 11:40       ` [LTP] [PATCH v2 2/3] zram/zram_lib.sh: Skip test if zram module can not be removed Yang Xu
2021-12-10 12:25         ` Cyril Hrubis
2021-12-10 11:40       ` [LTP] [PATCH v2 3/3] zram/zram03: Convert into new api Yang Xu
2021-12-10 12:28         ` Cyril Hrubis
2021-12-13  5:44           ` [LTP] [PATCH v3 1/3] swapping01: skip test if zram-swap is being used Yang Xu
2021-12-13  5:44             ` [LTP] [PATCH v3 2/3] zram/zram_lib.sh: Skip test if zram module can not be removed Yang Xu
2021-12-15  6:24               ` xuyang2018.jy
2021-12-10 11:51       ` [LTP] [PATCH v2 1/3] swapping01: skip test if zram-swap is being used Cyril Hrubis
2021-12-10 11:52       ` Cyril Hrubis
2021-12-09 15:15 ` [LTP] [PATCH " Cyril Hrubis
2021-12-09 20:57   ` Petr Vorel
2021-12-10  2:57     ` xuyang2018.jy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox