summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests
diff options
context:
space:
mode:
authorDavid Ahern <dsahern@gmail.com>2019-09-17 13:30:21 -0400
committerJakub Kicinski <jakub.kicinski@netronome.com>2019-09-20 21:13:32 -0400
commit0360894a05ed52be268e3c4d40b2df9d94975fa6 (patch)
tree7c0393825e52ef1b984427593ed6b30562b9b2ea /tools/testing/selftests
parent9e5c8d39b88c15f4ec3ab24a73e09c112f209344 (diff)
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: 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>
Diffstat (limited to 'tools/testing/selftests')
-rwxr-xr-xtools/testing/selftests/net/fib_tests.sh4
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 4465fc2dae14..cba83a12da82 100755
--- a/tools/testing/selftests/net/fib_tests.sh
+++ b/tools/testing/selftests/net/fib_tests.sh
@@ -17,6 +17,8 @@ PAUSE=no
17IP="ip -netns ns1" 17IP="ip -netns ns1"
18NS_EXEC="ip netns exec ns1" 18NS_EXEC="ip netns exec ns1"
19 19
20which ping6 > /dev/null 2>&1 && ping6=$(which ping6) || ping6=$(which ping)
21
20log_test() 22log_test()
21{ 23{
22 local rc=$1 24 local rc=$1
@@ -1086,7 +1088,7 @@ ipv6_route_metrics_test()
1086 log_test $rc 0 "Multipath route with mtu metric" 1088 log_test $rc 0 "Multipath route with mtu metric"
1087 1089
1088 $IP -6 ro add 2001:db8:104::/64 via 2001:db8:101::2 mtu 1300 1090 $IP -6 ro add 2001:db8:104::/64 via 2001:db8:101::2 mtu 1300
1089 run_cmd "ip netns exec ns1 ping6 -w1 -c1 -s 1500 2001:db8:104::1" 1091 run_cmd "ip netns exec ns1 ${ping6} -w1 -c1 -s 1500 2001:db8:104::1"
1090 log_test $? 0 "Using route with mtu metric" 1092 log_test $? 0 "Using route with mtu metric"
1091 1093
1092 run_cmd "$IP -6 ro add 2001:db8:114::/64 via 2001:db8:101::2 congctl lock foo" 1094 run_cmd "$IP -6 ro add 2001:db8:114::/64 via 2001:db8:101::2 congctl lock foo"