testing

package
v1.31.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2024 License: Apache-2.0 Imports: 4 Imported by: 88

Documentation

Index

Constants

View Source
const (
	// FakeKernelVersion is a fake kernel version for testing.
	FakeKernelVersion = "3.16.0-0.bpo.4-amd64"
	// FakeContainerOSVersion is a fake OS version for testing.
	FakeContainerOSVersion = "Debian GNU/Linux 7 (wheezy)"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Fake

type Fake struct {
	NodeName string
}

Fake cadvisor.Interface implementation.

func (*Fake) ContainerFsInfo added in v1.29.0

func (c *Fake) ContainerFsInfo() (cadvisorapiv2.FsInfo, error)

ContainerFsInfo is a fake implementation of Interface.ContainerFsInfo.

func (*Fake) ContainerInfoV2

func (c *Fake) ContainerInfoV2(name string, options cadvisorapiv2.RequestOptions) (map[string]cadvisorapiv2.ContainerInfo, error)

ContainerInfoV2 is a fake implementation of Interface.ContainerInfoV2.

func (*Fake) GetDirFsInfo added in v1.10.0

func (c *Fake) GetDirFsInfo(path string) (cadvisorapiv2.FsInfo, error)

GetDirFsInfo is a fake implementation of Interface.GetDirFsInfo.

func (*Fake) GetRequestedContainersInfo added in v1.19.0

func (c *Fake) GetRequestedContainersInfo(containerName string, options cadvisorapiv2.RequestOptions) (map[string]*cadvisorapi.ContainerInfo, error)

GetRequestedContainersInfo is a fake implementation if Interface.GetRequestedContainersInfo

func (*Fake) ImagesFsInfo added in v1.3.0

func (c *Fake) ImagesFsInfo() (cadvisorapiv2.FsInfo, error)

ImagesFsInfo is a fake implementation of Interface.ImagesFsInfo.

func (*Fake) MachineInfo

func (c *Fake) MachineInfo() (*cadvisorapi.MachineInfo, error)

MachineInfo is a fake implementation of Interface.MachineInfo.

func (*Fake) RootFsInfo

func (c *Fake) RootFsInfo() (cadvisorapiv2.FsInfo, error)

RootFsInfo is a fake implementation of Interface.RootFsInfo.

func (*Fake) Start

func (c *Fake) Start() error

Start is a fake implementation of Interface.Start.

func (*Fake) VersionInfo

func (c *Fake) VersionInfo() (*cadvisorapi.VersionInfo, error)

VersionInfo is a fake implementation of Interface.VersionInfo.

type MockInterface added in v1.23.0

type MockInterface struct {
	mock.Mock
}

MockInterface is an autogenerated mock type for the Interface type

func NewMockInterface added in v1.23.0

func NewMockInterface(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockInterface

NewMockInterface creates a new instance of MockInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockInterface) ContainerFsInfo added in v1.29.0

func (_m *MockInterface) ContainerFsInfo() (v2.FsInfo, error)

ContainerFsInfo provides a mock function with given fields:

func (*MockInterface) ContainerInfoV2 added in v1.23.0

func (_m *MockInterface) ContainerInfoV2(name string, options v2.RequestOptions) (map[string]v2.ContainerInfo, error)

ContainerInfoV2 provides a mock function with given fields: name, options

func (*MockInterface) EXPECT added in v1.23.0

func (_m *MockInterface) EXPECT() *MockInterface_Expecter

func (*MockInterface) GetDirFsInfo added in v1.23.0

func (_m *MockInterface) GetDirFsInfo(path string) (v2.FsInfo, error)

GetDirFsInfo provides a mock function with given fields: path

func (*MockInterface) GetRequestedContainersInfo added in v1.23.0

func (_m *MockInterface) GetRequestedContainersInfo(containerName string, options v2.RequestOptions) (map[string]*v1.ContainerInfo, error)

GetRequestedContainersInfo provides a mock function with given fields: containerName, options

func (*MockInterface) ImagesFsInfo added in v1.23.0

func (_m *MockInterface) ImagesFsInfo() (v2.FsInfo, error)

ImagesFsInfo provides a mock function with given fields:

func (*MockInterface) MachineInfo added in v1.23.0

func (_m *MockInterface) MachineInfo() (*v1.MachineInfo, error)

MachineInfo provides a mock function with given fields:

func (*MockInterface) RootFsInfo added in v1.23.0

func (_m *MockInterface) RootFsInfo() (v2.FsInfo, error)

RootFsInfo provides a mock function with given fields:

func (*MockInterface) Start added in v1.23.0

func (_m *MockInterface) Start() error

Start provides a mock function with given fields:

func (*MockInterface) VersionInfo added in v1.23.0

func (_m *MockInterface) VersionInfo() (*v1.VersionInfo, error)

VersionInfo provides a mock function with given fields:

type MockInterface_ContainerFsInfo_Call added in v1.31.0

type MockInterface_ContainerFsInfo_Call struct {
	*mock.Call
}

MockInterface_ContainerFsInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContainerFsInfo'

func (*MockInterface_ContainerFsInfo_Call) Return added in v1.31.0

func (*MockInterface_ContainerFsInfo_Call) Run added in v1.31.0

func (*MockInterface_ContainerFsInfo_Call) RunAndReturn added in v1.31.0

type MockInterface_ContainerInfoV2_Call added in v1.31.0

type MockInterface_ContainerInfoV2_Call struct {
	*mock.Call
}

MockInterface_ContainerInfoV2_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContainerInfoV2'

func (*MockInterface_ContainerInfoV2_Call) Return added in v1.31.0

func (*MockInterface_ContainerInfoV2_Call) Run added in v1.31.0

func (*MockInterface_ContainerInfoV2_Call) RunAndReturn added in v1.31.0

type MockInterface_Expecter added in v1.31.0

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

func (*MockInterface_Expecter) ContainerFsInfo added in v1.31.0

ContainerFsInfo is a helper method to define mock.On call

func (*MockInterface_Expecter) ContainerInfoV2 added in v1.31.0

func (_e *MockInterface_Expecter) ContainerInfoV2(name interface{}, options interface{}) *MockInterface_ContainerInfoV2_Call

ContainerInfoV2 is a helper method to define mock.On call

  • name string
  • options v2.RequestOptions

func (*MockInterface_Expecter) GetDirFsInfo added in v1.31.0

func (_e *MockInterface_Expecter) GetDirFsInfo(path interface{}) *MockInterface_GetDirFsInfo_Call

GetDirFsInfo is a helper method to define mock.On call

  • path string

func (*MockInterface_Expecter) GetRequestedContainersInfo added in v1.31.0

func (_e *MockInterface_Expecter) GetRequestedContainersInfo(containerName interface{}, options interface{}) *MockInterface_GetRequestedContainersInfo_Call

GetRequestedContainersInfo is a helper method to define mock.On call

  • containerName string
  • options v2.RequestOptions

func (*MockInterface_Expecter) ImagesFsInfo added in v1.31.0

ImagesFsInfo is a helper method to define mock.On call

func (*MockInterface_Expecter) MachineInfo added in v1.31.0

MachineInfo is a helper method to define mock.On call

func (*MockInterface_Expecter) RootFsInfo added in v1.31.0

RootFsInfo is a helper method to define mock.On call

func (*MockInterface_Expecter) Start added in v1.31.0

Start is a helper method to define mock.On call

func (*MockInterface_Expecter) VersionInfo added in v1.31.0

VersionInfo is a helper method to define mock.On call

type MockInterface_GetDirFsInfo_Call added in v1.31.0

type MockInterface_GetDirFsInfo_Call struct {
	*mock.Call
}

MockInterface_GetDirFsInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDirFsInfo'

func (*MockInterface_GetDirFsInfo_Call) Return added in v1.31.0

func (*MockInterface_GetDirFsInfo_Call) Run added in v1.31.0

func (*MockInterface_GetDirFsInfo_Call) RunAndReturn added in v1.31.0

type MockInterface_GetRequestedContainersInfo_Call added in v1.31.0

type MockInterface_GetRequestedContainersInfo_Call struct {
	*mock.Call
}

MockInterface_GetRequestedContainersInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRequestedContainersInfo'

func (*MockInterface_GetRequestedContainersInfo_Call) Return added in v1.31.0

func (*MockInterface_GetRequestedContainersInfo_Call) Run added in v1.31.0

func (*MockInterface_GetRequestedContainersInfo_Call) RunAndReturn added in v1.31.0

type MockInterface_ImagesFsInfo_Call added in v1.31.0

type MockInterface_ImagesFsInfo_Call struct {
	*mock.Call
}

MockInterface_ImagesFsInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ImagesFsInfo'

func (*MockInterface_ImagesFsInfo_Call) Return added in v1.31.0

func (*MockInterface_ImagesFsInfo_Call) Run added in v1.31.0

func (*MockInterface_ImagesFsInfo_Call) RunAndReturn added in v1.31.0

type MockInterface_MachineInfo_Call added in v1.31.0

type MockInterface_MachineInfo_Call struct {
	*mock.Call
}

MockInterface_MachineInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MachineInfo'

func (*MockInterface_MachineInfo_Call) Return added in v1.31.0

func (*MockInterface_MachineInfo_Call) Run added in v1.31.0

func (*MockInterface_MachineInfo_Call) RunAndReturn added in v1.31.0

type MockInterface_RootFsInfo_Call added in v1.31.0

type MockInterface_RootFsInfo_Call struct {
	*mock.Call
}

MockInterface_RootFsInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RootFsInfo'

func (*MockInterface_RootFsInfo_Call) Return added in v1.31.0

func (*MockInterface_RootFsInfo_Call) Run added in v1.31.0

func (*MockInterface_RootFsInfo_Call) RunAndReturn added in v1.31.0

type MockInterface_Start_Call added in v1.31.0

type MockInterface_Start_Call struct {
	*mock.Call
}

MockInterface_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start'

func (*MockInterface_Start_Call) Return added in v1.31.0

func (*MockInterface_Start_Call) Run added in v1.31.0

func (*MockInterface_Start_Call) RunAndReturn added in v1.31.0

func (_c *MockInterface_Start_Call) RunAndReturn(run func() error) *MockInterface_Start_Call

type MockInterface_VersionInfo_Call added in v1.31.0

type MockInterface_VersionInfo_Call struct {
	*mock.Call
}

MockInterface_VersionInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VersionInfo'

func (*MockInterface_VersionInfo_Call) Return added in v1.31.0

func (*MockInterface_VersionInfo_Call) Run added in v1.31.0

func (*MockInterface_VersionInfo_Call) RunAndReturn added in v1.31.0

Jump to

Keyboard shortcuts

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