Hi,

Kernel older than 2.6.24 does not contain /proc/sys/vm/nr_overcommit_hugepages 
file. So hugemmap05 should not be tested on a system with kernel older than 
2.6.24.
(Please refer to 
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d1c3fb1f8f29c41b0d098d7cfb3c32939043631f)
This patch checks the kernel tag before testing, and if the current kernel is 
not new enough, it will force the test program exit.

Signed-off-by: tangchen <[email protected]>
---
 testcases/kernel/mem/hugetlb/hugemmap/hugemmap05.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap05.c 
b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap05.c
index 40dedea..269dcf1 100644
--- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap05.c
+++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap05.c
@@ -301,6 +301,10 @@ static void setup(void)
        int fd;
 
        tst_require_root(NULL);
+
+       if (tst_kvercmp(2, 6, 24) < 0)
+               tst_brkm(TCONF, NULL, "2.6.24 or greater kernel required");
+
        tst_sig(FORK, DEF_HANDLER, cleanup);
        TEST_PAUSE;
        tst_tmpdir();
-- 
1.7.4

-- 
Best Regards,
Tang chen


------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to