Skip to content

Commit

Permalink
tests: Handle proto ovn in iproute.
Browse files Browse the repository at this point in the history
The rt_proto 84 has been claimed upstream for OVN. This mapping is now
being added to iproute2 [1].
Once this is merged "ip route list" will show "proto ovn" instead of
"proto 84". Since this depends on the iproute2 version we handle both
cases in the tests.

[1]: https://patchwork.kernel.org/project/netdevbpf/patch/Z77szIaLjeMSNJP3@SIT-SDELAP4051.int.lidl.net/

Signed-off-by: Felix Huettner <felix.huettner@stackit.cloud>
  • Loading branch information
felixhuettner committed Mar 10, 2025
1 parent ee908ae commit 348883d
Show file tree
Hide file tree
Showing 2 changed files with 154 additions and 144 deletions.
16 changes: 16 additions & 0 deletions tests/system-common-macros.at
Original file line number Diff line number Diff line change
Expand Up @@ -571,3 +571,19 @@ m4_define([VRF_RESERVE],
ip link del "ovnvrf$1"
]
)

# OVN_ROUTE_EQUAL([vrf], [string to compare])
#
# Will dump all v4 routes in the mentioned vrf. Trailing spaces will be removed
# and "proto 84" is converted to "proto ovn" for compatibility.
m4_define([OVN_ROUTE_EQUAL],
[OVS_WAIT_UNTIL_EQUAL([ip route list vrf $1 | sed -e 's|[[[[:space:]]]]*$||g' -e 's|proto 84|proto ovn|'], [$2])
])

# OVN_ROUTE_V6_EQUAL([vrf], [string to compare])
#
# Will dump all v6 routes in the mentioned vrf. Trailing spaces will be removed
# and "proto 84" is converted to "proto ovn" for compatibility.
m4_define([OVN_ROUTE_V6_EQUAL],
[OVS_WAIT_UNTIL_EQUAL([ip -6 route list vrf $1 | sed -e 's|[[[[:space:]]]]*$||g' -e 's|proto 84|proto ovn|'], [$2])
])
Loading

0 comments on commit 348883d

Please sign in to comment.