Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create and manage local network topologies using network namespaces in tests #27450

Open
ti-mo opened this issue Aug 11, 2023 · 3 comments
Open
Labels
area/CI-improvement Topic or proposal to improve the Continuous Integration workflow pinned These issues are not marked stale by our issue bot. sig/agent Cilium agent related. sig/datapath Impacts bpf/ or low-level forwarding details, including map management and monitor messages.

Comments

@ti-mo
Copy link
Contributor

ti-mo commented Aug 11, 2023

node_linux_test.go currently sets up topologies like these:

image

All of these topologies are set up in an imperative style, using individual calls to the netlink lib to manage devices and addresses:

image etc..


Instead, I propose we implement a Go package that enables a declarative style like Containerlab (not yaml, something idiomatic in Go):

image

To avoid a bunch of netlink.LinkByName() calls, we want to be able to extract handles to devices in a declarative way, too, much like LoadAndAssign() in ebpf-go:

image

This way, only one call needs to be made to obtain all handles one wants to interact with from the test.


As a first target, port some or all of the tests in node_test_linux.go to this new API to get a feel for the exact requirements.

As a knock-on effect, it will become trivial to create new tests that need an intricate network topology. By lowering the barrier and automating the boilerplate, authoring new tests will become significantly easier and more commonplace.

This issue practically depends on #27449.

@ti-mo ti-mo added sig/datapath Impacts bpf/ or low-level forwarding details, including map management and monitor messages. area/CI-improvement Topic or proposal to improve the Continuous Integration workflow sig/agent Cilium agent related. labels Aug 11, 2023
@github-actions
Copy link

This issue has been automatically marked as stale because it has not
had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions bot added the stale The stale bot thinks this issue is old. Add "pinned" label to prevent this from becoming stale. label Oct 11, 2023
@ti-mo ti-mo added pinned These issues are not marked stale by our issue bot. and removed stale The stale bot thinks this issue is old. Add "pinned" label to prevent this from becoming stale. labels Oct 11, 2023
@ti-mo ti-mo added this to the netns refactoring milestone Nov 22, 2023
@bleggett
Copy link
Contributor

bleggett commented Dec 14, 2023

I've done significant amounts of work in Istio with CNI/netns stuff, interested in working on this (and #27449) as a way to familiarize myself with the Cilium test suites if no one has objections or already has started work.

@ti-mo
Copy link
Contributor Author

ti-mo commented Feb 22, 2024

@ldelossa raised a discussion at containerlab upstream: srl-labs/containerlab#1905.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/CI-improvement Topic or proposal to improve the Continuous Integration workflow pinned These issues are not marked stale by our issue bot. sig/agent Cilium agent related. sig/datapath Impacts bpf/ or low-level forwarding details, including map management and monitor messages.
Projects
None yet
Development

No branches or pull requests

3 participants