public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP]  [PATCH] mbind01: Fix the bug of mind case10
@ 2009-09-02  7:48 Zhang Xiliang
  2009-09-07 11:41 ` Subrata Modak
  0 siblings, 1 reply; 2+ messages in thread
From: Zhang Xiliang @ 2009-09-02  7:48 UTC (permalink / raw)
  To: ltp-list

I tested ltp mbind01 case and found the case10 failed.

In case10, the expect errno is EFAULT. 

In mbind manual, it says "EFAULT Part or all of the memory range specified by nodemask 
and maxnode points outside your accessible address space. "

So the case should use invalid "nodemask" instead of invalid "p" to test.

Signed-off-by: Zhang Xiliang <zhangxiliang@cn.fujitsu.com>
---
 testcases/kernel/syscalls/mbind/mbind01.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/testcases/kernel/syscalls/mbind/mbind01.c b/testcases/kernel/syscalls/mbind/mbind01.c
index 446fdaf..4afa71b 100644
--- a/testcases/kernel/syscalls/mbind/mbind01.c
+++ b/testcases/kernel/syscalls/mbind/mbind01.c
@@ -238,8 +238,8 @@ static struct test_case tcase[] = {
         },
         { // case10
                 .ttype          = INVALID_POINTER,
-                .policy         = MPOL_DEFAULT,
-                .from_node      = NONE,
+                .policy         = MPOL_PREFERRED,
+                .from_node      = SELF,
                 .ret            = -1,
                 .err            = EFAULT,
         },
@@ -263,6 +263,7 @@ static int do_test(struct test_case *tc) {
         nodemask_t nodemask, getnodemask;
         unsigned long maxnode = NUMA_NUM_NODES;
         unsigned long len = MEM_LENGTH;
+	unsigned long *invalid_nodemask;
 
         /* We assume that there is only one node(node0). */
         nodemask_zero(&nodemask);
@@ -279,13 +280,15 @@ static int do_test(struct test_case *tc) {
                 tst_exit();
         }
         if(tc->ttype == INVALID_POINTER)
-                p = (char*)0xc0000000;
+		invalid_nodemask = (unsigned long *)0xc0000000;
 /*
          * Execute system call
          */
         errno = 0;
         if (tc->from_node == NONE)
                 TEST(sys_ret = syscall(__NR_mbind, p, len, tc->policy,NULL, 0, tc->flags));
+	else if (tc->ttype == INVALID_POINTER)
+		TEST(sys_ret = syscall(__NR_mbind, p, len, tc->policy, invalid_nodemask, maxnode, tc->flags));
         else
                 TEST(sys_ret = syscall(__NR_mbind, p, len, tc->policy,&nodemask, maxnode, tc->flags));
         sys_errno = errno;


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-09-07 11:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-02  7:48 [LTP] [PATCH] mbind01: Fix the bug of mind case10 Zhang Xiliang
2009-09-07 11:41 ` Subrata Modak

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