public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH v2] kernel/mem/lib/mem.c: make tests continue to run even though KSM is not enabled
@ 2014-04-28 12:26 Xiaoguang Wang
  2014-04-29  7:31 ` Stanislav Kholmanskikh
  2014-05-05  6:13 ` Wanlong Gao
  0 siblings, 2 replies; 3+ messages in thread
From: Xiaoguang Wang @ 2014-04-28 12:26 UTC (permalink / raw)
  To: ltp-list

When kernel KSM configuration is not enabled, we make testcases continue to run
instead of returning TCONF, e.g. oom01. And if KSM configuration is not enabled, in
the original code, "tst_brkm(TCONF, NULL, ...)" will be called, in this case, we
will forget to execute the restore operations defined in cleanup, which will forget
to restore the /proc/sys/vm/overcommit_memory to 0, and this will impact other test
cases in LTP, for example, fork14 in RHEL5 will succeed unexpectedly.

Signed-off-by: Xiaoguang Wang <wangxg.fnst@cn.fujitsu.com>
---
 testcases/kernel/mem/lib/mem.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/testcases/kernel/mem/lib/mem.c b/testcases/kernel/mem/lib/mem.c
index 188a5ef..b975c62 100644
--- a/testcases/kernel/mem/lib/mem.c
+++ b/testcases/kernel/mem/lib/mem.c
@@ -146,11 +146,13 @@ void testoom(int mempolicy, int lite)
 	tst_resm(TINFO, "start OOM testing for mlocked pages.");
 	oom(MLOCK, lite);
 
-	if (access(PATH_KSM, F_OK) == -1)
-		tst_brkm(TCONF, NULL, "KSM configuration is not enabled");
-
-	tst_resm(TINFO, "start OOM testing for KSM pages.");
-	oom(KSM, lite);
+	if (access(PATH_KSM, F_OK) == -1) {
+		tst_resm(TINFO, "KSM configuration is not enabled, "
+			 "skip OOM test for KSM pags");
+	} else {
+		tst_resm(TINFO, "start OOM testing for KSM pages.");
+		oom(KSM, lite);
+	}
 }
 
 /* KSM */
-- 
1.8.2.1


------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get 
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

end of thread, other threads:[~2014-05-05  6:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-28 12:26 [LTP] [PATCH v2] kernel/mem/lib/mem.c: make tests continue to run even though KSM is not enabled Xiaoguang Wang
2014-04-29  7:31 ` Stanislav Kholmanskikh
2014-05-05  6:13 ` Wanlong Gao

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