Documentation ¶
Overview ¶
Package veth helps with creating transient virtual Ethernet network interfaces that always come in pairs. It leverages the Ginkgo testing framework and matching (erm, sic!) Gomega matchers.
These MACVLAN network interfaces are transient because they automatically get removed at the end of the a test (spec, block/group, suite, et cetera) using Ginkgo's DeferCleanup.
Index ¶
Constants ¶
const VethPrefix = "veth-"
VethPrefix is the name prefix used for transient VETH network interfaces.
Variables ¶
This section is empty.
Functions ¶
func NewTransient ¶
NewTransient creates and returns a new (and transient) VETH pair of network interfaces. The one VETH end is created in the current network namespace, while the other VETH end can optionally be created in a differend network namespace using WithPeerNamespace.
See also: https://en.wikipedia.org/wiki/Thomson_and_Thompson
Types ¶
type Opt ¶
Opt is a configuration option when creating a new pair of VETH network interfaces.
func InNamespace ¶ added in v1.5.0
InNamespace configures the “first” VETH network interface to be created in the network namespace referenced by fdref, instead of creating it in the current network namespace. The “second” VETH network interface will be created in the current network namespace, use WithPeerNamespace to create this end in a different network namespace.
func WithPeerNamespace ¶
WithPeerNamespace configures the VETH peer end to be created inside the network namespace referenced by fd.