public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Jan Stancek <jstancek@redhat.com>
To: Hangbin Liu <liuhangbin@gmail.com>
Cc: LTP List <ltp-list@lists.sourceforge.net>
Subject: Re: [LTP] [PATCHv3] containers: Use ltp_syscall for setns incase some libc library do not support it
Date: Wed, 1 Jul 2015 02:55:33 -0400 (EDT)	[thread overview]
Message-ID: <105343732.10909567.1435733733296.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <1435732532-10995-1-git-send-email-liuhangbin@gmail.com>





----- Original Message -----
> From: "Hangbin Liu" <liuhangbin@gmail.com>
> To: "LTP List" <ltp-list@lists.sourceforge.net>
> Cc: "Jan Stancek" <jstancek@redhat.com>
> Sent: Wednesday, 1 July, 2015 8:35:32 AM
> Subject: [LTP][PATCHv3] containers: Use ltp_syscall for setns incase some libc library do not support it
> 
> Use ltp_syscall for setns incase some libc library do not support it. Also
> check whether we support setns in setup(). If it's support the syscall will
> silently fails and test continues. If not, then tst_brkm call will end the
> test with TCONF.
> 
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>

Pushed with cosmetic change to commit message.

Thanks,
Jan

> ---
>  testcases/kernel/containers/userns/userns04.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/testcases/kernel/containers/userns/userns04.c
> b/testcases/kernel/containers/userns/userns04.c
> index 7077679..9836fd9 100644
> --- a/testcases/kernel/containers/userns/userns04.c
> +++ b/testcases/kernel/containers/userns/userns04.c
> @@ -35,6 +35,7 @@ int TST_TOTAL = 1;
>  static void setup(void)
>  {
>  	check_newuser();
> +	ltp_syscall(__NR_setns, -1, 0);
>  	tst_tmpdir();
>  	TST_CHECKPOINT_INIT(NULL);
>  }
> @@ -55,7 +56,7 @@ static int child_fn2(void *arg)
>  	int exit_val = 0;
>  	int ret;
>  
> -	ret = setns(((long)arg), CLONE_NEWUSER);
> +	ret = ltp_syscall(__NR_setns, ((long)arg), CLONE_NEWUSER);
>  	if (ret != -1) {
>  		printf("child2 setns() unexpected success\n");
>  		exit_val = 1;
> @@ -112,7 +113,7 @@ static void test_cap_sys_admin(void)
>  	case -1:
>  		tst_brkm(TBROK | TERRNO, cleanup, "fork");
>  	case 0:
> -		if (setns(fd, CLONE_NEWUSER) == -1) {
> +		if (ltp_syscall(__NR_setns, fd, CLONE_NEWUSER) == -1) {
>  			printf("parent pid setns failure: (%d) %s",
>  				errno, strerror(errno));
>  			exit(1);
> --
> 1.9.3
> 
> 

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  parent reply	other threads:[~2015-07-01  6:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-01  6:35 [LTP] [PATCHv3] containers: Use ltp_syscall for setns incase some libc library do not support it Hangbin Liu
2015-07-01  6:39 ` Hangbin Liu
2015-07-01  6:43   ` Hangbin Liu
2015-07-01  6:55 ` Jan Stancek [this message]
2015-07-01 10:58   ` Yuan Sun

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=105343732.10909567.1435733733296.JavaMail.zimbra@redhat.com \
    --to=jstancek@redhat.com \
    --cc=liuhangbin@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox