public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Richard Palethorpe <rpalethorpe@suse.de>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 1/2] msgrcv07: Check negative msg type filters
Date: Mon, 11 Oct 2021 09:46:47 +0100	[thread overview]
Message-ID: <87sfx89c9k.fsf@suse.de> (raw)
In-Reply-To: <YWBSXzdO/gaq9lS6@yuki>

Hello,

Cyril Hrubis <chrubis@suse.cz> writes:

> Hi!
> I guess that it would make more sense to add this to the msgrcv02.c as:
>
> diff --git a/testcases/kernel/syscalls/ipc/msgrcv/msgrcv02.c b/testcases/kernel/syscalls/ipc/msgrcv/msgrcv02.c
> index cfb7d7446..b305d1f92 100644
> --- a/testcases/kernel/syscalls/ipc/msgrcv/msgrcv02.c
> +++ b/testcases/kernel/syscalls/ipc/msgrcv/msgrcv02.c
> @@ -21,6 +21,8 @@
>   *   msgflg and no message of the requested type existed on the message queue.
>   */
>
> +#define _GNU_SOURCE
> +
>  #include <string.h>
>  #include <sys/wait.h>
>  #include <sys/msg.h>
> @@ -35,10 +37,12 @@ static int queue_id = -1;
>  static int bad_id = -1;
>  struct passwd *pw;
>
> +#define MSGTYP 2
> +
>  static struct buf {
>         long type;
>         char mtext[MSGSIZE];
> -} rcv_buf, snd_buf = {MSGTYPE, "hello"};
> +} rcv_buf, snd_buf = {MSGTYP, "hello"};
>
>  static struct tcase {
>         int *id;
> @@ -49,12 +53,14 @@ static struct tcase {
>         int exp_user;
>         int exp_err;
>  } tcases[] = {
> -       {&queue_id, &rcv_buf, 4, 1, 0, 0, E2BIG},
> -       {&queue_id, &rcv_buf, MSGSIZE, 1, 0, 1, EACCES},
> -       {&queue_id, NULL, MSGSIZE, 1, 0, 0, EFAULT},
> -       {&bad_id, &rcv_buf, MSGSIZE, 1, 0, 0, EINVAL},
> -       {&queue_id, &rcv_buf, -1, 1, 0, 0, EINVAL},
> -       {&queue_id, &rcv_buf, MSGSIZE, 2, IPC_NOWAIT, 0, ENOMSG},
> +       {&queue_id, &rcv_buf, 4, MSGTYP, 0, 0, E2BIG},
> +       {&queue_id, &rcv_buf, MSGSIZE, MSGTYP, 0, 1, EACCES},
> +       {&queue_id, NULL, MSGSIZE, MSGTYP, 0, 0, EFAULT},
> +       {&bad_id, &rcv_buf, MSGSIZE, MSGTYP, 0, 0, EINVAL},
> +       {&queue_id, &rcv_buf, -1, MSGTYP, 0, 0, EINVAL},
> +       {&queue_id, &rcv_buf, MSGSIZE, MSGTYP+1, IPC_NOWAIT, 0, ENOMSG},
> +       {&queue_id, &rcv_buf, MSGSIZE, -1, IPC_NOWAIT, 0, ENOMSG},
> +       {&queue_id, &rcv_buf, MSGSIZE, -1, IPC_NOWAIT | MSG_EXCEPT, 0, ENOMSG},
>  };
>
>
> What do you think?

I don't know, the functionality in each test seems arbitrary. I would be
happy with either patch.

-- 
Thank you,
Richard.

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2021-10-11  8:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-24  9:21 [LTP] [PATCH 1/2] msgrcv07: Check negative msg type filters Richard Palethorpe via ltp
2021-09-24  9:21 ` [LTP] [PATCH 2/2] msgrcv07: Cleanup indentation Richard Palethorpe via ltp
2021-09-24 10:22   ` Petr Vorel
2021-09-24 10:21 ` [LTP] [PATCH 1/2] msgrcv07: Check negative msg type filters Petr Vorel
2021-09-24 10:26 ` Petr Vorel
2021-09-24 10:30   ` Richard Palethorpe
2021-10-08 14:14 ` Cyril Hrubis
2021-10-11  8:46   ` Richard Palethorpe [this message]
2021-10-11 12:57     ` Cyril Hrubis
2021-10-13  6:56 ` xuyang2018.jy

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=87sfx89c9k.fsf@suse.de \
    --to=rpalethorpe@suse.de \
    --cc=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox