Skip to content

Commit cb0f749

Browse files
felixhuettnerdceara
authored andcommitted
tests: Handle proto ovn in iproute.
The rt_proto 84 has been claimed upstream for OVN. This mapping is now also added to iproute2 [1]. Once a version with this commit is in use "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://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=131810fb264f Signed-off-by: Felix Huettner <[email protected]> Signed-off-by: Dumitru Ceara <[email protected]>
1 parent 189a6ac commit cb0f749

File tree

2 files changed

+154
-144
lines changed

2 files changed

+154
-144
lines changed

tests/system-common-macros.at

+16
Original file line numberDiff line numberDiff line change
@@ -571,3 +571,19 @@ m4_define([VRF_RESERVE],
571571
ip link del "ovnvrf$1"
572572
]
573573
)
574+
575+
# OVN_ROUTE_EQUAL([vrf], [string to compare])
576+
#
577+
# Will dump all v4 routes in the mentioned vrf. Trailing spaces will be removed
578+
# and "proto 84" is converted to "proto ovn" for compatibility.
579+
m4_define([OVN_ROUTE_EQUAL],
580+
[OVS_WAIT_UNTIL_EQUAL([ip route list vrf $1 | sed -e 's|[[[[:space:]]]]*$||g' -e 's|proto 84|proto ovn|'], [$2])
581+
])
582+
583+
# OVN_ROUTE_V6_EQUAL([vrf], [string to compare])
584+
#
585+
# Will dump all v6 routes in the mentioned vrf. Trailing spaces will be removed
586+
# and "proto 84" is converted to "proto ovn" for compatibility.
587+
m4_define([OVN_ROUTE_V6_EQUAL],
588+
[OVS_WAIT_UNTIL_EQUAL([ip -6 route list vrf $1 | sed -e 's|[[[[:space:]]]]*$||g' -e 's|proto 84|proto ovn|'], [$2])
589+
])

0 commit comments

Comments
 (0)