linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Paolo Pisati <paolo.pisati@canonical.com>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Shuah Khan <shuah@kernel.org>
Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] selftests: fib_nexthop_multiprefix: fix cleanup() netns deletion
Date: Tue, 14 Jul 2020 11:58:28 -0600	[thread overview]
Message-ID: <4437df59-b9e3-e52d-8e43-e4dd3eab3c21@gmail.com> (raw)
In-Reply-To: <20200714154055.68167-1-paolo.pisati@canonical.com>

On 7/14/20 9:40 AM, Paolo Pisati wrote:
> During setup():
> ...
>         for ns in h0 r1 h1 h2 h3
>         do
>                 create_ns ${ns}
>         done
> ...
> 
> while in cleanup():
> ...
>         for n in h1 r1 h2 h3 h4
>         do
>                 ip netns del ${n} 2>/dev/null
>         done
> ...
> 
> and after removing the stderr redirection in cleanup():
> 
> $ sudo ./fib_nexthop_multiprefix.sh
> ...
> TEST: IPv4: host 0 to host 3, mtu 1400                              [ OK ]
> TEST: IPv6: host 0 to host 3, mtu 1400                              [ OK ]
> Cannot remove namespace file "/run/netns/h4": No such file or directory
> $ echo $?
> 1
> 
> and a non-zero return code, make kselftests fail (even if the test
> itself is fine):
> 
> ...
> not ok 34 selftests: net: fib_nexthop_multiprefix.sh # exit=1
> ...
> 
> Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
> ---
>  tools/testing/selftests/net/fib_nexthop_multiprefix.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/net/fib_nexthop_multiprefix.sh b/tools/testing/selftests/net/fib_nexthop_multiprefix.sh
> index 9dc35a16e415..51df5e305855 100755
> --- a/tools/testing/selftests/net/fib_nexthop_multiprefix.sh
> +++ b/tools/testing/selftests/net/fib_nexthop_multiprefix.sh
> @@ -144,7 +144,7 @@ setup()
>  
>  cleanup()
>  {
> -	for n in h1 r1 h2 h3 h4
> +	for n in h0 r1 h1 h2 h3
>  	do
>  		ip netns del ${n} 2>/dev/null
>  	done
> 

Reviewed-by: David Ahern <dsahern@gmail.com>

  reply	other threads:[~2020-07-14 17:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-14 15:40 [PATCH] selftests: fib_nexthop_multiprefix: fix cleanup() netns deletion Paolo Pisati
2020-07-14 17:58 ` David Ahern [this message]
2020-07-14 22:06 ` David Miller

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=4437df59-b9e3-e52d-8e43-e4dd3eab3c21@gmail.com \
    --to=dsahern@gmail.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=paolo.pisati@canonical.com \
    --cc=shuah@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).