Refactor and add route propagation tests - #59
Conversation
|
|
||
| // This test must be the last of the ordered describe as it will remove the underlay | ||
| It("deleting the underlay removes the session with the tor", func() { | ||
| By("deleting the vni removes the session with the host") |
There was a problem hiding this comment.
can/should we start with validating the session is there?
There was a problem hiding this comment.
I can, we already validated as the first it of the spec and this is an ordered spec, but re-validating won't hurt.
| if len(r.Nexthops) == 0 { | ||
| continue | ||
| } | ||
| res[p] = r.Nexthops[0].IP |
There was a problem hiding this comment.
why this approach instead of parsing all nexthops + going over all of them in HaveRoute? (if it has something to do with BestPath/Valid, can we make this more explicit?)
| } `json:"addressFamilyInfo"` | ||
| ConnectionsDropped int `json:"connectionsDropped"` | ||
| ConnectionsDropped int `json:"connectionsDropped"` | ||
| NoSuchNeighbor bool `json:"bgpNoSuchNeighbor"` |
|
|
||
| It("receives type 5 routes from the fabric", func() { | ||
| Contains := true | ||
| checkRouteForLeaf := func(leaf infra.Leaf, vni v1alpha1.VNI, mustContain bool, prefixes []string) { |
There was a problem hiding this comment.
can/should this be From instead of For?
There was a problem hiding this comment.
I don't mind changing it. It's either "check the routes for that leaf" or check the routes coming from that leaf.
| By("announcing type 5 routes on VNI 100 from leafA") | ||
| changeLeafPrefixes(infra.LeafAConfig, leafAVRFRedPrefixes, emptyPrefixes) | ||
| checkRouteForLeaf(infra.LeafAConfig, vniRed, Contains, leafAVRFRedPrefixes) | ||
|
|
There was a problem hiding this comment.
can we have a !Contains for blue here?
There was a problem hiding this comment.
we are not advertising those routes yet, so what it would be testing? Do you have a particular reason for wanting it?
| changeLeafPrefixes(infra.LeafBConfig, leafBVRFRedPrefixes, leafBVRFBluePrefixes) | ||
| checkRouteForLeaf(infra.LeafBConfig, vniRed, Contains, leafBVRFRedPrefixes) | ||
| checkRouteForLeaf(infra.LeafBConfig, vniBlue, Contains, leafBVRFBluePrefixes) | ||
|
|
There was a problem hiding this comment.
can we keep checking leafA prefixes here?
| changeLeafPrefixes(infra.LeafAConfig, emptyPrefixes, leafAVRFBluePrefixes) | ||
| checkRouteForLeaf(infra.LeafAConfig, vniRed, !Contains, leafAVRFRedPrefixes) | ||
| checkRouteForLeaf(infra.LeafAConfig, vniBlue, Contains, leafAVRFBluePrefixes) | ||
|
|
| checkRouteForLeaf(infra.LeafAConfig, vniBlue, Contains, leafAVRFBluePrefixes) | ||
|
|
||
| By("removing a route from leafA on vni 200") | ||
| changeLeafPrefixes(infra.LeafAConfig, emptyPrefixes, emptyPrefixes) |
There was a problem hiding this comment.
I am going to add the 4 checks in every step, feels less error prone / easier to understand.
Signed-off-by: Federico Paolinelli <fpaoline@redhat.com>
ff33085 to
2a47b29
Compare
It makes sense to have a more broad session validation as a separate file. Signed-off-by: Federico Paolinelli <fpaoline@redhat.com>
We add functions that check if a given route is received via BGP or EVPN. - Add logic to fetch the output from FRR - Add the parsing functions - Add utility functions to validate if a given route is present in either EPVN routes or BGP routes Signed-off-by: Federico Paolinelli <fpaoline@redhat.com>
We refresh the existing type5 routes tests with a more comprehensive one where we add and delete routes. Also, we add a test that validates that type5 routes are propagated to the host via BGP. Signed-off-by: Federico Paolinelli <fpaoline@redhat.com>
Adding the reporter library to collect crds and pod logs, and inspecting the various frr instances both in frr-k8s, in the perouter and on the clab leaves. Signed-off-by: Federico Paolinelli <fpaoline@redhat.com>
We are getting warnings about MGMTD and WATCHFRR, setting the global one. Signed-off-by: Federico Paolinelli <fpaoline@redhat.com>
Signed-off-by: Federico Paolinelli <fpaoline@redhat.com>
Here we add more test checking the route propagation and we refactor the whole machinery a bit.