linuxmock

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IfNetlinkHandlerMock

type IfNetlinkHandlerMock struct {
	// contains filtered or unexported fields
}

NetlinkHandlerMock allows to mock netlink-related methods

func NewIfNetlinkHandlerMock

func NewIfNetlinkHandlerMock() *IfNetlinkHandlerMock

NewNetlinkHandlerMock creates new instance of the mock and initializes response list

func (*IfNetlinkHandlerMock) AddInterfaceIP

func (mock *IfNetlinkHandlerMock) AddInterfaceIP(ifName string, addr *net.IPNet) error

func (*IfNetlinkHandlerMock) AddVethInterfacePair

func (mock *IfNetlinkHandlerMock) AddVethInterfacePair(ifName, peerIfName string) error

func (*IfNetlinkHandlerMock) DelInterfaceIP

func (mock *IfNetlinkHandlerMock) DelInterfaceIP(ifName string, addr *net.IPNet) error

func (*IfNetlinkHandlerMock) DelVethInterfacePair

func (mock *IfNetlinkHandlerMock) DelVethInterfacePair(ifName, peerIfName string) error

func (*IfNetlinkHandlerMock) GetAddressList

func (mock *IfNetlinkHandlerMock) GetAddressList(ifName string) ([]netlink.Addr, error)

func (*IfNetlinkHandlerMock) GetInterfaceByName

func (mock *IfNetlinkHandlerMock) GetInterfaceByName(ifName string) (*net.Interface, error)

func (*IfNetlinkHandlerMock) GetInterfaceType

func (mock *IfNetlinkHandlerMock) GetInterfaceType(ifName string) (string, error)

func (*IfNetlinkHandlerMock) GetLinkByName

func (mock *IfNetlinkHandlerMock) GetLinkByName(ifName string) (netlink.Link, error)
func (mock *IfNetlinkHandlerMock) GetLinkList() ([]netlink.Link, error)

func (*IfNetlinkHandlerMock) GetVethPeerName

func (mock *IfNetlinkHandlerMock) GetVethPeerName(ifName string) (string, error)

func (*IfNetlinkHandlerMock) InterfaceExists

func (mock *IfNetlinkHandlerMock) InterfaceExists(ifName string) (bool, error)

func (*IfNetlinkHandlerMock) RenameInterface

func (mock *IfNetlinkHandlerMock) RenameInterface(ifName string, newName string) error

func (*IfNetlinkHandlerMock) SetInterfaceDown

func (mock *IfNetlinkHandlerMock) SetInterfaceDown(ifName string) error

func (*IfNetlinkHandlerMock) SetInterfaceMTU

func (mock *IfNetlinkHandlerMock) SetInterfaceMTU(ifName string, mtu int) error

func (*IfNetlinkHandlerMock) SetInterfaceMac

func (mock *IfNetlinkHandlerMock) SetInterfaceMac(ifName string, macAddress string) error

func (*IfNetlinkHandlerMock) SetInterfaceUp

func (mock *IfNetlinkHandlerMock) SetInterfaceUp(ifName string) error

func (*IfNetlinkHandlerMock) SetStopwatch

func (mock *IfNetlinkHandlerMock) SetStopwatch(stopwatch *measure.Stopwatch)

func (*IfNetlinkHandlerMock) When

func (mock *IfNetlinkHandlerMock) When(name string) *whenIfResp

When defines name of the related method. It creates a new instance of whenIfResp with provided method name and stores it to the mock.

type L3NetlinkHandlerMock

type L3NetlinkHandlerMock struct {
	// contains filtered or unexported fields
}

NetlinkHandlerMock allows to mock netlink-related methods

func NewL3NetlinkHandlerMock

func NewL3NetlinkHandlerMock() *L3NetlinkHandlerMock

NewNetlinkHandlerMock creates new instance of the mock and initializes response list

func (*L3NetlinkHandlerMock) AddArpEntry

func (mock *L3NetlinkHandlerMock) AddArpEntry(name string, arpEntry *netlink.Neigh) error

func (*L3NetlinkHandlerMock) AddStaticRoute

func (mock *L3NetlinkHandlerMock) AddStaticRoute(name string, route *netlink.Route) error

func (*L3NetlinkHandlerMock) DelArpEntry

func (mock *L3NetlinkHandlerMock) DelArpEntry(name string, arpEntry *netlink.Neigh) error

func (*L3NetlinkHandlerMock) DelStaticRoute

func (mock *L3NetlinkHandlerMock) DelStaticRoute(name string, route *netlink.Route) error

func (*L3NetlinkHandlerMock) GetArpEntries

func (mock *L3NetlinkHandlerMock) GetArpEntries(interfaceIdx int, family int) ([]netlink.Neigh, error)

func (*L3NetlinkHandlerMock) ReplaceStaticRoute

func (mock *L3NetlinkHandlerMock) ReplaceStaticRoute(name string, route *netlink.Route) error

func (*L3NetlinkHandlerMock) SetArpEntry

func (mock *L3NetlinkHandlerMock) SetArpEntry(name string, arpEntry *netlink.Neigh) error

func (*L3NetlinkHandlerMock) SetStopwatch

func (mock *L3NetlinkHandlerMock) SetStopwatch(stopwatch *measure.Stopwatch)

func (*L3NetlinkHandlerMock) When

func (mock *L3NetlinkHandlerMock) When(name string) *whenL3Resp

When defines name of the related method. It creates a new instance of whenL3Resp with provided method name and stores it to the mock.

type NamespacePluginMock

type NamespacePluginMock struct {
	// contains filtered or unexported fields
}

NamespacePluginMock allows to mock namespace plugin methods to manage namespaces and microservices

func NewNamespacePluginMock

func NewNamespacePluginMock() *NamespacePluginMock

NewNamespacePluginMock creates new instance of the mock and initializes response list

func (*NamespacePluginMock) ArpNsToGeneric

func (*NamespacePluginMock) GenericToArpNs

func (*NamespacePluginMock) GetConfigNamespace

func (*NamespacePluginMock) HandleMicroservices

func (mock *NamespacePluginMock) HandleMicroservices(ctx *nsplugin.MicroserviceCtx)

func (*NamespacePluginMock) IfNsToGeneric

func (*NamespacePluginMock) IfaceNsToString

func (*NamespacePluginMock) IsNamespaceAvailable

func (*NamespacePluginMock) RouteNsToGeneric

func (*NamespacePluginMock) SetInterfaceNamespace

func (mock *NamespacePluginMock) SetInterfaceNamespace(ctx *nsplugin.NamespaceMgmtCtx, ifName string, namespace *interfaces.LinuxInterfaces_Interface_Namespace) error

func (*NamespacePluginMock) SwitchNamespace

func (mock *NamespacePluginMock) SwitchNamespace(ns *nsplugin.Namespace, ctx *nsplugin.NamespaceMgmtCtx) (func(), error)

func (*NamespacePluginMock) SwitchToNamespace

func (mock *NamespacePluginMock) SwitchToNamespace(nsMgmtCtx *nsplugin.NamespaceMgmtCtx, ns *interfaces.LinuxInterfaces_Interface_Namespace) (func(), error)

func (*NamespacePluginMock) When

func (mock *NamespacePluginMock) When(methodName string) *whenNsResp

When defines name of the related method. It creates a new instance of whenNsResp with provided method name and stores it to the mock.

type SystemMock

type SystemMock struct {
	// contains filtered or unexported fields
}

SystemMock allows to mock netlink-related methods

func NewSystemMock

func NewSystemMock() *SystemMock

NewSystemMock creates new instance of the mock and initializes response list

func (*SystemMock) GetNamespaceFromName

func (mock *SystemMock) GetNamespaceFromName(name string) (netns.NsHandle, error)

func (*SystemMock) MkDirAll

func (mock *SystemMock) MkDirAll(path string, perm os.FileMode) error

func (*SystemMock) Mount

func (mock *SystemMock) Mount(source string, target string, fsType string, flags uintptr, data string) error

func (*SystemMock) NewNetworkNamespace

func (mock *SystemMock) NewNetworkNamespace() (netns.NsHandle, error)

func (*SystemMock) OpenFile

func (mock *SystemMock) OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)

func (*SystemMock) Remove

func (mock *SystemMock) Remove(name string) error

func (*SystemMock) SetNamespace

func (mock *SystemMock) SetNamespace(ns netns.NsHandle) error

func (*SystemMock) Unmount

func (mock *SystemMock) Unmount(target string, flags int) error

func (*SystemMock) When

func (mock *SystemMock) When(name string) *whenStResp

When defines name of the related method. It creates a new instance of whenStResp with provided method name and stores it to the mock.

Jump to

Keyboard shortcuts

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