diff mbox series

[Unstable] UBUNTU: SAUCE: selftests: fib_nexthop_multiprefix: fix cleanup() netns deletion

Message ID 20200714154130.68284-1-paolo.pisati@canonical.com
State New
Headers show
Series [Unstable] UBUNTU: SAUCE: selftests: fib_nexthop_multiprefix: fix cleanup() netns deletion | expand

Commit Message

Paolo Pisati July 14, 2020, 3:41 p.m. UTC
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(-)

Comments

Po-Hsu Lin July 15, 2020, 6:38 a.m. UTC | #1
Looking good.
Acked-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
Juerg Haefliger July 15, 2020, 7:33 a.m. UTC | #2
On Tue, 14 Jul 2020 17:41:30 +0200
Paolo Pisati <paolo.pisati@canonical.com> 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>

Acked-by: Juerg Haefliger <juergh@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
Seth Forshee July 17, 2020, 10:31 p.m. UTC | #3
On Tue, Jul 14, 2020 at 05:41:30PM +0200, 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>

Applied to unstable, thanks!
diff mbox series

Patch

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