All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wanlong Gao <gaowanlong@cn.fujitsu.com>
To: Jan Stancek <jstancek@redhat.com>, ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH] send*: use concrete flags for 'invalid flags set'
Date: Fri, 29 Nov 2013 19:34:56 +0800	[thread overview]
Message-ID: <52987BE0.20801@cn.fujitsu.com> (raw)
In-Reply-To: <2ad340abd08f682ea74269d96df3bcf6e4e10a67.1385721415.git.jstancek@redhat.com>

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

  reply	other threads:[~2013-11-29 11:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-29 10:39 [LTP] [PATCH] send*: use concrete flags for 'invalid flags set' Jan Stancek
2013-11-29 11:34 ` Wanlong Gao [this message]
2013-12-02  5:36 ` Wanlong Gao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52987BE0.20801@cn.fujitsu.com \
    --to=gaowanlong@cn.fujitsu.com \
    --cc=jstancek@redhat.com \
    --cc=ltp-list@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.