diff options
author | David Ahern <dsahern@gmail.com> | 2019-09-17 13:30:35 -0400 |
---|---|---|
committer | Jakub Kicinski <jakub.kicinski@netronome.com> | 2019-09-20 21:18:16 -0400 |
commit | e84622ce24482f6e9c1bf29d3bdd556eb587ff41 (patch) | |
tree | ada8e656f4e4c16050b98d466bfead45ab42b28c /tools/testing/selftests | |
parent | 0360894a05ed52be268e3c4d40b2df9d94975fa6 (diff) |
selftests: Update fib_nexthop_multiprefix 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: 735ab2f65dce ("selftests: Add test with multiple prefixes using single nexthop")
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-x | tools/testing/selftests/net/fib_nexthop_multiprefix.sh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/testing/selftests/net/fib_nexthop_multiprefix.sh b/tools/testing/selftests/net/fib_nexthop_multiprefix.sh index e6828732843e..9dc35a16e415 100755 --- a/tools/testing/selftests/net/fib_nexthop_multiprefix.sh +++ b/tools/testing/selftests/net/fib_nexthop_multiprefix.sh | |||
@@ -15,6 +15,8 @@ | |||
15 | PAUSE_ON_FAIL=no | 15 | PAUSE_ON_FAIL=no |
16 | VERBOSE=0 | 16 | VERBOSE=0 |
17 | 17 | ||
18 | which ping6 > /dev/null 2>&1 && ping6=$(which ping6) || ping6=$(which ping) | ||
19 | |||
18 | ################################################################################ | 20 | ################################################################################ |
19 | # helpers | 21 | # helpers |
20 | 22 | ||
@@ -200,7 +202,7 @@ validate_v6_exception() | |||
200 | local rc | 202 | local rc |
201 | 203 | ||
202 | if [ ${ping_sz} != "0" ]; then | 204 | if [ ${ping_sz} != "0" ]; then |
203 | run_cmd ip netns exec h0 ping6 -s ${ping_sz} -c5 -w5 ${dst} | 205 | run_cmd ip netns exec h0 ${ping6} -s ${ping_sz} -c5 -w5 ${dst} |
204 | fi | 206 | fi |
205 | 207 | ||
206 | if [ "$VERBOSE" = "1" ]; then | 208 | if [ "$VERBOSE" = "1" ]; then |
@@ -243,7 +245,7 @@ do | |||
243 | run_cmd taskset -c ${c} ip netns exec h0 ping -c1 -w1 172.16.10${i}.1 | 245 | run_cmd taskset -c ${c} ip netns exec h0 ping -c1 -w1 172.16.10${i}.1 |
244 | [ $? -ne 0 ] && printf "\nERROR: ping to h${i} failed\n" && ret=1 | 246 | [ $? -ne 0 ] && printf "\nERROR: ping to h${i} failed\n" && ret=1 |
245 | 247 | ||
246 | run_cmd taskset -c ${c} ip netns exec h0 ping6 -c1 -w1 2001:db8:10${i}::1 | 248 | run_cmd taskset -c ${c} ip netns exec h0 ${ping6} -c1 -w1 2001:db8:10${i}::1 |
247 | [ $? -ne 0 ] && printf "\nERROR: ping6 to h${i} failed\n" && ret=1 | 249 | [ $? -ne 0 ] && printf "\nERROR: ping6 to h${i} failed\n" && ret=1 |
248 | 250 | ||
249 | [ $ret -ne 0 ] && break | 251 | [ $ret -ne 0 ] && break |