Skip to contentSkip to conversation

selftests: Update fib_tests to handle missing ping6

PATCH Applied David Ahern 2 participants 2 messages Sep 17, 2019 – Sep 21, 2019

Subsystems (4)
lore
Share & tools
lore

David Ahern

author maintainer
#0 lore raw

PATCH 1/1 selftests: Update fib_tests to handle missing ping6

From: David Ahern <[email protected]>

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")
---
 tools/testing/selftests/net/fib_tests.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tools/testing/selftests/net/fib_tests.sh +3 -1
index 4465fc2dae14..cba83a12da82 100755
@@ -17,6 +17,8 @@ PAUSE=no
 IP="ip -netns ns1"
 NS_EXEC="ip netns exec ns1"
 
+which ping6 > /dev/null 2>&1 && ping6=$(which ping6) || ping6=$(which ping)
+
 log_test()
 {
 	local rc=$1
@@ -1086,7 +1088,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"
Signature · 1 line
2.11.0
#1 lore raw
Quoted 7 lines · David Ahern

From: David Ahern <[email protected]>

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

Applied, queued, thanks!