mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
selftests: fib_tests: add more tests for metric update
[ Upstream commit 37de3b3541 ]
This patch adds two more tests to ipv4_addr_metric_test() to
explicitly cover the scenarios fixed by the previous patch.
Suggested-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
5c39c22dcd
commit
1c67660f6f
@@ -1438,6 +1438,27 @@ ipv4_addr_metric_test()
|
|||||||
fi
|
fi
|
||||||
log_test $rc 0 "Prefix route with metric on link up"
|
log_test $rc 0 "Prefix route with metric on link up"
|
||||||
|
|
||||||
|
# explicitly check for metric changes on edge scenarios
|
||||||
|
run_cmd "$IP addr flush dev dummy2"
|
||||||
|
run_cmd "$IP addr add dev dummy2 172.16.104.0/24 metric 259"
|
||||||
|
run_cmd "$IP addr change dev dummy2 172.16.104.0/24 metric 260"
|
||||||
|
rc=$?
|
||||||
|
if [ $rc -eq 0 ]; then
|
||||||
|
check_route "172.16.104.0/24 dev dummy2 proto kernel scope link src 172.16.104.0 metric 260"
|
||||||
|
rc=$?
|
||||||
|
fi
|
||||||
|
log_test $rc 0 "Modify metric of .0/24 address"
|
||||||
|
|
||||||
|
run_cmd "$IP addr flush dev dummy2"
|
||||||
|
run_cmd "$IP addr add dev dummy2 172.16.104.1/32 peer 172.16.104.2 metric 260"
|
||||||
|
run_cmd "$IP addr change dev dummy2 172.16.104.1/32 peer 172.16.104.2 metric 261"
|
||||||
|
rc=$?
|
||||||
|
if [ $rc -eq 0 ]; then
|
||||||
|
check_route "172.16.104.2 dev dummy2 proto kernel scope link src 172.16.104.1 metric 261"
|
||||||
|
rc=$?
|
||||||
|
fi
|
||||||
|
log_test $rc 0 "Modify metric of address with peer route"
|
||||||
|
|
||||||
$IP li del dummy1
|
$IP li del dummy1
|
||||||
$IP li del dummy2
|
$IP li del dummy2
|
||||||
cleanup
|
cleanup
|
||||||
|
|||||||
Reference in New Issue
Block a user