public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] mem/thp: skip thp02/thp03 if system not support hugepage
@ 2015-08-13  2:18 Li Wang
  2015-08-13  2:41 ` Li Wang
  2015-08-13 12:48 ` Cyril Hrubis
  0 siblings, 2 replies; 3+ messages in thread
From: Li Wang @ 2015-08-13  2:18 UTC (permalink / raw)
  To: ltp-list

Sometimes we get fails on system which not support hugepage:

thp02       1  TBROK  :  mem.c:1035: cannot find "Hugepagesize:" in /proc/meminfo
thp02       2  TBROK  :  mem.c:1035: Remaining cases broken

thp03       1  TBROK  :  mem.c:1035: cannot find "Hugepagesize:" in /proc/meminfo
thp03       2  TBROK  :  mem.c:1035: Remaining cases broken

Maybe skip the cases are better than TBROK them.

Signed-off-by: Li Wang <liwang@redhat.com>
---
 testcases/kernel/mem/thp/thp02.c | 3 +++
 testcases/kernel/mem/thp/thp03.c | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/testcases/kernel/mem/thp/thp02.c b/testcases/kernel/mem/thp/thp02.c
index 1470ae6..41d9192 100644
--- a/testcases/kernel/mem/thp/thp02.c
+++ b/testcases/kernel/mem/thp/thp02.c
@@ -121,6 +121,9 @@ static void do_mremap(void)
 
 void setup(void)
 {
+	if (access(PATH_THP, F_OK) == -1)
+		tst_brkm(TCONF, NULL, "THP is not enabled");
+
 	tst_sig(FORK, DEF_HANDLER, cleanup);
 	TEST_PAUSE;
 
diff --git a/testcases/kernel/mem/thp/thp03.c b/testcases/kernel/mem/thp/thp03.c
index 8f62d0c..42f9025 100644
--- a/testcases/kernel/mem/thp/thp03.c
+++ b/testcases/kernel/mem/thp/thp03.c
@@ -113,6 +113,9 @@ static void thp_test(void)
 
 void setup(void)
 {
+	if (access(PATH_THP, F_OK) == -1)
+		tst_brkm(TCONF, NULL, "THP is not enabled");
+
 	hugepage_size = read_meminfo("Hugepagesize:") * KB;
 	unaligned_size = hugepage_size * 4 - 1;
 	page_size = SAFE_SYSCONF(NULL, _SC_PAGESIZE);
-- 
1.8.3.1


------------------------------------------------------------------------------
_______________________________________________
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:[~2015-08-13 12:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-13  2:18 [LTP] [PATCH] mem/thp: skip thp02/thp03 if system not support hugepage Li Wang
2015-08-13  2:41 ` Li Wang
2015-08-13 12:48 ` Cyril Hrubis

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