aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSabrina Dubroca <sd@queasysnail.net>2018-08-30 10:01:18 -0400
committerDavid S. Miller <davem@davemloft.net>2018-09-01 02:14:20 -0400
commitc81c7012e0c769b5704c2b07bd5224965e76fb70 (patch)
tree7e60253fdb5ba6257d1d3d4a0c419db38c11a2d0
parent902b5417f28d955cdb4898df6ffaab15f56c5cff (diff)
selftests: pmtu: detect correct binary to ping ipv6 addresses
Some systems don't have the ping6 binary anymore, and use ping for everything. Detect the absence of ping6 and try to use ping instead. Fixes: d1f1b9cbf34c ("selftests: net: Introduce first PMTU test") Signed-off-by: Sabrina Dubroca <sd@queasysnail.net> Acked-by: Stefano Brivio <sbrivio@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rwxr-xr-xtools/testing/selftests/net/pmtu.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/testing/selftests/net/pmtu.sh b/tools/testing/selftests/net/pmtu.sh
index 0ecf2609b9a4..32a194e3e07a 100755
--- a/tools/testing/selftests/net/pmtu.sh
+++ b/tools/testing/selftests/net/pmtu.sh
@@ -46,6 +46,9 @@
46# Kselftest framework requirement - SKIP code is 4. 46# Kselftest framework requirement - SKIP code is 4.
47ksft_skip=4 47ksft_skip=4
48 48
49# Some systems don't have a ping6 binary anymore
50which ping6 > /dev/null 2>&1 && ping6=$(which ping6) || ping6=$(which ping)
51
49tests=" 52tests="
50 pmtu_vti6_exception vti6: PMTU exceptions 53 pmtu_vti6_exception vti6: PMTU exceptions
51 pmtu_vti4_exception vti4: PMTU exceptions 54 pmtu_vti4_exception vti4: PMTU exceptions
@@ -274,7 +277,7 @@ test_pmtu_vti6_exception() {
274 mtu "${ns_b}" veth_b 4000 277 mtu "${ns_b}" veth_b 4000
275 mtu "${ns_a}" vti6_a 5000 278 mtu "${ns_a}" vti6_a 5000
276 mtu "${ns_b}" vti6_b 5000 279 mtu "${ns_b}" vti6_b 5000
277 ${ns_a} ping6 -q -i 0.1 -w 2 -s 60000 ${vti6_b_addr} > /dev/null 280 ${ns_a} ${ping6} -q -i 0.1 -w 2 -s 60000 ${vti6_b_addr} > /dev/null
278 281
279 # Check that exception was created 282 # Check that exception was created
280 if [ "$(route_get_dst_pmtu_from_exception "${ns_a}" ${vti6_b_addr})" = "" ]; then 283 if [ "$(route_get_dst_pmtu_from_exception "${ns_a}" ${vti6_b_addr})" = "" ]; then