Add the first e2e tests - #56
Conversation
cc60c89 to
0e0b46c
Compare
| - endpoints: ["leafA:ethblue", "hostA_blue:eth1"] | ||
| - endpoints: ["leafB:ethred", "hostB_red:eth1"] | ||
| - endpoints: ["leafB:ethblue", "hostB_blue:eth1"] | ||
| - endpoints: ["leafkind:toswitch", "leafkind-switch:leaf2"] |
There was a problem hiding this comment.
I guess this is a technical detail, what's the purpose of leafkind-switch (which doesn't show in the diagram)? should we document it?
There was a problem hiding this comment.
It makes leaf1 act as a real router with an embedded switch, allowing the kind nodes to be on the same subnet. Otherwise, we would have had two separate veths, with their respective /31 addresses.
I will add a comment / reference to the containerlab docs.
| - endpoints: ["leafA:eth1", "spine:eth1"] | ||
| - endpoints: ["leafB:eth1", "spine:eth2"] | ||
| - endpoints: ["leafkind:eth1", "spine:eth3"] |
There was a problem hiding this comment.
is it worth to rename each interface by its purpose (tospine, toleafa, etc.), or it will just make this clunkier?
There was a problem hiding this comment.
I thought about this, but the spine is likely not to be under scrutiny as it only relays info, so I thoght it wasn't worth the effort. I can change if you want.
|
|
||
| for _, tt := range tests { | ||
| t.Run(tt.name, func(t *testing.T) { | ||
| fmt.Println(tt.logLevel) |
| FRRConfigurations []frrk8sv1beta1.FRRConfiguration | ||
| } | ||
|
|
||
| type Updater interface { |
There was a problem hiding this comment.
I think we can ditch the interface at this point (and project) 😅
There was a problem hiding this comment.
yeah I just copy - pasted it 😅
| return nil | ||
| } | ||
|
|
||
| func (o beta1Updater) CleanButUnderlay() error { |
There was a problem hiding this comment.
can you put a comment on when this should be used and not All?
| BGP: frrk8sapi.BGPConfig{ | ||
| Routers: []frrk8sapi.Router{ | ||
| { | ||
| ASN: *vni.Spec.HostASN, |
There was a problem hiding this comment.
should we assume HostASN is always set?
There was a problem hiding this comment.
yes, it's e2e after all. If it's not it will pop up immediately. In general, in e2e it's worth not adding bloat and let it explode imo
| return toIP, nil | ||
| } | ||
|
|
||
| func (l *linksForRouter) Add(from, to, addressFrom, addressTo string) { |
There was a problem hiding this comment.
nit: the from/to naming is a bit confusing, as the mapping is bidirectional, maybe we should just rename it to A/B?
There was a problem hiding this comment.
renamed first / second
| links.Add("clab-kind-leafB", "clab-kind-hostB_blue", "192.169.21.1", "192.169.21.2") | ||
| } | ||
|
|
||
| type linksForRouter struct { |
There was a problem hiding this comment.
nit: the naming here is a bit confusing, because it might suggest only one router is involved, whereas this seems to hold the mapping between all the "routers"?
There was a problem hiding this comment.
I managed not to commit it at least 10 times, but it eventually sneaked in 😅
| }, | ||
| } | ||
|
|
||
| vni := v1alpha1.VNI{ |
There was a problem hiding this comment.
nit: vni / vni1 is a bit harder to follow, can we rename to vni100 / vni200?
4c2a367 to
351c368
Compare
We expand the topology, giving more meaningful names, providing a way to see the ips easily and allowing testing two different l3 vnis. Signed-off-by: Federico Paolinelli <fpaoline@redhat.com>
Instead of failing, we allow the setup with the TOR even if no VNIs are provided. This makes it possible to add them later while still testing and establishing the session.
We changed the name of the daemonsets, aligning the Makefile too. Also, we forgot to delete the node marker deployment.
We did not wire up the logic for deleting the VNIs that are not configured anymore. It's needed in order to clean up the leftovers from previously configured vnis.
We add the tests and the infrastructure to validate that: - we peer with the leaf - we are able to receive type 5 routes - when creating a vni, we peer with the host
Adding a raw version to run CI. Missing building images upfront, collecting logs.
We add the tests and the infrastructure to validate that:
At the same time, fixing a few bugs found while writing the tests.