Hi, The comment has been followed. And one more thing, I forgot to fclose(fp), and it is done this time. Here is the new patch, thanks.:)
Signed-off-by: Tang Chen <[email protected]> --- testcases/kernel/mem/hugetlb/hugemmap/hugemmap05.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap05.c b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap05.c index 40dedea..d1e6863 100644 --- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap05.c +++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap05.c @@ -301,6 +301,12 @@ static void setup(void) int fd; tst_require_root(NULL); + + fp = fopen(pathover, "r+"); + if (fp == NULL && errno == ENOENT) + tst_brkm(TCONF, NULL, "File %s does not exist in the system", pathover); + fclose(fp); + tst_sig(FORK, DEF_HANDLER, cleanup); TEST_PAUSE; tst_tmpdir(); -- 1.7.4 On 06/01/2011 01:47 PM, Garrett Cooper wrote: > On Tue, May 31, 2011 at 10:32 PM, tangchen <[email protected]> wrote: >> 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) > > if (fp == NULL && 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 >> > -- Best Regards, Tang chen -------------------------------------------------- Tang Chen Development Dept.I Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST) No.6 Wenzhu Road, Nanjing, 210012, China TEL: +86+25-86630566-8508 FUJITSU INTERNAL: 7998-8508 FAX: +86+25-83317685 EMail: [email protected] -------------------------------------------------- This communication is for use by the intended recipient(s) only and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not an intended recipient of this communication, you are hereby notified that any dissemination, distribution or copying hereof is strictly prohibited. If you have received this communication in error, please notify me by reply e-mail, permanently delete this communication from your system, and destroy any hard copies you may have printed ------------------------------------------------------------------------------ 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
