Commit 0360894a authored by David Ahern's avatar David Ahern Committed by Jakub Kicinski

selftests: Update fib_tests to handle missing ping6

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: a0e11da7 ("fib_tests: Add tests for metrics on routes")
Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
parent 9e5c8d39
...@@ -17,6 +17,8 @@ PAUSE=no ...@@ -17,6 +17,8 @@ PAUSE=no
IP="ip -netns ns1" IP="ip -netns ns1"
NS_EXEC="ip netns exec ns1" NS_EXEC="ip netns exec ns1"
which ping6 > /dev/null 2>&1 && ping6=$(which ping6) || ping6=$(which ping)
log_test() log_test()
{ {
local rc=$1 local rc=$1
...@@ -1086,7 +1088,7 @@ ipv6_route_metrics_test() ...@@ -1086,7 +1088,7 @@ ipv6_route_metrics_test()
log_test $rc 0 "Multipath route with mtu metric" log_test $rc 0 "Multipath route with mtu metric"
$IP -6 ro add 2001:db8:104::/64 via 2001:db8:101::2 mtu 1300 $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" 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" run_cmd "$IP -6 ro add 2001:db8:114::/64 via 2001:db8:101::2 congctl lock foo"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment