Documentation ¶
Overview ¶
Package macvlan helps with creating transient MACVLAN network interfaces for testing purposes. 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 MacvlanPrefix = "mcvl-"
MacvlanPrefix is the name prefix used for transient MACVLAN network interfaces.
Variables ¶
This section is empty.
Functions ¶
func CreateTransient
deprecated
CreateTransient creates and returns a new (and transient) MACVLAN network interface attached to the specified parent network interface (which must be a hardware network interface, including the dummy kind).
Deprecated: use NewTransient instead.
func LocateHWParent ¶
LocateHWParent locates a “hardware” network interface in the current network namespace that is operationally up and returns it. If no suitable network interface can be found, then the current test is failed. If multiple suitable network interfaces are found, a random one of them is returned.
Please consider using a “dummy” network interface instead as a MACVLAN parent unless it's absolutely necessary to use a hardware network interface. Dummy network interfaces can be created using [dummy.NewTransient].
func NewTransient ¶ added in v1.0.2
NewTransient creates and returns a new (and transient) MACVLAN network interface attached to the specified parent network interface (which must be a hardware network interface, including the dummy kind). CreateTransient automatically defers proper automatic removal of the MACVLAN network interface.
Types ¶
type Opt ¶ added in v1.5.0
Opt is a configuration option when creating a new MACVLAN network interface.
func InNamespace ¶ added in v1.5.0
InNamespace configures a MACVLAN network interface to be created in the network namespace referenced by fdref, instead of creating it in the current network namespace.
func WithMode ¶ added in v1.5.0
func WithMode(mode netlink.MacvlanMode) Opt
WithMode configures the MACVLAN mode.
See also: netlink.MacvlanMode.