public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Jan Stancek <jstancek@redhat.com>
To: Yuan Sun <sunyuan3@huawei.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH] Add TEST_LOOPING in userns01.
Date: Tue, 9 Jun 2015 05:30:43 -0400 (EDT)	[thread overview]
Message-ID: <19148692.12842296.1433842243807.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <1433842119-27558-1-git-send-email-sunyuan3@huawei.com>





----- Original Message -----
> From: "Yuan Sun" <sunyuan3@huawei.com>
> To: jstancek@redhat.com
> Cc: ltp-list@lists.sourceforge.net
> Sent: Tuesday, 9 June, 2015 11:28:39 AM
> Subject: [PATCH] Add TEST_LOOPING in userns01.
> 
> Signed-off-by: Yuan Sun <sunyuan3@huawei.com>

Thanks for following-up on this, applied.

Regards,
Jan

> ---
>  testcases/kernel/containers/userns/userns01.c | 31
>  +++++++++++++++------------
>  1 file changed, 17 insertions(+), 14 deletions(-)
> 
> diff --git a/testcases/kernel/containers/userns/userns01.c
> b/testcases/kernel/containers/userns/userns01.c
> index 6e313c0..9cada5e 100644
> --- a/testcases/kernel/containers/userns/userns01.c
> +++ b/testcases/kernel/containers/userns/userns01.c
> @@ -71,25 +71,28 @@ static void setup(void)
>  int main(int argc, char *argv[])
>  {
>  	int status;
> +	int lc;
>  
>  	tst_parse_opts(argc, argv, NULL, NULL);
>  	setup();
>  
> -	TEST(do_clone_unshare_test(T_CLONE, CLONE_NEWUSER, child_fn1, NULL));
> -
> -	if (TEST_RETURN == -1)
> -		tst_brkm(TFAIL | TTERRNO, NULL, "clone failed");
> -	else if ((wait(&status)) == -1)
> -		tst_brkm(TWARN | TERRNO, NULL, "wait failed");
> -
> -	if (WIFEXITED(status) && WEXITSTATUS(status) != 0)
> -		tst_resm(TFAIL, "child exited abnormally");
> -	else if (WIFSIGNALED(status)) {
> -		tst_resm(TFAIL, "child was killed with signal = %d",
> -			 WTERMSIG(status));
> +	for (lc = 0; TEST_LOOPING(lc); lc++) {
> +		TEST(do_clone_unshare_test(T_CLONE, CLONE_NEWUSER,
> +			child_fn1, NULL));
> +
> +		if (TEST_RETURN == -1)
> +			tst_brkm(TFAIL | TTERRNO, NULL, "clone failed");
> +		else if ((wait(&status)) == -1)
> +			tst_brkm(TWARN | TERRNO, NULL, "wait failed");
> +
> +		if (WIFEXITED(status) && WEXITSTATUS(status) != 0)
> +			tst_resm(TFAIL, "child exited abnormally");
> +		else if (WIFSIGNALED(status)) {
> +			tst_resm(TFAIL, "child was killed with signal = %d",
> +				 WTERMSIG(status));
> +		} else
> +			tst_resm(TPASS, "uid and gid are right");
>  	}
> -
> -	tst_resm(TPASS, "the uid and the gid are right inside the container");
>  	tst_exit();
>  }
>  
> --
> 1.9.1
> 
> 

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

      reply	other threads:[~2015-06-09  9:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-09  9:28 [LTP] [PATCH] Add TEST_LOOPING in userns01 Yuan Sun
2015-06-09  9:30 ` Jan Stancek [this message]

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=19148692.12842296.1433842243807.JavaMail.zimbra@redhat.com \
    --to=jstancek@redhat.com \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=sunyuan3@huawei.com \
    /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