diff options
author | David Ahern <dsahern@gmail.com> | 2019-09-17 10:30:21 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-10-05 13:13:17 +0200 |
commit | 0102608d70f0eacaca6d341b9e16491d77efd21d (patch) | |
tree | f77c1649eaac0aaf0ed012b220c5ffd85577c861 /tools | |
parent | da0d6e47c20d84b6156473461a0d3680ba6b4f9f (diff) | |
download | linux-stable-0102608d70f0eacaca6d341b9e16491d77efd21d.tar.gz linux-stable-0102608d70f0eacaca6d341b9e16491d77efd21d.tar.bz2 linux-stable-0102608d70f0eacaca6d341b9e16491d77efd21d.zip |
selftests: Update fib_tests to handle missing ping6
[ Upstream commit 0360894a05ed52be268e3c4d40b2df9d94975fa6 ]
Some distributions (e.g., debian buster) do not install ping6. Re-use
the hook in pmtu.sh to detect this and fallback to ping.
Fixes: a0e11da78f48 ("fib_tests: Add tests for metrics on routes")
Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/testing/selftests/net/fib_tests.sh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/testing/selftests/net/fib_tests.sh b/tools/testing/selftests/net/fib_tests.sh index 0eca8fef2b9f..df7a55d94b75 100755 --- a/tools/testing/selftests/net/fib_tests.sh +++ b/tools/testing/selftests/net/fib_tests.sh @@ -16,6 +16,8 @@ PAUSE_ON_FAIL=no PAUSE=no IP="ip -netns ns1" +which ping6 > /dev/null 2>&1 && ping6=$(which ping6) || ping6=$(which ping) + log_test() { local rc=$1 @@ -1068,7 +1070,7 @@ ipv6_route_metrics_test() log_test $rc 0 "Multipath route with mtu metric" $IP -6 ro add 2001:db8:104::/64 via 2001:db8:101::2 mtu 1300 - run_cmd "ip netns exec ns1 ping6 -w1 -c1 -s 1500 2001:db8:104::1" + run_cmd "ip netns exec ns1 ${ping6} -w1 -c1 -s 1500 2001:db8:104::1" log_test $? 0 "Using route with mtu metric" run_cmd "$IP -6 ro add 2001:db8:114::/64 via 2001:db8:101::2 congctl lock foo" |