Skip to content

Add the first e2e tests - #56

Merged
fedepaol merged 6 commits into
openperouter:mainfrom
fedepaol:firste2es
May 5, 2025
Merged

Add the first e2e tests#56
fedepaol merged 6 commits into
openperouter:mainfrom
fedepaol:firste2es

Conversation

@fedepaol

Copy link
Copy Markdown
Contributor

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

At the same time, fixing a few bugs found while writing the tests.

@fedepaol
fedepaol force-pushed the firste2es branch 4 times, most recently from cc60c89 to 0e0b46c Compare April 28, 2025 12:56
@fedepaol fedepaol closed this Apr 28, 2025
@fedepaol fedepaol reopened this Apr 28, 2025
Comment thread clab/README.md
- endpoints: ["leafA:ethblue", "hostA_blue:eth1"]
- endpoints: ["leafB:ethred", "hostB_red:eth1"]
- endpoints: ["leafB:ethblue", "hostB_blue:eth1"]
- endpoints: ["leafkind:toswitch", "leafkind-switch:leaf2"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread clab/README.md
Comment on lines +53 to +57
- endpoints: ["leafA:eth1", "spine:eth1"]
- endpoints: ["leafB:eth1", "spine:eth2"]
- endpoints: ["leafkind:eth1", "spine:eth3"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it worth to rename each interface by its purpose (tospine, toleafa, etc.), or it will just make this clunkier?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope, not crucial


for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
fmt.Println(tt.logLevel)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: leftover?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup

Comment thread e2etests/pkg/config/update.go Outdated
FRRConfigurations []frrk8sv1beta1.FRRConfiguration
}

type Updater interface {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can ditch the interface at this point (and project) 😅

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I just copy - pasted it 😅

Comment thread e2etests/pkg/config/update.go Outdated
return nil
}

func (o beta1Updater) CleanButUnderlay() error {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you put a comment on when this should be used and not All?

BGP: frrk8sapi.BGPConfig{
Routers: []frrk8sapi.Router{
{
ASN: *vni.Spec.HostASN,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we assume HostASN is always set?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread e2etests/pkg/infra/routers.go Outdated
return toIP, nil
}

func (l *linksForRouter) Add(from, to, addressFrom, addressTo string) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: the from/to naming is a bit confusing, as the mapping is bidirectional, maybe we should just rename it to A/B?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed first / second

Comment thread e2etests/pkg/infra/routers.go Outdated
links.Add("clab-kind-leafB", "clab-kind-hostB_blue", "192.169.21.1", "192.169.21.2")
}

type linksForRouter struct {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixing

Comment thread e2etests/test_plan.txt

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this for?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I managed not to commit it at least 10 times, but it eventually sneaked in 😅

Comment thread e2etests/tests/hostconfiguration.go Outdated
},
}

vni := v1alpha1.VNI{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: vni / vni1 is a bit harder to follow, can we rename to vni100 / vni200?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@fedepaol
fedepaol force-pushed the firste2es branch 5 times, most recently from 4c2a367 to 351c368 Compare April 30, 2025 15:30
fedepaol and others added 6 commits April 30, 2025 14:05
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.

@oribon oribon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@fedepaol
fedepaol merged commit feaf17c into openperouter:main May 5, 2025
@fedepaol fedepaol mentioned this pull request May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants