public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Andrea Cervesato <andrea.cervesato@suse.de>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v6 1/6] Refactor mqns_01 using new LTP API
Date: Thu, 23 Mar 2023 12:17:18 +0100	[thread overview]
Message-ID: <20230323111718.GH405493@pevik> (raw)
In-Reply-To: <20230307124708.27280-2-andrea.cervesato@suse.de>

Hi Andrea,

> +++ b/runtest/containers
> @@ -16,7 +16,8 @@ pidns31 pidns31
>  pidns32 pidns32

>  mqns_01 mqns_01
Also, if anybody run this tests without params, it's actually not testing
unshade as it was before (i.e. the default case is doing something different,
than the main purpose of the test).

> -mqns_01_clone mqns_01 -clone
> +mqns_01_clone mqns_01 -m clone
> +mqns_01_unshare mqns_01 -m unshare
BTW I'm verbose on changes during rewrite, I'd notice the fact that one extra
run, which tests just fork (i.e. case where pass - the opposite is expected).


> +++ b/testcases/kernel/containers/mqns/mqns_01.c
> +/*\
> + * [Description]
> + *
> + * Create a mqueue inside the parent and check if it can be accessed from
> + * the child namespace.
Actually my previous note "verify if cannot" is invalid, when -m is not set
(fork call).  Again, I'd mention it here.

...
> +		if (!SAFE_CLONE(&clone_args)) {
> +			TST_EXP_FAIL(mq_open(MQNAME, O_RDONLY), ENOENT);
> +			return;
> +		}
> +	} else if (str_op && !strcmp(str_op, "unshare")) {
> +		tst_res(TINFO, "Spawning unshared process");
> +
> +		if (!SAFE_FORK()) {
> +			SAFE_UNSHARE(CLONE_NEWIPC);
> +			TST_EXP_FAIL(mq_open(MQNAME, O_RDONLY), ENOENT);
> +			return;
>  		}
>  	} else {
> -		if (write(p2[1], "exists", strlen("exists") + 1) < 0) {
> -			perror("write(p2[1], \"exists\", 7) failed");
> -			exit(1);
> -		} else if (mq_close(mqd) < 0) {
> -			perror("mq_close(mqd) failed");
> -			exit(1);
> +		tst_res(TINFO, "Spawning plain process");
> +
> +		if (!SAFE_FORK()) {
> +			TST_EXP_POSITIVE(mq_open(MQNAME, O_RDONLY));
nit: shouldn't this be TST_EXP_FD() (no real change, just extra "fd" being printed.

Kind regards,
Petr

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

  parent reply	other threads:[~2023-03-23 11:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-07 12:47 [LTP] [PATCH v6 0/6] Refactor mqns testing suite Andrea Cervesato
2023-03-07 12:47 ` [LTP] [PATCH v6 1/6] Refactor mqns_01 using new LTP API Andrea Cervesato
2023-03-23 10:32   ` Petr Vorel
2023-05-10  9:46     ` Andrea Cervesato via ltp
2023-03-23 11:17   ` Petr Vorel [this message]
2023-05-10  9:56     ` Andrea Cervesato via ltp
2023-03-07 12:47 ` [LTP] [PATCH v6 2/6] Refactor mqns_02 " Andrea Cervesato
2023-03-07 12:47 ` [LTP] [PATCH v6 3/6] Refactor mqns_03 " Andrea Cervesato
2023-03-07 12:47 ` [LTP] [PATCH v6 4/6] Refactor mqns_04 " Andrea Cervesato
2023-03-07 12:47 ` [LTP] [PATCH v6 5/6] Remove deprecated header files from mqns suite Andrea Cervesato
2023-03-07 12:47 ` [LTP] [PATCH v6 6/6] Remove libclone dependency " Andrea Cervesato

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=20230323111718.GH405493@pevik \
    --to=pvorel@suse.cz \
    --cc=andrea.cervesato@suse.de \
    --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