Commit e84622ce authored by David Ahern's avatar David Ahern Committed by Jakub Kicinski

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: 735ab2f6 ("selftests: Add test with multiple prefixes using single nexthop")
Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
parent 0360894a
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
PAUSE_ON_FAIL=no PAUSE_ON_FAIL=no
VERBOSE=0 VERBOSE=0
which ping6 > /dev/null 2>&1 && ping6=$(which ping6) || ping6=$(which ping)
################################################################################ ################################################################################
# helpers # helpers
...@@ -200,7 +202,7 @@ validate_v6_exception() ...@@ -200,7 +202,7 @@ validate_v6_exception()
local rc local rc
if [ ${ping_sz} != "0" ]; then if [ ${ping_sz} != "0" ]; then
run_cmd ip netns exec h0 ping6 -s ${ping_sz} -c5 -w5 ${dst} run_cmd ip netns exec h0 ${ping6} -s ${ping_sz} -c5 -w5 ${dst}
fi fi
if [ "$VERBOSE" = "1" ]; then if [ "$VERBOSE" = "1" ]; then
...@@ -243,7 +245,7 @@ do ...@@ -243,7 +245,7 @@ do
run_cmd taskset -c ${c} ip netns exec h0 ping -c1 -w1 172.16.10${i}.1 run_cmd taskset -c ${c} ip netns exec h0 ping -c1 -w1 172.16.10${i}.1
[ $? -ne 0 ] && printf "\nERROR: ping to h${i} failed\n" && ret=1 [ $? -ne 0 ] && printf "\nERROR: ping to h${i} failed\n" && ret=1
run_cmd taskset -c ${c} ip netns exec h0 ping6 -c1 -w1 2001:db8:10${i}::1 run_cmd taskset -c ${c} ip netns exec h0 ${ping6} -c1 -w1 2001:db8:10${i}::1
[ $? -ne 0 ] && printf "\nERROR: ping6 to h${i} failed\n" && ret=1 [ $? -ne 0 ] && printf "\nERROR: ping6 to h${i} failed\n" && ret=1
[ $ret -ne 0 ] && break [ $ret -ne 0 ] && break
......
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