ACK: [OEM-5.6][SRU][PATCH 1/1] selftests: fib_nexthop_multiprefix: fix cleanup() netns deletion

Thadeu Lima de Souza Cascardo cascardo at canonical.com
Fri Dec 18 09:28:56 UTC 2020


On Fri, Dec 18, 2020 at 11:21:57AM +0800, Po-Hsu Lin wrote:
> From: Paolo Pisati <paolo.pisati at canonical.com>
> 
> BugLink: https://bugs.launchpad.net/bugs/1880648
> 
> 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 at canonical.com>
> Reviewed-by: David Ahern <dsahern at gmail.com>
> Signed-off-by: David S. Miller <davem at davemloft.net>
> (cherry picked from commit f59f6acc33b3c6655314b2609fa3033aaeaaceee)
> Signed-off-by: Po-Hsu Lin <po-hsu.lin at canonical.com>

Acked-by: Thadeu Lima de Souza Cascardo <cascardo at 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 9dc35a1..51df5e3 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
> -- 
> 2.7.4
> 
> 
> -- 
> kernel-team mailing list
> kernel-team at lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team



More information about the kernel-team mailing list