Documentation ¶
Overview ¶
Package link helps with creating transient type virtual network interfaces of various types for testing purposes. It leverages the Ginkgo testing framework and matching (erm, sic!) Gomega matchers.
The network interfaces created by this package 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 ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureUp ¶ added in v1.1.0
EnsureUp brings the specified network interface up and waits for it to become operationally “UP”. The maximum wait duration can be optionally specified; it defaults to 2s.
func NewTransient ¶
NewTransient creates a transient network interface of the specified type (via the type of the link value passed in) and with a name that begins with the given prefix and a random string of 10 hex digits. The newly created link is additionally scheduled for deletion using Ginko's DeferCleanup.
The passed link description is deep-copied first and thus never modified. Only the returned link description correctly references the newly created network interface ("link").
The newly created transient link starts in down operational state. Use netlink.LinkSetUp to bring its operational state "up".
NewTransient remembers the network namespace the network interface was created in, so that it can correctly clean up the transient network interface later from one of Ginkgo's deferred cleanup handlers.
Types ¶
This section is empty.