VNET and BGP route coexistence #3345
Open
+1,607
−1,229
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What I did
This PR adds the logic to give Vnet routes precedence over BGP learnt route.
This PR also refactors the test_vnet.py to break out the common code into a library.
Why I did it
Currently if a route is learnt via BGP and added into the hardware, adding a VNET route results in failure. In addition due to a bug in VnetOrch, we start advertising the failed route, This prompts the BGP to remove the learnt route in favor of the local route. Since the Vnet Orch doesn't retry adding the Vnet route, This results in no route being present in the Hardware.
How I verified it
Added 2 tests to verify the learnt route is removed when a Vnet route is added.
One test covers the scnerio where BFD sessions are brought up before the Vnet route is added and the 2nd covers when the Vnet route is added before the BFD sessions are brought up.
Details if related