-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Create and manage local network topologies using network namespaces in tests #27450
Copy link
Copy link
Open
Labels
area/CI-improvementTopic or proposal to improve the Continuous Integration workflowTopic or proposal to improve the Continuous Integration workflowarea/agentCilium agent related.Cilium agent related.area/datapathImpacts bpf/ or low-level forwarding details, including map management and monitor messages.Impacts bpf/ or low-level forwarding details, including map management and monitor messages.pinnedThese issues are not marked stale by our issue bot.These issues are not marked stale by our issue bot.
Metadata
Metadata
Assignees
Labels
area/CI-improvementTopic or proposal to improve the Continuous Integration workflowTopic or proposal to improve the Continuous Integration workflowarea/agentCilium agent related.Cilium agent related.area/datapathImpacts bpf/ or low-level forwarding details, including map management and monitor messages.Impacts bpf/ or low-level forwarding details, including map management and monitor messages.pinnedThese issues are not marked stale by our issue bot.These issues are not marked stale by our issue bot.
node_linux_test.gocurrently sets up topologies like these:All of these topologies are set up in an imperative style, using individual calls to the netlink lib to manage devices and addresses:
Instead, I propose we implement a Go package that enables a declarative style like Containerlab (not yaml, something idiomatic in Go):
To avoid a bunch of
netlink.LinkByName()calls, we want to be able to extract handles to devices in a declarative way, too, much likeLoadAndAssign()in ebpf-go: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.goto 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.