public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] send*: use concrete flags for 'invalid flags set'
@ 2013-11-29 10:39 Jan Stancek
  2013-11-29 11:34 ` Wanlong Gao
  2013-12-02  5:36 ` Wanlong Gao
  0 siblings, 2 replies; 3+ messages in thread
From: Jan Stancek @ 2013-11-29 10:39 UTC (permalink / raw)
  To: ltp-list

Use a concrete set of flags instead of '-1', which is
known to fail with EOPNOTSUPP.

Tested with:
  2.6.18-128.37.1.el5
  2.6.32-358.el6
  3.10.0-54.el7
  upstream 3.13.0-rc1+

Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
 testcases/kernel/syscalls/send/send01.c       |   19 +++++--------------
 testcases/kernel/syscalls/sendmsg/sendmsg01.c |   17 ++++-------------
 testcases/kernel/syscalls/sendto/sendto01.c   |   21 +++++----------------
 3 files changed, 14 insertions(+), 43 deletions(-)

diff --git a/testcases/kernel/syscalls/send/send01.c b/testcases/kernel/syscalls/send/send01.c
index d228422..6ebe131 100644
--- a/testcases/kernel/syscalls/send/send01.c
+++ b/testcases/kernel/syscalls/send/send01.c
@@ -72,7 +72,6 @@ static void setup(void);
 static void setup0(void);
 static void setup1(void);
 static void setup2(void);
-static void setup3(void);
 static void cleanup0(void);
 static void cleanup1(void);
 
@@ -143,14 +142,14 @@ static struct test_case_t tdat[] = {
 #ifndef UCLINUX
 	/* Skip since uClinux does not implement memory protection */
 	{.domain = PF_INET,
-	 .type = SOCK_STREAM,
+	 .type = SOCK_DGRAM,
 	 .proto = 0,
-	 .buf = (void *)-1,
+	 .buf = buf,
 	 .buflen = sizeof(buf),
-	 .flags = -1,
+	 .flags = MSG_OOB,
 	 .retval = -1,
-	 .experrno = EFAULT,
-	 .setup = setup3,
+	 .experrno = EOPNOTSUPP,
+	 .setup = setup1,
 	 .cleanup = cleanup1,
 	 .desc = "invalid flags set"}
 #endif
@@ -352,11 +351,3 @@ static void setup2(void)
 		tst_brkm(TBROK | TERRNO, cleanup, "socket setup failed connect "
 			 "test %d", testno);
 }
-
-static void setup3(void)
-{
-	setup1();
-
-	if (tst_kvercmp(3, 6, 0) >= 0)
-		tdat[testno].experrno = ENOTSUP;
-}
diff --git a/testcases/kernel/syscalls/sendmsg/sendmsg01.c b/testcases/kernel/syscalls/sendmsg/sendmsg01.c
index 90fbb5d..c385631 100644
--- a/testcases/kernel/syscalls/sendmsg/sendmsg01.c
+++ b/testcases/kernel/syscalls/sendmsg/sendmsg01.c
@@ -87,7 +87,6 @@ static void setup3(void);
 static void setup4(void);
 static void setup5(void);
 static void setup6(void);
-static void setup7(void);
 static void setup8(void);
 
 static void cleanup(void);
@@ -337,19 +336,19 @@ struct test_case_t tdat[] = {
 	 .desc = "invalid flags set w/ control"}
 	,
 	{.domain = PF_INET,
-	 .type = SOCK_STREAM,
+	 .type = SOCK_DGRAM,
 	 .proto = 0,
 	 .iov = iov,
 	 .iovcnt = 1,
 	 .buf = buf,
 	 .buflen = sizeof(buf),
 	 .msg = &msgdat,
-	 .flags = ~MSG_CMSG_COMPAT,
+	 .flags = MSG_OOB,
 	 .to = (struct sockaddr *)&sin1,
 	 .tolen = sizeof(sin1),
-	 .retval = 0,
+	 .retval = -1,
 	 .experrno = EOPNOTSUPP,
-	 .setup = setup7,
+	 .setup = setup1,
 	 .cleanup = cleanup1,
 	 .desc = "invalid flags set"}
 	,
@@ -726,14 +725,6 @@ static void setup6(void)
 	controllen = control->cmsg_len = 0;
 }
 
-static void setup7(void)
-{
-	setup1();
-
-	if (tst_kvercmp(3, 6, 0) >= 0)
-		tdat[testno].retval = -1;
-}
-
 static void setup8(void)
 {
 	setup4();
diff --git a/testcases/kernel/syscalls/sendto/sendto01.c b/testcases/kernel/syscalls/sendto/sendto01.c
index a571afd..e2422ea 100644
--- a/testcases/kernel/syscalls/sendto/sendto01.c
+++ b/testcases/kernel/syscalls/sendto/sendto01.c
@@ -72,7 +72,6 @@ static void setup0(void);
 static void setup1(void);
 static void setup2(void);
 static void setup3(void);
-static void setup4(void);
 static void cleanup(void);
 static void cleanup0(void);
 static void cleanup1(void);
@@ -212,16 +211,16 @@ struct test_case_t tdat[] = {
 	 .desc = "local endpoint shutdown"}
 	,
 	{.domain = PF_INET,
-	 .type = SOCK_STREAM,
+	 .type = SOCK_DGRAM,
 	 .proto = 0,
 	 .buf = buf,
 	 .buflen = sizeof(buf),
-	 .flags = -1,
+	 .flags = MSG_OOB,
 	 .to = &sin1,
 	 .tolen = sizeof(sin1),
-	 .retval = 0,
-	 .experrno = EPIPE,
-	 .setup = setup4,
+	 .retval = -1,
+	 .experrno = EOPNOTSUPP,
+	 .setup = setup1,
 	 .cleanup = cleanup1,
 	 .desc = "invalid flags set"}
 };
@@ -430,13 +429,3 @@ static void setup3(void)
 	if (s < 0)
 		tst_brkm(TBROK | TERRNO, cleanup, "socket setup failed");
 }
-
-static void setup4(void)
-{
-	setup1();
-
-	if (tst_kvercmp(3, 6, 0) >= 0) {
-		tdat[testno].retval = -1;
-		tdat[testno].experrno = ENOTSUP;
-	}
-}
-- 
1.7.1


------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] [PATCH] send*: use concrete flags for 'invalid flags set'
  2013-11-29 10:39 [LTP] [PATCH] send*: use concrete flags for 'invalid flags set' Jan Stancek
@ 2013-11-29 11:34 ` Wanlong Gao
  2013-12-02  5:36 ` Wanlong Gao
  1 sibling, 0 replies; 3+ messages in thread
From: Wanlong Gao @ 2013-11-29 11:34 UTC (permalink / raw)
  To: Jan Stancek, ltp-list

On 11/29/2013 06:39 PM, Jan Stancek wrote:
> Use a concrete set of flags instead of '-1', which is
> known to fail with EOPNOTSUPP.
> 
> Tested with:
>   2.6.18-128.37.1.el5
>   2.6.32-358.el6
>   3.10.0-54.el7
>   upstream 3.13.0-rc1+

Great! thank you Jan.

Reviewed-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>


> 
> Signed-off-by: Jan Stancek <jstancek@redhat.com>
> ---
>  testcases/kernel/syscalls/send/send01.c       |   19 +++++--------------
>  testcases/kernel/syscalls/sendmsg/sendmsg01.c |   17 ++++-------------
>  testcases/kernel/syscalls/sendto/sendto01.c   |   21 +++++----------------
>  3 files changed, 14 insertions(+), 43 deletions(-)
> 
> diff --git a/testcases/kernel/syscalls/send/send01.c b/testcases/kernel/syscalls/send/send01.c
> index d228422..6ebe131 100644
> --- a/testcases/kernel/syscalls/send/send01.c
> +++ b/testcases/kernel/syscalls/send/send01.c
> @@ -72,7 +72,6 @@ static void setup(void);
>  static void setup0(void);
>  static void setup1(void);
>  static void setup2(void);
> -static void setup3(void);
>  static void cleanup0(void);
>  static void cleanup1(void);
>  
> @@ -143,14 +142,14 @@ static struct test_case_t tdat[] = {
>  #ifndef UCLINUX
>  	/* Skip since uClinux does not implement memory protection */
>  	{.domain = PF_INET,
> -	 .type = SOCK_STREAM,
> +	 .type = SOCK_DGRAM,
>  	 .proto = 0,
> -	 .buf = (void *)-1,
> +	 .buf = buf,
>  	 .buflen = sizeof(buf),
> -	 .flags = -1,
> +	 .flags = MSG_OOB,
>  	 .retval = -1,
> -	 .experrno = EFAULT,
> -	 .setup = setup3,
> +	 .experrno = EOPNOTSUPP,
> +	 .setup = setup1,
>  	 .cleanup = cleanup1,
>  	 .desc = "invalid flags set"}
>  #endif
> @@ -352,11 +351,3 @@ static void setup2(void)
>  		tst_brkm(TBROK | TERRNO, cleanup, "socket setup failed connect "
>  			 "test %d", testno);
>  }
> -
> -static void setup3(void)
> -{
> -	setup1();
> -
> -	if (tst_kvercmp(3, 6, 0) >= 0)
> -		tdat[testno].experrno = ENOTSUP;
> -}
> diff --git a/testcases/kernel/syscalls/sendmsg/sendmsg01.c b/testcases/kernel/syscalls/sendmsg/sendmsg01.c
> index 90fbb5d..c385631 100644
> --- a/testcases/kernel/syscalls/sendmsg/sendmsg01.c
> +++ b/testcases/kernel/syscalls/sendmsg/sendmsg01.c
> @@ -87,7 +87,6 @@ static void setup3(void);
>  static void setup4(void);
>  static void setup5(void);
>  static void setup6(void);
> -static void setup7(void);
>  static void setup8(void);
>  
>  static void cleanup(void);
> @@ -337,19 +336,19 @@ struct test_case_t tdat[] = {
>  	 .desc = "invalid flags set w/ control"}
>  	,
>  	{.domain = PF_INET,
> -	 .type = SOCK_STREAM,
> +	 .type = SOCK_DGRAM,
>  	 .proto = 0,
>  	 .iov = iov,
>  	 .iovcnt = 1,
>  	 .buf = buf,
>  	 .buflen = sizeof(buf),
>  	 .msg = &msgdat,
> -	 .flags = ~MSG_CMSG_COMPAT,
> +	 .flags = MSG_OOB,
>  	 .to = (struct sockaddr *)&sin1,
>  	 .tolen = sizeof(sin1),
> -	 .retval = 0,
> +	 .retval = -1,
>  	 .experrno = EOPNOTSUPP,
> -	 .setup = setup7,
> +	 .setup = setup1,
>  	 .cleanup = cleanup1,
>  	 .desc = "invalid flags set"}
>  	,
> @@ -726,14 +725,6 @@ static void setup6(void)
>  	controllen = control->cmsg_len = 0;
>  }
>  
> -static void setup7(void)
> -{
> -	setup1();
> -
> -	if (tst_kvercmp(3, 6, 0) >= 0)
> -		tdat[testno].retval = -1;
> -}
> -
>  static void setup8(void)
>  {
>  	setup4();
> diff --git a/testcases/kernel/syscalls/sendto/sendto01.c b/testcases/kernel/syscalls/sendto/sendto01.c
> index a571afd..e2422ea 100644
> --- a/testcases/kernel/syscalls/sendto/sendto01.c
> +++ b/testcases/kernel/syscalls/sendto/sendto01.c
> @@ -72,7 +72,6 @@ static void setup0(void);
>  static void setup1(void);
>  static void setup2(void);
>  static void setup3(void);
> -static void setup4(void);
>  static void cleanup(void);
>  static void cleanup0(void);
>  static void cleanup1(void);
> @@ -212,16 +211,16 @@ struct test_case_t tdat[] = {
>  	 .desc = "local endpoint shutdown"}
>  	,
>  	{.domain = PF_INET,
> -	 .type = SOCK_STREAM,
> +	 .type = SOCK_DGRAM,
>  	 .proto = 0,
>  	 .buf = buf,
>  	 .buflen = sizeof(buf),
> -	 .flags = -1,
> +	 .flags = MSG_OOB,
>  	 .to = &sin1,
>  	 .tolen = sizeof(sin1),
> -	 .retval = 0,
> -	 .experrno = EPIPE,
> -	 .setup = setup4,
> +	 .retval = -1,
> +	 .experrno = EOPNOTSUPP,
> +	 .setup = setup1,
>  	 .cleanup = cleanup1,
>  	 .desc = "invalid flags set"}
>  };
> @@ -430,13 +429,3 @@ static void setup3(void)
>  	if (s < 0)
>  		tst_brkm(TBROK | TERRNO, cleanup, "socket setup failed");
>  }
> -
> -static void setup4(void)
> -{
> -	setup1();
> -
> -	if (tst_kvercmp(3, 6, 0) >= 0) {
> -		tdat[testno].retval = -1;
> -		tdat[testno].experrno = ENOTSUP;
> -	}
> -}
> 


------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] [PATCH] send*: use concrete flags for 'invalid flags set'
  2013-11-29 10:39 [LTP] [PATCH] send*: use concrete flags for 'invalid flags set' Jan Stancek
  2013-11-29 11:34 ` Wanlong Gao
@ 2013-12-02  5:36 ` Wanlong Gao
  1 sibling, 0 replies; 3+ messages in thread
From: Wanlong Gao @ 2013-12-02  5:36 UTC (permalink / raw)
  To: Jan Stancek; +Cc: ltp-list

On 11/29/2013 06:39 PM, Jan Stancek wrote:
> Use a concrete set of flags instead of '-1', which is
> known to fail with EOPNOTSUPP.
> 
> Tested with:
>   2.6.18-128.37.1.el5
>   2.6.32-358.el6
>   3.10.0-54.el7
>   upstream 3.13.0-rc1+
> 
> Signed-off-by: Jan Stancek <jstancek@redhat.com>

FYI, applied, thank you.

Wanlong Gao


------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

end of thread, other threads:[~2013-12-02  5:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-29 10:39 [LTP] [PATCH] send*: use concrete flags for 'invalid flags set' Jan Stancek
2013-11-29 11:34 ` Wanlong Gao
2013-12-02  5:36 ` Wanlong Gao

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