testing

package
v1.3.0-alpha.4 Latest Latest
Warning

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

Go to latest
Published: May 17, 2016 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindEmptyDirectoryUsageOnTmpfs

func FindEmptyDirectoryUsageOnTmpfs() (*resource.Quantity, error)

FindEmptyDirectoryUsageOnTmpfs finds the expected usage of an empty directory existing on a tmpfs filesystem on this system.

func NewFakeRecycler

func NewFakeRecycler(spec *Spec, host VolumeHost, config VolumeConfig) (Recycler, error)

func NewFakeVolumeHost

func NewFakeVolumeHost(rootDir string, kubeClient clientset.Interface, plugins []VolumePlugin) *fakeVolumeHost

func ProbeVolumePlugins

func ProbeVolumePlugins(config VolumeConfig) []VolumePlugin

Types

type FakeDeleter

type FakeDeleter struct {
	MetricsNil
	// contains filtered or unexported fields
}

func (*FakeDeleter) Delete

func (fd *FakeDeleter) Delete() error

func (*FakeDeleter) GetPath

func (fd *FakeDeleter) GetPath() string

type FakeProvisioner

type FakeProvisioner struct {
	Options VolumeOptions
	Host    VolumeHost
}

func (*FakeProvisioner) NewPersistentVolumeTemplate

func (fc *FakeProvisioner) NewPersistentVolumeTemplate() (*api.PersistentVolume, error)

func (*FakeProvisioner) Provision

func (fc *FakeProvisioner) Provision(pv *api.PersistentVolume) error

type FakeVolume

type FakeVolume struct {
	PodUID  types.UID
	VolName string
	Plugin  *FakeVolumePlugin
	MetricsNil

	SetUpCallCount              int
	TearDownCallCount           int
	AttachCallCount             int
	DetachCallCount             int
	WaitForAttachCallCount      int
	WaitForDetachCallCount      int
	MountDeviceCallCount        int
	UnmountDeviceCallCount      int
	GetDeviceMountPathCallCount int
}

func (*FakeVolume) Attach

func (fv *FakeVolume) Attach(spec *Spec, hostName string) error

func (*FakeVolume) Detach

func (fv *FakeVolume) Detach(deviceMountPath string, hostName string) error

func (*FakeVolume) GetAttributes

func (_ *FakeVolume) GetAttributes() Attributes

func (*FakeVolume) GetDeviceMountPath added in v1.3.0

func (fv *FakeVolume) GetDeviceMountPath(host VolumeHost, spec *Spec) string

func (*FakeVolume) GetPath

func (fv *FakeVolume) GetPath() string

func (*FakeVolume) MountDevice added in v1.3.0

func (fv *FakeVolume) MountDevice(spec *Spec, devicePath string, deviceMountPath string, mounter mount.Interface) error

func (*FakeVolume) SetUp

func (fv *FakeVolume) SetUp(fsGroup *int64) error

func (*FakeVolume) SetUpAt

func (fv *FakeVolume) SetUpAt(dir string, fsGroup *int64) error

func (*FakeVolume) TearDown

func (fv *FakeVolume) TearDown() error

func (*FakeVolume) TearDownAt

func (fv *FakeVolume) TearDownAt(dir string) error

func (*FakeVolume) UnmountDevice added in v1.3.0

func (fv *FakeVolume) UnmountDevice(globalMountPath string, mounter mount.Interface) error

func (*FakeVolume) WaitForAttach added in v1.3.0

func (fv *FakeVolume) WaitForAttach(spec *Spec, spectimeout time.Duration) (string, error)

func (*FakeVolume) WaitForDetach added in v1.3.0

func (fv *FakeVolume) WaitForDetach(devicePath string, timeout time.Duration) error

type FakeVolumePlugin

type FakeVolumePlugin struct {
	PluginName             string
	Host                   VolumeHost
	Config                 VolumeConfig
	LastProvisionerOptions VolumeOptions
	NewAttacherCallCount   int
	NewDetacherCallCount   int

	Mounters   []*FakeVolume
	Unmounters []*FakeVolume
	Attachers  []*FakeVolume
	Detachers  []*FakeVolume
}

FakeVolumePlugin is useful for testing. It tries to be a fully compliant plugin, but all it does is make empty directories. Use as:

volume.RegisterPlugin(&FakePlugin{"fake-name"})

func (*FakeVolumePlugin) CanSupport

func (plugin *FakeVolumePlugin) CanSupport(spec *Spec) bool

func (*FakeVolumePlugin) GetAccessModes

func (plugin *FakeVolumePlugin) GetAccessModes() []api.PersistentVolumeAccessMode

func (*FakeVolumePlugin) Init

func (plugin *FakeVolumePlugin) Init(host VolumeHost) error

func (*FakeVolumePlugin) Name

func (plugin *FakeVolumePlugin) Name() string

func (*FakeVolumePlugin) NewAttacher

func (plugin *FakeVolumePlugin) NewAttacher() (Attacher, error)

func (*FakeVolumePlugin) NewDeleter

func (plugin *FakeVolumePlugin) NewDeleter(spec *Spec) (Deleter, error)

func (*FakeVolumePlugin) NewDetacher

func (plugin *FakeVolumePlugin) NewDetacher() (Detacher, error)

func (*FakeVolumePlugin) NewMounter added in v1.3.0

func (plugin *FakeVolumePlugin) NewMounter(spec *Spec, pod *api.Pod, opts VolumeOptions) (Mounter, error)

func (*FakeVolumePlugin) NewProvisioner

func (plugin *FakeVolumePlugin) NewProvisioner(options VolumeOptions) (Provisioner, error)

func (*FakeVolumePlugin) NewRecycler

func (plugin *FakeVolumePlugin) NewRecycler(spec *Spec) (Recycler, error)

func (*FakeVolumePlugin) NewUnmounter added in v1.3.0

func (plugin *FakeVolumePlugin) NewUnmounter(volName string, podUID types.UID) (Unmounter, error)

type MockVolume

type MockVolume struct {
	mock.Mock
}

func (*MockVolume) GetMetrics

func (_m *MockVolume) GetMetrics() (*Metrics, error)

GetMetrics provides a mock function with given fields:

func (*MockVolume) GetPath

func (_m *MockVolume) GetPath() string

GetPath provides a mock function with given fields:

Jump to

Keyboard shortcuts

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