Skip to content

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

@ti-mo

Description

@ti-mo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/CI-improvementTopic or proposal to improve the Continuous Integration workflowarea/agentCilium agent related.area/datapathImpacts bpf/ or low-level forwarding details, including map management and monitor messages.pinnedThese issues are not marked stale by our issue bot.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions