public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] mbind01 test failed with after ltp-2009-11-12.tar.gz
@ 2009-11-25  3:07 Mitani
  2009-11-25  5:17 ` Garrett Cooper
  0 siblings, 1 reply; 7+ messages in thread
From: Mitani @ 2009-11-25  3:07 UTC (permalink / raw)
  To: ltp-list

Hi,

Following failure occurred in mbind01 when I execute "runltp" using 
ltp-2009-11-12.tar.gz.
Similer failure occured with several recent versions from
ltp-2009-11-17.tar.gz
to ltp-2009-11-24.tar.gz, too.

<error message>
-----------------------------
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=-1 errno=38 (Function not implemented)
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=38 (Function not implemented)
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=38 (Function not implemented)
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=-1 errno=38 (Function not implemented)
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=38 (Function not implemented)
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=-1 errno=38 (Function not implemented)
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=-1 errno=38 (Function not implemented)
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=-1 errno=38 (Function not implemented)
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=38 (Function not implemented)
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=38 (Function not implemented)
EXPECT: return value(ret)=-1 errno=14 (Bad address)
RESULT: return value(ret)=-1 errno=38 (Function not implemented)
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=-1 errno=38 (Function not implemented)
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=38 (Function not implemented)
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=38 (Function not implemented)
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=-1 errno=38 (Function not implemented)
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=38 (Function not implemented)
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=-1 errno=38 (Function not implemented)
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=-1 errno=38 (Function not implemented)
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=-1 errno=38 (Function not implemented)
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=38 (Function not implemented)
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=38 (Function not implemented)
EXPECT: return value(ret)=-1 errno=14 (Bad address)
RESULT: return value(ret)=-1 errno=38 (Function not implemented)
mbind01     0  TINFO  :  (case00) START
mbind01     1  TFAIL  :  (case00) END: errno=???(38): Function not
implemented
mbind01     0  TINFO  :  (case01) START
mbind01     2  TFAIL  :  (case01) END: errno=???(38): Function not
implemented
mbind01     0  TINFO  :  (case02) START
mbind01     3  TFAIL  :  (case02) END: errno=???(38): Function not
implemented
mbind01     0  TINFO  :  (case03) START
mbind01     4  TFAIL  :  (case03) END: errno=???(38): Function not
implemented
mbind01     0  TINFO  :  (case04) START
mbind01     5  TFAIL  :  (case04) END: errno=???(38): Function not
implemented
mbind01     0  TINFO  :  (case05) START
mbind01     6  TFAIL  :  (case05) END: errno=???(38): Function not
implemented
mbind01     0  TINFO  :  (case06) START
mbind01     7  TFAIL  :  (case06) END: errno=???(38): Function not
implemented
mbind01     0  TINFO  :  (case07) START
mbind01     8  TFAIL  :  (case07) END: errno=???(38): Function not
implemented
mbind01     0  TINFO  :  (case08) START
mbind01     9  TFAIL  :  (case08) END: errno=???(38): Function not
implemented
mbind01     0  TINFO  :  (case09) START
mbind01    10  TFAIL  :  (case09) END: errno=???(38): Function not
implemented
mbind01     0  TINFO  :  (case10) START
mbind01    11  TFAIL  :  (case10) END: errno=???(38): Function not
implemented
mbind01     0  TINFO  :  (case00) START
mbind01    12  TFAIL  :  (case00) END: errno=???(38): Function not
implemented
mbind01     0  TINFO  :  (case01) START
mbind01    13  TFAIL  :  (case01) END: errno=???(38): Function not
implemented
mbind01     0  TINFO  :  (case02) START
mbind01    14  TFAIL  :  (case02) END: errno=???(38): Function not
implemented
mbind01     0  TINFO  :  (case03) START
mbind01    15  TFAIL  :  (case03) END: errno=???(38): Function not
implemented
mbind01     0  TINFO  :  (case04) START
mbind01    16  TFAIL  :  (case04) END: errno=???(38): Function not
implemented
mbind01     0  TINFO  :  (case05) START
mbind01    17  TFAIL  :  (case05) END: errno=???(38): Function not
implemented
mbind01     0  TINFO  :  (case06) START
mbind01    18  TFAIL  :  (case06) END: errno=???(38): Function not
implemented
mbind01     0  TINFO  :  (case07) START
mbind01    19  TFAIL  :  (case07) END: errno=???(38): Function not
implemented
mbind01     0  TINFO  :  (case08) START
mbind01    20  TFAIL  :  (case08) END: errno=???(38): Function not
implemented
mbind01     0  TINFO  :  (case09) START
mbind01    21  TFAIL  :  (case09) END: errno=???(38): Function not
implemented
mbind01     0  TINFO  :  (case10) START
mbind01    22  TFAIL  :  (case10) END: errno=???(38): Function not
implemented
-----------------------------


On the other hand, with "ltp-full-20091031", it passed as following message
(My system not supports NUMA).

-----------------------------
mbind01     1  TCONF  :  NUMA support not provided.
-----------------------------


Therefore, this problem seems to be after 2009/11/04 revision, I think.


Following shows revision contribution contents.

http://ltp.cvs.sourceforge.net/viewvc/ltp/ltp/testcases/kernel/syscalls/mbin
d/mbind01.c?view=log

-----------------------------
Revision 1.7
Wed Nov 4 06:18:27 2009 UTC (2 weeks, 6 days ago) by yaberauneya 
Branch: MAIN 
Changes since 1.6: +1 -13 lines 
Diff to previous 1.6 
I was confused, and numaif.h is in fact a header under
testcases/kernel/syscalls/utils. As such:

1. The autoconf test for the header is removed.
2. An appropriate inclusion is added for numa.h in numaif.h
3. Remove overengineered code in get_mempolicy01.c because
linux_syscall_numbers.h handles the unhandled numa syscall numbers.

Signed-off-by: Garrett Cooper <yanegomi@gmail.com>


Revision 1.6
Wed Nov 4 04:59:44 2009 UTC (2 weeks, 6 days ago) by yaberauneya 
Branch: MAIN 
Changes since 1.5: +263 -281 lines 
Diff to previous 1.5 
1. Disable the test whenever the appropriate headers and syscalls don't
exist so this will compile on systems without numa and without.
2. Fix the indentation.
3. Use TFAIL | TERRNO instead of all of the ad-hoc (TFAIL ... TERRNO,
strerror(TERRNO)) logic.

Signed-off-by: Garrett Cooper <yanegomi@gmail.com>
-----------------------------


According to the contribution of these revisions, it is written that 
"Disable the test whenever the appropriate headers and syscalls don't
exist.".
However, when I compare these revisions, the judgement sentence 
whether numa is supported or not is deleted, and the error output sentence
that numa is not supported is deleted.

Following shows the result of compare of "Revision 1.6 and Revision 1.5"
and "Revision 1.7 and Revision 1.6".

<Revision 1.6 and Revision 1.5>
-----------------------------
--- mbind01.c	2009/10/09 17:55:57	1.5
+++ mbind01.c	2009/11/04 04:59:44	1.6
@@ -1,50 +1,51 @@
.
@@ -55,10 +56,12 @@
.
@@ -66,70 +69,72 @@
.
-#if HAS_NUMA_H
 static struct test_case tcase[] = {
.
-#else
-static struct test_case tcase[] = { };
-#endif
.
@@ -261,82 +262,80 @@
.
 static int do_test(struct test_case *tc) {
-#if HAS_NUMA_H
.
-#else
-	return -1;
-#endif
.
@@ -346,47 +345,43 @@
.
-#if HAS_NUMA_H
.
@@ -394,45 +389,32 @@
.
 #else
+int main (void) {
 	tst_resm(TCONF, "NUMA support not provided.");
-#endif
-        cleanup();
 	tst_exit();
 }
+#endif
-----------------------------

<Revision 1.7 and Revision 1.6>
-----------------------------
--- mbind01.c	2009/11/04 04:59:44	1.6
+++ mbind01.c	2009/11/04 06:18:27	1.7
@@ -59,14 +59,11 @@
.
@@ -77,8 +74,6 @@
.
@@ -411,10 +406,3 @@
 	cleanup();
 	tst_exit();
 }
-
-#else
-int main (void) {
-	tst_resm(TCONF, "NUMA support not provided.");
-	tst_exit();
-}
-#endif
-----------------------------

I think that these revisions may contradict the above contribution.
(Please forgive me if my opinion was wrong.)


To revise this problem (error of "Function not implemented") like above 
contribution, it is necessary to judge numa supporting by using "#if
HAS_NUMA_H".
And it is necessary to end with " tst_resm(TCONF, "NUMA support not
provided.") "
when not support, I think.
It is the point same as 2009/10/31 version.


Following shows my revise draft.


============
--- mbind01.c.org	2009-11-24 18:17:27.000000000 +0900
+++ mbind01.c	2009-11-24 16:09:03.000000000 +0900
@@ -176,6 +176,7 @@
  *		      (only we can do is simulate 1-node NUMA)
  */
 
+#if HAS_NUMA_H
 static struct test_case tcase[] = {
 	{ /* case00 */
 		.policy	    = MPOL_DEFAULT,
@@ -246,6 +247,7 @@
 		.err	    = EFAULT,
 	},
 };
+#endif
 
 #define MEM_LENGTH	      (4 * 1024 * 1024)
 /*
@@ -365,6 +367,7 @@
 
 	setup();
 
+#if HAS_NUMA_H
 	int lc, i, ret;		 /* loop counter */
 
 	/* Check looping state if -i option given */
@@ -404,4 +407,9 @@
 	}
 	cleanup();
 	tst_exit();
+
+#else
+	tst_resm(TCONF, "NUMA support not provided.");
+#endif
+
 }
============


Can I get opinion that my revision is right or not?


Thank you--


-Tomonori Mitani



------------------------------------------------------------------------------
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	[flat|nested] 7+ messages in thread

* Re: [LTP] mbind01 test failed with after ltp-2009-11-12.tar.gz
  2009-11-25  3:07 [LTP] mbind01 test failed with after ltp-2009-11-12.tar.gz Mitani
@ 2009-11-25  5:17 ` Garrett Cooper
  2009-11-25  5:33   ` Mike Frysinger
  0 siblings, 1 reply; 7+ messages in thread
From: Garrett Cooper @ 2009-11-25  5:17 UTC (permalink / raw)
  To: Mitani; +Cc: ltp-list, Mike Frysinger, Nate Straz

On Tue, Nov 24, 2009 at 7:07 PM, Mitani <mitani@ryobi.co.jp> wrote:
> Hi,
>
> Following failure occurred in mbind01 when I execute "runltp" using
> ltp-2009-11-12.tar.gz.
> Similer failure occured with several recent versions from
> ltp-2009-11-17.tar.gz
> to ltp-2009-11-24.tar.gz, too.
>
> <error message>

[...]

> On the other hand, with "ltp-full-20091031", it passed as following message
> (My system not supports NUMA).
>
> -----------------------------
> mbind01     1  TCONF  :  NUMA support not provided.
> -----------------------------
>
>
> Therefore, this problem seems to be after 2009/11/04 revision, I think.
>
>
> Following shows revision contribution contents.
>
> http://ltp.cvs.sourceforge.net/viewvc/ltp/ltp/testcases/kernel/syscalls/mbin
> d/mbind01.c?view=log
>
> -----------------------------
> Revision 1.7
> Wed Nov 4 06:18:27 2009 UTC (2 weeks, 6 days ago) by yaberauneya
> Branch: MAIN
> Changes since 1.6: +1 -13 lines
> Diff to previous 1.6
> I was confused, and numaif.h is in fact a header under
> testcases/kernel/syscalls/utils. As such:
>
> 1. The autoconf test for the header is removed.
> 2. An appropriate inclusion is added for numa.h in numaif.h
> 3. Remove overengineered code in get_mempolicy01.c because
> linux_syscall_numbers.h handles the unhandled numa syscall numbers.
>
> Signed-off-by: Garrett Cooper <yanegomi@gmail.com>
>
>
> Revision 1.6
> Wed Nov 4 04:59:44 2009 UTC (2 weeks, 6 days ago) by yaberauneya
> Branch: MAIN
> Changes since 1.5: +263 -281 lines
> Diff to previous 1.5
> 1. Disable the test whenever the appropriate headers and syscalls don't
> exist so this will compile on systems without numa and without.
> 2. Fix the indentation.
> 3. Use TFAIL | TERRNO instead of all of the ad-hoc (TFAIL ... TERRNO,
> strerror(TERRNO)) logic.
>
> Signed-off-by: Garrett Cooper <yanegomi@gmail.com>
> -----------------------------
>
>
> According to the contribution of these revisions, it is written that
> "Disable the test whenever the appropriate headers and syscalls don't
> exist.".
> However, when I compare these revisions, the judgement sentence
> whether numa is supported or not is deleted, and the error output sentence
> that numa is not supported is deleted.
>
> Following shows the result of compare of "Revision 1.6 and Revision 1.5"
> and "Revision 1.7 and Revision 1.6".
>
> <Revision 1.6 and Revision 1.5>
> -----------------------------
> --- mbind01.c   2009/10/09 17:55:57     1.5
> +++ mbind01.c   2009/11/04 04:59:44     1.6
> @@ -1,50 +1,51 @@
> .
> @@ -55,10 +56,12 @@
> .
> @@ -66,70 +69,72 @@
> .
> -#if HAS_NUMA_H
>  static struct test_case tcase[] = {
> .
> -#else
> -static struct test_case tcase[] = { };
> -#endif
> .
> @@ -261,82 +262,80 @@
> .
>  static int do_test(struct test_case *tc) {
> -#if HAS_NUMA_H
> .
> -#else
> -       return -1;
> -#endif
> .
> @@ -346,47 +345,43 @@
> .
> -#if HAS_NUMA_H
> .
> @@ -394,45 +389,32 @@
> .
>  #else
> +int main (void) {
>        tst_resm(TCONF, "NUMA support not provided.");
> -#endif
> -        cleanup();
>        tst_exit();
>  }
> +#endif
> -----------------------------
>
> <Revision 1.7 and Revision 1.6>
> -----------------------------
> --- mbind01.c   2009/11/04 04:59:44     1.6
> +++ mbind01.c   2009/11/04 06:18:27     1.7
> @@ -59,14 +59,11 @@
> .
> @@ -77,8 +74,6 @@
> .
> @@ -411,10 +406,3 @@
>        cleanup();
>        tst_exit();
>  }
> -
> -#else
> -int main (void) {
> -       tst_resm(TCONF, "NUMA support not provided.");
> -       tst_exit();
> -}
> -#endif
> -----------------------------
>
> I think that these revisions may contradict the above contribution.
> (Please forgive me if my opinion was wrong.)
>
>
> To revise this problem (error of "Function not implemented") like above
> contribution, it is necessary to judge numa supporting by using "#if
> HAS_NUMA_H".
> And it is necessary to end with " tst_resm(TCONF, "NUMA support not
> provided.") "
> when not support, I think.
> It is the point same as 2009/10/31 version.
>
>
> Following shows my revise draft.
>
>
> ============
> --- mbind01.c.org       2009-11-24 18:17:27.000000000 +0900
> +++ mbind01.c   2009-11-24 16:09:03.000000000 +0900
> @@ -176,6 +176,7 @@
>  *                   (only we can do is simulate 1-node NUMA)
>  */
>
> +#if HAS_NUMA_H
>  static struct test_case tcase[] = {
>        { /* case00 */
>                .policy     = MPOL_DEFAULT,
> @@ -246,6 +247,7 @@
>                .err        = EFAULT,
>        },
>  };
> +#endif
>
>  #define MEM_LENGTH           (4 * 1024 * 1024)
>  /*
> @@ -365,6 +367,7 @@
>
>        setup();
>
> +#if HAS_NUMA_H
>        int lc, i, ret;          /* loop counter */
>
>        /* Check looping state if -i option given */
> @@ -404,4 +407,9 @@
>        }
>        cleanup();
>        tst_exit();
> +
> +#else
> +       tst_resm(TCONF, "NUMA support not provided.");
> +#endif
> +
>  }
> ============
>
>
> Can I get opinion that my revision is right or not?

Something I realized after testing yesterday, is that although we're
overriding syscall, it doesn't catch ENOSYS and output tst_brkm(TCONF,
...) like I thought it would.

Would you please do the following?

1. cd $LTPSRC/testcases/kernel/include
2. Apply the following patch:

Index: regen.sh
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/include/regen.sh,v
retrieving revision 1.12
diff -u -p -r1.12 regen.sh
--- regen.sh	19 Nov 2009 19:35:15 -0000	1.12
+++ regen.sh	25 Nov 2009 05:12:13 -0000
@@ -32,8 +32,13 @@ static void cleanup(void);
 		tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on your arch"); \\
 		errno = ENOSYS; \\
 		__ret = -1; \\
-	} else \\
+	} else { \\
 		__ret = syscall(NR, ##__VA_ARGS__); \\
+		if (__ret == -1 && errno == ENOSYS) { \\
+			tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on your arch"); \\
+			errno = ENOSYS; \\
+		} \\
+	} \\
 	__ret; \\
 })
 EOF

3. make clean all
4. cd ../syscalls/mbind
5. make clean all
6. ./mbind01

Let me know how it goes -- if other folks agree with the solution
(ENOSYS is always TCONF with the syscall(2) wrapper) I'll check it
directly into CVS; otherwise I'll have to engineer a large scale
solution in a number of tests which have syscall numbers defined on
later kernel versions, s.t. they fail happily with TCONF when errno ==
ENOSYS.

Thanks!
-Garrett

------------------------------------------------------------------------------
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	[flat|nested] 7+ messages in thread

* Re: [LTP] mbind01 test failed with after ltp-2009-11-12.tar.gz
  2009-11-25  5:17 ` Garrett Cooper
@ 2009-11-25  5:33   ` Mike Frysinger
  2009-11-25  6:26     ` Garrett Cooper
  0 siblings, 1 reply; 7+ messages in thread
From: Mike Frysinger @ 2009-11-25  5:33 UTC (permalink / raw)
  To: Garrett Cooper; +Cc: ltp-list, Nate Straz, Mitani


[-- Attachment #1.1: Type: Text/Plain, Size: 1185 bytes --]

On Wednesday 25 November 2009 00:17:16 Garrett Cooper wrote:
> --- regen.sh	19 Nov 2009 19:35:15 -0000	1.12
> +++ regen.sh	25 Nov 2009 05:12:13 -0000
> @@ -32,8 +32,13 @@ static void cleanup(void);
>  		tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on your arch");
>  \\ errno = ENOSYS; \\
>  		__ret = -1; \\
> -	} else \\
> +	} else { \\
>  		__ret = syscall(NR, ##__VA_ARGS__); \\
> +		if (__ret == -1 && errno == ENOSYS) { \\
> +			tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on your arch");
>  \\ +			errno = ENOSYS; \\
> +		} \\
> +	} \\
>  	__ret; \\
>  })
>  EOF

i'd prefer this change
--- testcases/kernel/include/regen.sh	9 Oct 2009 17:55:48 -0000	1.11
+++ testcases/kernel/include/regen.sh	25 Nov 2009 05:28:27 -0000
@@ -30,11 +30,12 @@ static void cleanup(void);
 #define syscall(NR, ...) ({ \\
 	int __ret; \\
 	if (NR == 0) { \\
-		tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on your arch"); \\
 		errno = ENOSYS; \\
 		__ret = -1; \\
 	} else \\
 		__ret = syscall(NR, ##__VA_ARGS__); \\
+	if (__ret == -1 && errno == ENOSYS) \\
+		tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on your arch"); \\
 	__ret; \\
 })
 EOF

-mike

[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 354 bytes --]

------------------------------------------------------------------------------
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

[-- Attachment #3: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] mbind01 test failed with after ltp-2009-11-12.tar.gz
  2009-11-25  5:33   ` Mike Frysinger
@ 2009-11-25  6:26     ` Garrett Cooper
  2009-11-25  7:36       ` Mike Frysinger
  2009-11-26  3:02       ` Mitani
  0 siblings, 2 replies; 7+ messages in thread
From: Garrett Cooper @ 2009-11-25  6:26 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: ltp-list, Nate Straz, Mitani

On Tue, Nov 24, 2009 at 9:33 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> On Wednesday 25 November 2009 00:17:16 Garrett Cooper wrote:
>> --- regen.sh  19 Nov 2009 19:35:15 -0000      1.12
>> +++ regen.sh  25 Nov 2009 05:12:13 -0000
>> @@ -32,8 +32,13 @@ static void cleanup(void);
>>               tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on your arch");
>>  \\ errno = ENOSYS; \\
>>               __ret = -1; \\
>> -     } else \\
>> +     } else { \\
>>               __ret = syscall(NR, ##__VA_ARGS__); \\
>> +             if (__ret == -1 && errno == ENOSYS) { \\
>> +                     tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on your arch");
>>  \\ +                 errno = ENOSYS; \\
>> +             } \\
>> +     } \\
>>       __ret; \\
>>  })
>>  EOF
>
> i'd prefer this change
> --- testcases/kernel/include/regen.sh   9 Oct 2009 17:55:48 -0000       1.11
> +++ testcases/kernel/include/regen.sh   25 Nov 2009 05:28:27 -0000
> @@ -30,11 +30,12 @@ static void cleanup(void);
>  #define syscall(NR, ...) ({ \\
>        int __ret; \\
>        if (NR == 0) { \\
> -               tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on your arch"); \\
>                errno = ENOSYS; \\
>                __ret = -1; \\
>        } else \\
>                __ret = syscall(NR, ##__VA_ARGS__); \\
> +       if (__ret == -1 && errno == ENOSYS) \\
> +               tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on your arch"); \\
>        __ret; \\
>  })
>  EOF

    Ok -- that makes more sense.. besides, I think gcc was optimizing
out the first branch with -O2 if it always evaluated to false. Here's
the new patch (I'm keeping the errno = ENOSYS part because I want to
make sure that tst_brkm doesn't mess up the errno value if a write(2)
fails or something).
Thanks!
-Garrett

EXAMPLE (Positive):

gcooper@orangebox
/scratch/ltp-dev2/ltp/testcases/kernel/syscalls/mbind $ ./mbind01
mbind01     0  TINFO  :  (case00) START
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=0 errno=0 (Success)
mbind01     1  TPASS  :  (case00) END
mbind01     0  TINFO  :  (case01) START
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=22 (Invalid argument)
mbind01     2  TPASS  :  (case01) END
mbind01     0  TINFO  :  (case02) START
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=22 (Invalid argument)
mbind01     3  TPASS  :  (case02) END
mbind01     0  TINFO  :  (case03) START
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=0 errno=0 (Success)
mbind01     4  TPASS  :  (case03) END
mbind01     0  TINFO  :  (case04) START
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=22 (Invalid argument)
mbind01     5  TPASS  :  (case04) END
mbind01     0  TINFO  :  (case05) START
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=0 errno=0 (Success)
mbind01     6  TPASS  :  (case05) END
mbind01     0  TINFO  :  (case06) START
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=0 errno=0 (Success)
mbind01     7  TPASS  :  (case06) END
mbind01     0  TINFO  :  (case07) START
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=0 errno=0 (Success)
mbind01     8  TPASS  :  (case07) END
mbind01     0  TINFO  :  (case08) START
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=22 (Invalid argument)
mbind01     9  TPASS  :  (case08) END
mbind01     0  TINFO  :  (case09) START
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=22 (Invalid argument)
mbind01    10  TPASS  :  (case09) END
mbind01     0  TINFO  :  (case10) START
EXPECT: return value(ret)=-1 errno=14 (Bad address)
RESULT: return value(ret)=-1 errno=14 (Bad address)
mbind01    11  TPASS  :  (case10) END
mbind01     0  TINFO  :  (case00) START
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=0 errno=0 (Success)
mbind01    12  TPASS  :  (case00) END
mbind01     0  TINFO  :  (case01) START
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=22 (Invalid argument)
mbind01    13  TPASS  :  (case01) END
mbind01     0  TINFO  :  (case02) START
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=22 (Invalid argument)
mbind01    14  TPASS  :  (case02) END
mbind01     0  TINFO  :  (case03) START
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=0 errno=0 (Success)
mbind01    15  TPASS  :  (case03) END
mbind01     0  TINFO  :  (case04) START
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=22 (Invalid argument)
mbind01    16  TPASS  :  (case04) END
mbind01     0  TINFO  :  (case05) START
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=0 errno=0 (Success)
mbind01    17  TPASS  :  (case05) END
mbind01     0  TINFO  :  (case06) START
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=0 errno=0 (Success)
mbind01    18  TPASS  :  (case06) END
mbind01     0  TINFO  :  (case07) START
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=0 errno=0 (Success)
mbind01    19  TPASS  :  (case07) END
mbind01     0  TINFO  :  (case08) START
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=22 (Invalid argument)
mbind01    20  TPASS  :  (case08) END
mbind01     0  TINFO  :  (case09) START
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=22 (Invalid argument)
mbind01    21  TPASS  :  (case09) END
mbind01     0  TINFO  :  (case10) START
EXPECT: return value(ret)=-1 errno=14 (Bad address)
RESULT: return value(ret)=-1 errno=14 (Bad address)
mbind01    22  TPASS  :  (case10) END

EXAMPLE (Negative):

gcooper@orangebox /scratch/ltp-dev2/ltp/testcases/kernel/syscalls/foo $ make all
make -C "/scratch/ltp-dev2/ltp/lib" -f "/scratch/ltp-dev2/ltp/lib/Makefile" all
make[1]: Entering directory `/scratch/ltp-dev2/ltp/lib'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/scratch/ltp-dev2/ltp/lib'
gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall
-I/scratch/ltp-dev2/ltp/testcases/kernel/include -I../../../../include
-I../../../../include   -L../../../../lib  foo.c   -lltp -o foo
gcooper@orangebox /scratch/ltp-dev2/ltp/testcases/kernel/syscalls/foo $ ./foo
foo         1  TCONF  :  syscall __NR_foo not supported on your arch
gcooper@orangebox /scratch/ltp-dev2/ltp/testcases/kernel/syscalls/foo
$ cat foo.c
#include "test.h"
#include "linux_syscall_numbers.h"

#define __NR_foo 19567

int TST_TOTAL = 1;
char *TCID = "foo";

void cleanup(void) { }

int
main (void) {
        return syscall(__NR_foo, "bar");
}
gcooper@orangebox /scratch/ltp-dev2/ltp/testcases/kernel/syscalls/foo $ ./foo
foo         1  TCONF  :  syscall __NR_foo not supported on your arch

PATCH:

Index: regen.sh
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/include/regen.sh,v
retrieving revision 1.12
diff -u -p -r1.12 regen.sh
--- regen.sh	19 Nov 2009 19:35:15 -0000	1.12
+++ regen.sh	25 Nov 2009 06:22:33 -0000
@@ -29,11 +29,15 @@ static void cleanup(void);
 #define syscall(NR, ...) ({ \\
 	int __ret; \\
 	if (NR == 0) { \\
-		tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on your arch"); \\
 		errno = ENOSYS; \\
 		__ret = -1; \\
-	} else \\
+	} else { \\
 		__ret = syscall(NR, ##__VA_ARGS__); \\
+	} \\
+	if (__ret == -1 && errno == ENOSYS) { \\
+		tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on your arch"); \\
+		errno = ENOSYS; \\
+	} \\
 	__ret; \\
 })
 EOF

------------------------------------------------------------------------------
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	[flat|nested] 7+ messages in thread

* Re: [LTP] mbind01 test failed with after ltp-2009-11-12.tar.gz
  2009-11-25  6:26     ` Garrett Cooper
@ 2009-11-25  7:36       ` Mike Frysinger
  2009-11-25  7:42         ` Garrett Cooper
  2009-11-26  3:02       ` Mitani
  1 sibling, 1 reply; 7+ messages in thread
From: Mike Frysinger @ 2009-11-25  7:36 UTC (permalink / raw)
  To: Garrett Cooper; +Cc: ltp-list, Nate Straz, Mitani


[-- Attachment #1.1: Type: Text/Plain, Size: 2067 bytes --]

On Wednesday 25 November 2009 01:26:20 Garrett Cooper wrote:
> On Tue, Nov 24, 2009 at 9:33 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> > On Wednesday 25 November 2009 00:17:16 Garrett Cooper wrote:
> >> --- regen.sh  19 Nov 2009 19:35:15 -0000      1.12
> >> +++ regen.sh  25 Nov 2009 05:12:13 -0000
> >> @@ -32,8 +32,13 @@ static void cleanup(void);
> >>               tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on
> >> your arch"); \\ errno = ENOSYS; \\
> >>               __ret = -1; \\
> >> -     } else \\
> >> +     } else { \\
> >>               __ret = syscall(NR, ##__VA_ARGS__); \\
> >> +             if (__ret == -1 && errno == ENOSYS) { \\
> >> +                     tst_brkm(TCONF, cleanup, "syscall " #NR " not
> >> supported on your arch"); \\ +                 errno = ENOSYS; \\
> >> +             } \\
> >> +     } \\
> >>       __ret; \\
> >>  })
> >>  EOF
> >
> > i'd prefer this change
> > --- testcases/kernel/include/regen.sh   9 Oct 2009 17:55:48 -0000      
> > 1.11 +++ testcases/kernel/include/regen.sh   25 Nov 2009 05:28:27 -0000
> > @@ -30,11 +30,12 @@ static void cleanup(void);
> >  #define syscall(NR, ...) ({ \\
> >        int __ret; \\
> >        if (NR == 0) { \\
> > -               tst_brkm(TCONF, cleanup, "syscall " #NR " not supported
> > on your arch"); \\ errno = ENOSYS; \\
> >                __ret = -1; \\
> >        } else \\
> >                __ret = syscall(NR, ##__VA_ARGS__); \\
> > +       if (__ret == -1 && errno == ENOSYS) \\
> > +               tst_brkm(TCONF, cleanup, "syscall " #NR " not supported
> > on your arch"); \\ __ret; \\
> >  })
> >  EOF
> 
>     Ok -- that makes more sense.. besides, I think gcc was optimizing
> out the first branch with -O2 if it always evaluated to false. Here's
> the new patch (I'm keeping the errno = ENOSYS part because I want to
> make sure that tst_brkm doesn't mess up the errno value if a write(2)
> fails or something).

i thought tst_brkm exited when called with a cleanup func like we do here
-mike

[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 354 bytes --]

------------------------------------------------------------------------------
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

[-- Attachment #3: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] mbind01 test failed with after ltp-2009-11-12.tar.gz
  2009-11-25  7:36       ` Mike Frysinger
@ 2009-11-25  7:42         ` Garrett Cooper
  0 siblings, 0 replies; 7+ messages in thread
From: Garrett Cooper @ 2009-11-25  7:42 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: ltp-list, Nate Straz, Mitani

On Tue, Nov 24, 2009 at 11:36 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> On Wednesday 25 November 2009 01:26:20 Garrett Cooper wrote:
>> On Tue, Nov 24, 2009 at 9:33 PM, Mike Frysinger <vapier@gentoo.org> wrote:
>> > On Wednesday 25 November 2009 00:17:16 Garrett Cooper wrote:
>> >> --- regen.sh  19 Nov 2009 19:35:15 -0000      1.12
>> >> +++ regen.sh  25 Nov 2009 05:12:13 -0000
>> >> @@ -32,8 +32,13 @@ static void cleanup(void);
>> >>               tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on
>> >> your arch"); \\ errno = ENOSYS; \\
>> >>               __ret = -1; \\
>> >> -     } else \\
>> >> +     } else { \\
>> >>               __ret = syscall(NR, ##__VA_ARGS__); \\
>> >> +             if (__ret == -1 && errno == ENOSYS) { \\
>> >> +                     tst_brkm(TCONF, cleanup, "syscall " #NR " not
>> >> supported on your arch"); \\ +                 errno = ENOSYS; \\
>> >> +             } \\
>> >> +     } \\
>> >>       __ret; \\
>> >>  })
>> >>  EOF
>> >
>> > i'd prefer this change
>> > --- testcases/kernel/include/regen.sh   9 Oct 2009 17:55:48 -0000
>> > 1.11 +++ testcases/kernel/include/regen.sh   25 Nov 2009 05:28:27 -0000
>> > @@ -30,11 +30,12 @@ static void cleanup(void);
>> >  #define syscall(NR, ...) ({ \\
>> >        int __ret; \\
>> >        if (NR == 0) { \\
>> > -               tst_brkm(TCONF, cleanup, "syscall " #NR " not supported
>> > on your arch"); \\ errno = ENOSYS; \\
>> >                __ret = -1; \\
>> >        } else \\
>> >                __ret = syscall(NR, ##__VA_ARGS__); \\
>> > +       if (__ret == -1 && errno == ENOSYS) \\
>> > +               tst_brkm(TCONF, cleanup, "syscall " #NR " not supported
>> > on your arch"); \\ __ret; \\
>> >  })
>> >  EOF
>>
>>     Ok -- that makes more sense.. besides, I think gcc was optimizing
>> out the first branch with -O2 if it always evaluated to false. Here's
>> the new patch (I'm keeping the errno = ENOSYS part because I want to
>> make sure that tst_brkm doesn't mess up the errno value if a write(2)
>> fails or something).
>
> i thought tst_brkm exited when called with a cleanup func like we do here

    tst_brkm exits when cleanup is non-NULL:

        /*
         * If no cleanup function was specified, just return to the caller.
         * Otherwise call the specified function.  If specified function
         * returns, call tst_exit().
         */
        if (func != NULL) {
                (*func)();
                tst_exit();
        }

    It's always defined for us in linux_syscall_numbers.h, thus it
always exits...
Cheers,
-Garrett

------------------------------------------------------------------------------
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	[flat|nested] 7+ messages in thread

* Re: [LTP] mbind01 test failed with after ltp-2009-11-12.tar.gz
  2009-11-25  6:26     ` Garrett Cooper
  2009-11-25  7:36       ` Mike Frysinger
@ 2009-11-26  3:02       ` Mitani
  1 sibling, 0 replies; 7+ messages in thread
From: Mitani @ 2009-11-26  3:02 UTC (permalink / raw)
  To: 'Garrett Cooper'; +Cc: ltp-list, Mike Frysinger, Nate Straz

Hi,

Sorry I'm late.

I copied a patch part from ltp-list and apply it, but the patch failed.
I didn't notice that tabs in the patch were changed to blanks,
and I took time. Forgive me.

But, I could make right patch by copying from your email, and I succeeded. 

As a result, mbind01 became PASS by applying your last patch. 


Thank you.

-Tomonori Mitani

-----Original Message-----
From: Garrett Cooper [mailto:yanegomi@gmail.com] 
Sent: Wednesday, November 25, 2009 3:26 PM
To: Mike Frysinger
Cc: Mitani; ltp-list@lists.sourceforge.net; Nate Straz; Matt Helsley
Subject: Re: [LTP] mbind01 test failed with after ltp-2009-11-12.tar.gz

On Tue, Nov 24, 2009 at 9:33 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> On Wednesday 25 November 2009 00:17:16 Garrett Cooper wrote:
>> --- regen.sh  19 Nov 2009 19:35:15 -0000      1.12
>> +++ regen.sh  25 Nov 2009 05:12:13 -0000
>> @@ -32,8 +32,13 @@ static void cleanup(void);
>>               tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on
your arch");
>>  \\ errno = ENOSYS; \\
>>               __ret = -1; \\
>> -     } else \\
>> +     } else { \\
>>               __ret = syscall(NR, ##__VA_ARGS__); \\
>> +             if (__ret == -1 && errno == ENOSYS) { \\
>> +                     tst_brkm(TCONF, cleanup, "syscall " #NR " not
supported on your arch");
>>  \\ +                 errno = ENOSYS; \\
>> +             } \\
>> +     } \\
>>       __ret; \\
>>  })
>>  EOF
>
> i'd prefer this change
> --- testcases/kernel/include/regen.sh   9 Oct 2009 17:55:48 -0000      
1.11
> +++ testcases/kernel/include/regen.sh   25 Nov 2009 05:28:27 -0000
> @@ -30,11 +30,12 @@ static void cleanup(void);
>  #define syscall(NR, ...) ({ \\
>        int __ret; \\
>        if (NR == 0) { \\
> -               tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on
your arch"); \\
>                errno = ENOSYS; \\
>                __ret = -1; \\
>        } else \\
>                __ret = syscall(NR, ##__VA_ARGS__); \\
> +       if (__ret == -1 && errno == ENOSYS) \\
> +               tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on
your arch"); \\
>        __ret; \\
>  })
>  EOF

    Ok -- that makes more sense.. besides, I think gcc was optimizing
out the first branch with -O2 if it always evaluated to false. Here's
the new patch (I'm keeping the errno = ENOSYS part because I want to
make sure that tst_brkm doesn't mess up the errno value if a write(2)
fails or something).
Thanks!
-Garrett

EXAMPLE (Positive):

gcooper@orangebox
/scratch/ltp-dev2/ltp/testcases/kernel/syscalls/mbind $ ./mbind01
mbind01     0  TINFO  :  (case00) START
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=0 errno=0 (Success)
mbind01     1  TPASS  :  (case00) END
mbind01     0  TINFO  :  (case01) START
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=22 (Invalid argument)
mbind01     2  TPASS  :  (case01) END
mbind01     0  TINFO  :  (case02) START
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=22 (Invalid argument)
mbind01     3  TPASS  :  (case02) END
mbind01     0  TINFO  :  (case03) START
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=0 errno=0 (Success)
mbind01     4  TPASS  :  (case03) END
mbind01     0  TINFO  :  (case04) START
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=22 (Invalid argument)
mbind01     5  TPASS  :  (case04) END
mbind01     0  TINFO  :  (case05) START
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=0 errno=0 (Success)
mbind01     6  TPASS  :  (case05) END
mbind01     0  TINFO  :  (case06) START
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=0 errno=0 (Success)
mbind01     7  TPASS  :  (case06) END
mbind01     0  TINFO  :  (case07) START
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=0 errno=0 (Success)
mbind01     8  TPASS  :  (case07) END
mbind01     0  TINFO  :  (case08) START
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=22 (Invalid argument)
mbind01     9  TPASS  :  (case08) END
mbind01     0  TINFO  :  (case09) START
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=22 (Invalid argument)
mbind01    10  TPASS  :  (case09) END
mbind01     0  TINFO  :  (case10) START
EXPECT: return value(ret)=-1 errno=14 (Bad address)
RESULT: return value(ret)=-1 errno=14 (Bad address)
mbind01    11  TPASS  :  (case10) END
mbind01     0  TINFO  :  (case00) START
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=0 errno=0 (Success)
mbind01    12  TPASS  :  (case00) END
mbind01     0  TINFO  :  (case01) START
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=22 (Invalid argument)
mbind01    13  TPASS  :  (case01) END
mbind01     0  TINFO  :  (case02) START
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=22 (Invalid argument)
mbind01    14  TPASS  :  (case02) END
mbind01     0  TINFO  :  (case03) START
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=0 errno=0 (Success)
mbind01    15  TPASS  :  (case03) END
mbind01     0  TINFO  :  (case04) START
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=22 (Invalid argument)
mbind01    16  TPASS  :  (case04) END
mbind01     0  TINFO  :  (case05) START
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=0 errno=0 (Success)
mbind01    17  TPASS  :  (case05) END
mbind01     0  TINFO  :  (case06) START
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=0 errno=0 (Success)
mbind01    18  TPASS  :  (case06) END
mbind01     0  TINFO  :  (case07) START
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=0 errno=0 (Success)
mbind01    19  TPASS  :  (case07) END
mbind01     0  TINFO  :  (case08) START
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=22 (Invalid argument)
mbind01    20  TPASS  :  (case08) END
mbind01     0  TINFO  :  (case09) START
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=22 (Invalid argument)
mbind01    21  TPASS  :  (case09) END
mbind01     0  TINFO  :  (case10) START
EXPECT: return value(ret)=-1 errno=14 (Bad address)
RESULT: return value(ret)=-1 errno=14 (Bad address)
mbind01    22  TPASS  :  (case10) END

EXAMPLE (Negative):

gcooper@orangebox /scratch/ltp-dev2/ltp/testcases/kernel/syscalls/foo $ make
all
make -C "/scratch/ltp-dev2/ltp/lib" -f "/scratch/ltp-dev2/ltp/lib/Makefile"
all
make[1]: Entering directory `/scratch/ltp-dev2/ltp/lib'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/scratch/ltp-dev2/ltp/lib'
gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall
-I/scratch/ltp-dev2/ltp/testcases/kernel/include -I../../../../include
-I../../../../include   -L../../../../lib  foo.c   -lltp -o foo
gcooper@orangebox /scratch/ltp-dev2/ltp/testcases/kernel/syscalls/foo $
./foo
foo         1  TCONF  :  syscall __NR_foo not supported on your arch
gcooper@orangebox /scratch/ltp-dev2/ltp/testcases/kernel/syscalls/foo
$ cat foo.c
#include "test.h"
#include "linux_syscall_numbers.h"

#define __NR_foo 19567

int TST_TOTAL = 1;
char *TCID = "foo";

void cleanup(void) { }

int
main (void) {
        return syscall(__NR_foo, "bar");
}
gcooper@orangebox /scratch/ltp-dev2/ltp/testcases/kernel/syscalls/foo $
./foo
foo         1  TCONF  :  syscall __NR_foo not supported on your arch

PATCH:

Index: regen.sh
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/include/regen.sh,v
retrieving revision 1.12
diff -u -p -r1.12 regen.sh
--- regen.sh	19 Nov 2009 19:35:15 -0000	1.12
+++ regen.sh	25 Nov 2009 06:22:33 -0000
@@ -29,11 +29,15 @@ static void cleanup(void);
 #define syscall(NR, ...) ({ \\
 	int __ret; \\
 	if (NR == 0) { \\
-		tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on
your arch"); \\
 		errno = ENOSYS; \\
 		__ret = -1; \\
-	} else \\
+	} else { \\
 		__ret = syscall(NR, ##__VA_ARGS__); \\
+	} \\
+	if (__ret == -1 && errno == ENOSYS) { \\
+		tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on
your arch"); \\
+		errno = ENOSYS; \\
+	} \\
 	__ret; \\
 })
 EOF



------------------------------------------------------------------------------
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	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-11-26  3:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-25  3:07 [LTP] mbind01 test failed with after ltp-2009-11-12.tar.gz Mitani
2009-11-25  5:17 ` Garrett Cooper
2009-11-25  5:33   ` Mike Frysinger
2009-11-25  6:26     ` Garrett Cooper
2009-11-25  7:36       ` Mike Frysinger
2009-11-25  7:42         ` Garrett Cooper
2009-11-26  3:02       ` Mitani

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