public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Subrata Modak <subrata@linux.vnet.ibm.com>
To: Serge Hallyn <serue@linux.vnet.ibm.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH] NetNS test fixes
Date: Fri, 07 May 2010 15:11:08 +0530	[thread overview]
Message-ID: <1273225268.6042.8.camel@subratamodak.linux.ibm.com> (raw)
In-Reply-To: <1273081434-22034-1-git-send-email-danms@us.ibm.com>

On Wed, 2010-05-05 at 10:43 -0700, Dan Smith wrote:
> This patch fixes a couple of netns test issues that cause invalid failures
> relating to exiting with a status variable that doesn't exist.  It also
> fixes an instance of inverted logic and a failure to exec sshd with the
> full path (as required).
> 
> Additionally, it makes the common child exec function more descriptive of
> what it tried to do and why it failed to ease debugging.
> 
> Signed-off-by: Dan Smith <danms@us.ibm.com>

Serge,

Can you please ack this patch.

Regards--
Subrata

> ---
>  testcases/kernel/containers/netns/child_1.sh  |    1 +
>  testcases/kernel/containers/netns/child_2.sh  |    1 +
>  testcases/kernel/containers/netns/childns.sh  |    4 +++-
>  testcases/kernel/containers/netns/common.c    |    3 +--
>  testcases/kernel/containers/netns/par_ftp.sh  |    3 +++
>  testcases/kernel/containers/netns/parent_1.sh |    2 +-
>  testcases/kernel/containers/netns/parent_2.sh |    2 +-
>  7 files changed, 11 insertions(+), 5 deletions(-)
> 
> diff --git a/testcases/kernel/containers/netns/child_1.sh b/testcases/kernel/containers/netns/child_1.sh
> index 1fa71a7..7fb9a4f 100755
> --- a/testcases/kernel/containers/netns/child_1.sh
> +++ b/testcases/kernel/containers/netns/child_1.sh
> @@ -68,6 +68,7 @@ export TST_TOTAL
>          if [ $? = 0 ];
>          then
>              tst_resm TINFO "PASS: Child2 is pinging from CHILD1 !" 
> +	    status=0
>          else 
>              tst_resm TFAIL "FAIL: Unable to Ping Child2 from CHILD1 !"
>              status=-1
> diff --git a/testcases/kernel/containers/netns/child_2.sh b/testcases/kernel/containers/netns/child_2.sh
> index d73b785..3098028 100755
> --- a/testcases/kernel/containers/netns/child_2.sh
> +++ b/testcases/kernel/containers/netns/child_2.sh
> @@ -66,6 +66,7 @@ status=0
>          # Using /tmp/FIFO5 to synchronize with CHILD1
>          echo 0 > /tmp/FIFO5
>          sleep 2
> +	status=0
>      else
>          tst_resm TFAIL "FAIL: Unable to ping Child1NS from Child2NS !"
>          echo 1 > /tmp/FIFO5
> diff --git a/testcases/kernel/containers/netns/childns.sh b/testcases/kernel/containers/netns/childns.sh
> index 3634d81..16fc7e8 100755
> --- a/testcases/kernel/containers/netns/childns.sh
> +++ b/testcases/kernel/containers/netns/childns.sh
> @@ -38,6 +38,8 @@ exists awk grep ip ping sshd
>  . initialize.sh
>  status=0
>      
> +SSHD=`which sshd`
> +
>  if [ $# -eq 1 ] ; then
>      childscrpt=$1
>      debug "INFO: The script to be executed in child NS is $childscrpt"
> @@ -58,7 +60,7 @@ ifconfig lo up
>  sleep 2
> 
>  #starting the sshd inside the child NS
> -if ! sshd -p $PORT; then
> +if $SSHD -p $PORT; then
>      debug "INFO: started the sshd @ port no $PORT"
>      sshpid=`ps -ef | grep "sshd -p $PORT" | grep -v grep | awk '{ print $2 ; exit 0} ' `
>  else
> diff --git a/testcases/kernel/containers/netns/common.c b/testcases/kernel/containers/netns/common.c
> index 22d0e99..6d3b02e 100644
> --- a/testcases/kernel/containers/netns/common.c
> +++ b/testcases/kernel/containers/netns/common.c
> @@ -48,8 +48,7 @@ int crtchild(char *s1 , char *s2)
>  {
>  	char *cmd[] = { "--", s1, s2, (char *)0 };
>  	execve("/bin/sh", cmd, __environ);
> -	printf("The code would not reach here on success\n");
> -	perror("execve");
> +	fprintf(stderr, "Failed to execve(%s, %s): %m\n", s1, s2);
>  	return 1;
>  }
> 
> diff --git a/testcases/kernel/containers/netns/par_ftp.sh b/testcases/kernel/containers/netns/par_ftp.sh
> index 3bfb47b..bb65db4 100755
> --- a/testcases/kernel/containers/netns/par_ftp.sh
> +++ b/testcases/kernel/containers/netns/par_ftp.sh
> @@ -37,6 +37,7 @@ export TST_TOTAL
>      
>      if [ $? = 0 ] ; then
>          tst_resm TINFO "Pinging ChildNS from ParentNS"
> +	status=0
>      else
>          tst_resm TFAIL "Error: Unable to ping ChildNS from ParentNS"
>          status=-1
> @@ -45,3 +46,5 @@ export TST_TOTAL
>      if [ $stat != 0 ] ; then
>          status=$stat
>      fi
> +
> +    exit $status
> diff --git a/testcases/kernel/containers/netns/parent_1.sh b/testcases/kernel/containers/netns/parent_1.sh
> index 8577bf2..32f1a47 100755
> --- a/testcases/kernel/containers/netns/parent_1.sh
> +++ b/testcases/kernel/containers/netns/parent_1.sh
> @@ -55,4 +55,4 @@ export TST_TOTAL
>      echo $vnet1 > /tmp/FIFO1
> 
>      debug "INFO: PARENT_1: End of $0"
> -    exit $status
> +    exit 0
> diff --git a/testcases/kernel/containers/netns/parent_2.sh b/testcases/kernel/containers/netns/parent_2.sh
> index 57d3974..f72c16d 100755
> --- a/testcases/kernel/containers/netns/parent_2.sh
> +++ b/testcases/kernel/containers/netns/parent_2.sh
> @@ -51,4 +51,4 @@ export TST_TOTAL
>      echo $vnet3 > /tmp/FIFO3
> 
>      debug "INFO: PARENT-2: End of $0"
> -    exit $status
> +    exit 0


------------------------------------------------------------------------------

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

  parent reply	other threads:[~2010-05-07  9:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-05 17:43 [LTP] [PATCH] NetNS test fixes Dan Smith
2010-05-05 18:16 ` Subrata Modak
2010-05-07  9:41 ` Subrata Modak [this message]
2010-05-07 14:30   ` Dan Smith
2010-05-07 14:36     ` Serge E. Hallyn
2010-05-09 14:17       ` Subrata Modak

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=1273225268.6042.8.camel@subratamodak.linux.ibm.com \
    --to=subrata@linux.vnet.ibm.com \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=serue@linux.vnet.ibm.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