testing

package
v1.0.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFakeCNIPlugin

func NewFakeCNIPlugin() ocicni.CNIPlugin

NewFakeCNIPlugin create a FakeCNIPlugin.

Types

type CalledDetail

type CalledDetail struct {
	// Name of the function called.
	Name string
	// Argument of the function called.
	Argument interface{}
}

CalledDetail is the struct contains called function name and arguments.

type FakeCNIPlugin

type FakeCNIPlugin struct {
	sync.Mutex

	IPMap map[string]string
	// contains filtered or unexported fields
}

FakeCNIPlugin is a fake plugin used for test.

func (*FakeCNIPlugin) ClearErrors

func (f *FakeCNIPlugin) ClearErrors()

ClearErrors clear errors for call

func (*FakeCNIPlugin) GetCalledDetails

func (f *FakeCNIPlugin) GetCalledDetails() []CalledDetail

GetCalledDetails get detail of each call.

func (*FakeCNIPlugin) GetCalledNames

func (f *FakeCNIPlugin) GetCalledNames() []string

GetCalledNames get names of call

func (*FakeCNIPlugin) GetPodNetworkStatus

func (f *FakeCNIPlugin) GetPodNetworkStatus(podNetwork ocicni.PodNetwork) (string, error)

GetPodNetworkStatus get the status of network.

func (*FakeCNIPlugin) InjectError

func (f *FakeCNIPlugin) InjectError(fn string, err error)

InjectError inject error for call

func (*FakeCNIPlugin) InjectErrors

func (f *FakeCNIPlugin) InjectErrors(errs map[string]error)

InjectErrors inject errors for calls

func (*FakeCNIPlugin) Name

func (f *FakeCNIPlugin) Name() string

Name return the name of fake CNI plugin.

func (*FakeCNIPlugin) SetFakePodNetwork

func (f *FakeCNIPlugin) SetFakePodNetwork(podNetwork ocicni.PodNetwork, ip string)

SetFakePodNetwork sets the given IP for given arguments.

func (*FakeCNIPlugin) SetUpPod

func (f *FakeCNIPlugin) SetUpPod(podNetwork ocicni.PodNetwork) error

SetUpPod setup the network of PodSandbox.

func (*FakeCNIPlugin) Status

func (f *FakeCNIPlugin) Status() error

Status get the status of the plugin.

func (*FakeCNIPlugin) TearDownPod

func (f *FakeCNIPlugin) TearDownPod(podNetwork ocicni.PodNetwork) error

TearDownPod teardown the network of PodSandbox.

Jump to

Keyboard shortcuts

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