public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Li Wang <liwang@redhat.com>
To: ltp-list@lists.sourceforge.net
Subject: [LTP] [PATCH] mem/thp: skip thp02/thp03 if system not support hugepage
Date: Thu, 13 Aug 2015 10:18:26 +0800	[thread overview]
Message-ID: <1439432306-2918-1-git-send-email-liwang@redhat.com> (raw)

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

             reply	other threads:[~2015-08-13  2:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-13  2:18 Li Wang [this message]
2015-08-13  2:41 ` [LTP] [PATCH] mem/thp: skip thp02/thp03 if system not support hugepage Li Wang
2015-08-13 12:48 ` Cyril Hrubis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1439432306-2918-1-git-send-email-liwang@redhat.com \
    --to=liwang@redhat.com \
    --cc=ltp-list@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox