selftests: rtnetlink: Add a test case for multipath route get

Without previous patch a warning would be generated upon multipath route
get when FIB multipath hash policy is to use a 5-tuple for multipath
hash calculation.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Ido Schimmel 2018-12-20 17:03:29 +00:00 committed by David S. Miller
parent 21f9477537
commit 676f4bb168
1 changed files with 15 additions and 0 deletions

View File

@ -205,6 +205,8 @@ kci_test_polrouting()
kci_test_route_get()
{
local hash_policy=$(sysctl -n net.ipv4.fib_multipath_hash_policy)
ret=0
ip route get 127.0.0.1 > /dev/null
@ -223,6 +225,19 @@ kci_test_route_get()
check_err $?
ip route get 10.23.7.11 from 10.23.7.12 iif "$devdummy" > /dev/null
check_err $?
ip route add 10.23.8.0/24 \
nexthop via 10.23.7.13 dev "$devdummy" \
nexthop via 10.23.7.14 dev "$devdummy"
check_err $?
sysctl -wq net.ipv4.fib_multipath_hash_policy=0
ip route get 10.23.8.11 > /dev/null
check_err $?
sysctl -wq net.ipv4.fib_multipath_hash_policy=1
ip route get 10.23.8.11 > /dev/null
check_err $?
sysctl -wq net.ipv4.fib_multipath_hash_policy="$hash_policy"
ip route del 10.23.8.0/24
check_err $?
ip addr del dev "$devdummy" 10.23.7.11/24
check_err $?