Hi, According to the comment to oom testcases, maybe it is a better way to exit the test with TCONF when open returned ENOENT.
Here is the new patch, please comment, thanks.:) Signed-off-by: Tang Chen <[email protected]> --- testcases/kernel/mem/hugetlb/hugemmap/hugemmap05.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap05.c b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap05.c index 40dedea..9b2ca06 100644 --- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap05.c +++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap05.c @@ -301,6 +301,11 @@ static void setup(void) int fd; tst_require_root(NULL); + + fp = fopen(pathover, "r+"); + if (errno == ENOENT) + tst_brkm(TCONF, NULL, "File %s does not exist in the system", pathover); + tst_sig(FORK, DEF_HANDLER, cleanup); TEST_PAUSE; tst_tmpdir(); -- 1.7.4 On 05/25/2011 09:28 AM, tangchen wrote: > 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(); -- Best Regards, Tang chen ------------------------------------------------------------------------------ Simplify data backup and recovery for your virtual environment with vRanger. Installation's a snap, and flexible recovery options mean your data is safe, secure and there when you need it. Data protection magic? Nope - It's vRanger. Get your free trial download today. http://p.sf.net/sfu/quest-sfdev2dev _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
