netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] selftests: Fix suppress test in fib_tests.sh
@ 2020-04-21 14:47 David Ahern
  2020-04-22 20:03 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: David Ahern @ 2020-04-21 14:47 UTC (permalink / raw)
  To: davem, kuba; +Cc: netdev, David Ahern, Jason A . Donenfeld

From: David Ahern <dsahern@gmail.com>

fib_tests is spewing errors:
    ...
    Cannot open network namespace "ns1": No such file or directory
    Cannot open network namespace "ns1": No such file or directory
    Cannot open network namespace "ns1": No such file or directory
    Cannot open network namespace "ns1": No such file or directory
    ping: connect: Network is unreachable
    Cannot open network namespace "ns1": No such file or directory
    Cannot open network namespace "ns1": No such file or directory
    ...

Each test entry in fib_tests is supposed to do its own setup and
cleanup. Right now the $IP commands in fib_suppress_test are
failing because there is no ns1. Add the setup/cleanup and logging
expected for each test.

Fixes: ca7a03c41753 ("ipv6: do not free rt if FIB_LOOKUP_NOREF is set on suppress rule")
Signed-off-by: David Ahern <dsahern@gmail.com>
Cc: Jason A. Donenfeld <Jason@zx2c4.com>
---
 tools/testing/selftests/net/fib_tests.sh | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/net/fib_tests.sh b/tools/testing/selftests/net/fib_tests.sh
index b7616704b55e..84205c3a55eb 100755
--- a/tools/testing/selftests/net/fib_tests.sh
+++ b/tools/testing/selftests/net/fib_tests.sh
@@ -618,16 +618,22 @@ fib_nexthop_test()
 
 fib_suppress_test()
 {
+	echo
+	echo "FIB rule with suppress_prefixlength"
+	setup
+
 	$IP link add dummy1 type dummy
 	$IP link set dummy1 up
 	$IP -6 route add default dev dummy1
 	$IP -6 rule add table main suppress_prefixlength 0
-	ping -f -c 1000 -W 1 1234::1 || true
+	ping -f -c 1000 -W 1 1234::1 >/dev/null 2>&1
 	$IP -6 rule del table main suppress_prefixlength 0
 	$IP link del dummy1
 
 	# If we got here without crashing, we're good.
-	return 0
+	log_test 0 0 "FIB rule suppress test"
+
+	cleanup
 }
 
 ################################################################################
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] selftests: Fix suppress test in fib_tests.sh
  2020-04-21 14:47 [PATCH net] selftests: Fix suppress test in fib_tests.sh David Ahern
@ 2020-04-22 20:03 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-04-22 20:03 UTC (permalink / raw)
  To: dsahern; +Cc: kuba, netdev, dsahern, Jason

From: David Ahern <dsahern@kernel.org>
Date: Tue, 21 Apr 2020 08:47:24 -0600

> From: David Ahern <dsahern@gmail.com>
> 
> fib_tests is spewing errors:
>     ...
>     Cannot open network namespace "ns1": No such file or directory
>     Cannot open network namespace "ns1": No such file or directory
>     Cannot open network namespace "ns1": No such file or directory
>     Cannot open network namespace "ns1": No such file or directory
>     ping: connect: Network is unreachable
>     Cannot open network namespace "ns1": No such file or directory
>     Cannot open network namespace "ns1": No such file or directory
>     ...
> 
> Each test entry in fib_tests is supposed to do its own setup and
> cleanup. Right now the $IP commands in fib_suppress_test are
> failing because there is no ns1. Add the setup/cleanup and logging
> expected for each test.
> 
> Fixes: ca7a03c41753 ("ipv6: do not free rt if FIB_LOOKUP_NOREF is set on suppress rule")
> Signed-off-by: David Ahern <dsahern@gmail.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-04-22 20:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-21 14:47 [PATCH net] selftests: Fix suppress test in fib_tests.sh David Ahern
2020-04-22 20:03 ` David Miller

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).