Commit 1fe5bc93 authored by Ondřej Zajíček's avatar Ondřej Zajíček

Tests: Minor fixes in handling link-local kernel routes

parent ff022f9d
......@@ -7,4 +7,5 @@ if [ $1 = "IPv6" ]; then variant=6; fi
ip "-$variant" route show $2 \
| strip_addresses \
| strip_interfaces_via \
| strip_nexthop_pref
| strip_nexthop_pref \
| strip_link_local_routes
......@@ -15,7 +15,7 @@ strip_addresses() {
strip_interfaces_on() {
# remove the name of interfaces for link-local nexthops, after 'on'
sed -E "s/(fe80::<removed> on) [[:alnum:]]*/\1 <removed>/"
sed -E "s/(fe80::<removed> on) [[:alnum:]]* weight/\1 <removed> weight/"
}
strip_interfaces_via() {
......@@ -27,3 +27,8 @@ strip_nexthop_pref() {
# remove 'pref' value for ECMP nexthops reported in some version of ip/kernel
sed -E "s/(nexthop via .*) pref [[:alnum:]]*/\1 /"
}
strip_link_local_routes() {
# remove 'local' kernel routes for link-local networks (for local or vrf tables)
egrep -v '^(anycast|local) fe80|^fe80::/64|^ff00::/8'
}
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