Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests: Fix suppress test in fib_tests.sh

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>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

David Ahern and committed by
David S. Miller
2c1dd4c1 d5812a86

+8 -2
+8 -2
tools/testing/selftests/net/fib_tests.sh
··· 618 618 619 619 fib_suppress_test() 620 620 { 621 + echo 622 + echo "FIB rule with suppress_prefixlength" 623 + setup 624 + 621 625 $IP link add dummy1 type dummy 622 626 $IP link set dummy1 up 623 627 $IP -6 route add default dev dummy1 624 628 $IP -6 rule add table main suppress_prefixlength 0 625 - ping -f -c 1000 -W 1 1234::1 || true 629 + ping -f -c 1000 -W 1 1234::1 >/dev/null 2>&1 626 630 $IP -6 rule del table main suppress_prefixlength 0 627 631 $IP link del dummy1 628 632 629 633 # If we got here without crashing, we're good. 630 - return 0 634 + log_test 0 0 "FIB rule suppress test" 635 + 636 + cleanup 631 637 } 632 638 633 639 ################################################################################