kubernetesk8s.io/kubernetes/pkg/kubelet/cadvisor/testing Index | Files

package testing

import "k8s.io/kubernetes/pkg/kubelet/cadvisor/testing"

Index

Constants

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)"
)

Types

type Fake

type Fake struct {
	NodeName string
}

Fake cadvisor.Interface implementation.

func (*Fake) ContainerFsInfo

func (c *Fake) ContainerFsInfo(context.Context) (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

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

GetDirFsInfo is a fake implementation of Interface.GetDirFsInfo.

func (*Fake) GetRequestedContainersInfo

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

func (c *Fake) ImagesFsInfo(context.Context) (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

type MockInterface struct {
	mock.Mock
}

MockInterface is an autogenerated mock type for the Interface type

func NewMockInterface

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

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

ContainerFsInfo provides a mock function with given fields: _a0

func (*MockInterface) ContainerInfoV2

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

func (_m *MockInterface) EXPECT() *MockInterface_Expecter

func (*MockInterface) GetDirFsInfo

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

GetDirFsInfo provides a mock function with given fields: path

func (*MockInterface) GetRequestedContainersInfo

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

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

ImagesFsInfo provides a mock function with given fields: _a0

func (*MockInterface) MachineInfo

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

MachineInfo provides a mock function with given fields:

func (*MockInterface) RootFsInfo

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

RootFsInfo provides a mock function with given fields:

func (*MockInterface) Start

func (_m *MockInterface) Start() error

Start provides a mock function with given fields:

func (*MockInterface) VersionInfo

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

VersionInfo provides a mock function with given fields:

type MockInterface_ContainerFsInfo_Call

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

func (*MockInterface_ContainerFsInfo_Call) Run

func (*MockInterface_ContainerFsInfo_Call) RunAndReturn

type MockInterface_ContainerInfoV2_Call

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

func (*MockInterface_ContainerInfoV2_Call) Run

func (*MockInterface_ContainerInfoV2_Call) RunAndReturn

type MockInterface_Expecter

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

func (*MockInterface_Expecter) ContainerFsInfo

func (_e *MockInterface_Expecter) ContainerFsInfo(_a0 interface{}) *MockInterface_ContainerFsInfo_Call

ContainerFsInfo is a helper method to define mock.On call

func (*MockInterface_Expecter) ContainerInfoV2

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

ContainerInfoV2 is a helper method to define mock.On call

func (*MockInterface_Expecter) GetDirFsInfo

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

GetDirFsInfo is a helper method to define mock.On call

func (*MockInterface_Expecter) GetRequestedContainersInfo

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

GetRequestedContainersInfo is a helper method to define mock.On call

func (*MockInterface_Expecter) ImagesFsInfo

func (_e *MockInterface_Expecter) ImagesFsInfo(_a0 interface{}) *MockInterface_ImagesFsInfo_Call

ImagesFsInfo is a helper method to define mock.On call

func (*MockInterface_Expecter) MachineInfo

MachineInfo is a helper method to define mock.On call

func (*MockInterface_Expecter) RootFsInfo

RootFsInfo is a helper method to define mock.On call

func (*MockInterface_Expecter) Start

Start is a helper method to define mock.On call

func (*MockInterface_Expecter) VersionInfo

VersionInfo is a helper method to define mock.On call

type MockInterface_GetDirFsInfo_Call

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

func (*MockInterface_GetDirFsInfo_Call) Run

func (*MockInterface_GetDirFsInfo_Call) RunAndReturn

type MockInterface_GetRequestedContainersInfo_Call

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

func (*MockInterface_GetRequestedContainersInfo_Call) Run

func (*MockInterface_GetRequestedContainersInfo_Call) RunAndReturn

type MockInterface_ImagesFsInfo_Call

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

func (*MockInterface_ImagesFsInfo_Call) Run

func (*MockInterface_ImagesFsInfo_Call) RunAndReturn

type MockInterface_MachineInfo_Call

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

func (*MockInterface_MachineInfo_Call) Run

func (*MockInterface_MachineInfo_Call) RunAndReturn

type MockInterface_RootFsInfo_Call

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

func (*MockInterface_RootFsInfo_Call) Run

func (*MockInterface_RootFsInfo_Call) RunAndReturn

type MockInterface_Start_Call

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

func (*MockInterface_Start_Call) Run

func (*MockInterface_Start_Call) RunAndReturn

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

type MockInterface_VersionInfo_Call

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

func (*MockInterface_VersionInfo_Call) Run

func (*MockInterface_VersionInfo_Call) RunAndReturn

Source Files

cadvisor_fake.go cadvisor_mock.go

Version
v1.33.1 (latest)
Published
May 15, 2025
Platform
linux/amd64
Imports
5 packages
Last checked
11 hours ago

Tools for package owners.