dummy

package
v1.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package dummy helps with creating transient dummy type virtual network interfaces for testing purposes. It leverages the Ginkgo testing framework and matching (erm, sic!) Gomega matchers.

The "dummy" 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

View Source
const DummyPrefix = "dumy-"

DummyPrefix is the name prefix used for transient dummy network interfaces.

Variables

This section is empty.

Functions

func NewTransient

func NewTransient(opts ...Opt) netlink.Link

NewTransient creates a transient network interface of type “dummy”. It does not configure any IP address(es) though. NewTransient automatically defers proper automatic removal of the dummy network interface.

func NewTransientUp

func NewTransientUp(opts ...Opt) netlink.Link

NewTransientUp creates a transient network interface of type “dummy” and additionally brings it up. It does not configure any IP address(es) though. NewTransient automatically defers proper automatic removal of the dummy network interface.

Types

type Opt added in v1.5.0

type Opt func(*link.Link) error

Opt is a configuration option when creating a new dummy network interface.

func InNamespace added in v1.5.0

func InNamespace(fdref int) Opt

InNamespace configures a dummy network interface to be created in the network namespace referenced by fdref, instead of creating it in the current network namespace.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL