kubernetes/pkg/volume/testing/testing.go

const ExpectProvisionFailureKey

const UncertainAttachNode

const FailDetachNode

const TimeoutAttachNode

const MultiAttachNode

const TimeoutOnSetupVolumeName

const FailOnSetupVolumeName

const TimeoutAndFailOnSetupVolumeName

const SuccessAndTimeoutSetupVolumeName

const SuccessAndFailOnSetupVolumeName

const TimeoutOnMountDeviceVolumeName

const TimeoutAndFailOnMountDeviceVolumeName

const FailMountDeviceVolumeName

const SuccessAndTimeoutDeviceName

const SuccessAndFailOnMountDeviceName

const FailWithInUseVolumeName

const FailWithUnSupportedVolumeName

const FailVolumeExpansion

const InfeasibleNodeExpansion

const OtherFinalNodeExpansionError

const deviceNotMounted

const deviceMountUncertain

const deviceMounted

const volumeNotMounted

const volumeMountUncertain

const volumeMounted

const FailNewMounter

type CommandScript

// ScriptCommands configures fe, the FakeExec, to have a pre-configured list of
// commands to expect. Calling more commands using fe than those scripted will
// result in a panic. By default, the fe does not enforce command argument checking
// or order -- if you have given an Output to the command, the first command scripted
// will return its output on the first command call, even if the command called is
// different than the one scripted. This is mostly useful to make sure that the
// right number of commands were called. If you want to check the exact commands
// and arguments were called, set fe.ExectOrder to true.
func ScriptCommands(fe *testingexec.FakeExec, scripts []CommandScript) {}

func makeFakeCmd(fakeCmd *testingexec.FakeCmd, cmd string, args ...string) testingexec.FakeCommandAction {}

func makeFakeOutput(output string, rc int) testingexec.FakeAction {}

func ProbeVolumePlugins(config volume.VolumeConfig) []volume.VolumePlugin {}

type FakeVolumePlugin

var _

var _

var _

var _

var _

var _

var _

var _

func (plugin *FakeVolumePlugin) getFakeVolume(list *[]*FakeVolume) *FakeVolume {}

func (plugin *FakeVolumePlugin) Init(host volume.VolumeHost) error {}

func (plugin *FakeVolumePlugin) GetPluginName() string {}

func (plugin *FakeVolumePlugin) GetVolumeName(spec *volume.Spec) (string, error) {}

func (plugin *FakeVolumePlugin) CanSupport(spec *volume.Spec) bool {}

func (plugin *FakeVolumePlugin) RequiresRemount(spec *volume.Spec) bool {}

func (plugin *FakeVolumePlugin) SupportsMountOption() bool {}

func (plugin *FakeVolumePlugin) SupportsSELinuxContextMount(spec *volume.Spec) (bool, error) {}

func (plugin *FakeVolumePlugin) NewMounter(spec *volume.Spec, pod *v1.Pod) (volume.Mounter, error) {}

func (plugin *FakeVolumePlugin) GetMounters() (Mounters []*FakeVolume) {}

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

func (plugin *FakeVolumePlugin) GetUnmounters() (Unmounters []*FakeVolume) {}

// Block volume support
func (plugin *FakeVolumePlugin) NewBlockVolumeMapper(spec *volume.Spec, pod *v1.Pod) (volume.BlockVolumeMapper, error) {}

// Block volume support
func (plugin *FakeVolumePlugin) GetBlockVolumeMapper() (BlockVolumeMappers []*FakeVolume) {}

// Block volume support
func (plugin *FakeVolumePlugin) NewBlockVolumeUnmapper(volName string, podUID types.UID) (volume.BlockVolumeUnmapper, error) {}

// Block volume support
func (plugin *FakeVolumePlugin) GetBlockVolumeUnmapper() (BlockVolumeUnmappers []*FakeVolume) {}

func (plugin *FakeVolumePlugin) NewAttacher() (volume.Attacher, error) {}

func (plugin *FakeVolumePlugin) NewDeviceMounter() (volume.DeviceMounter, error) {}

func (plugin *FakeVolumePlugin) GetAttachers() (Attachers []*FakeVolume) {}

func (plugin *FakeVolumePlugin) GetNewAttacherCallCount() int {}

func (plugin *FakeVolumePlugin) NewDetacher() (volume.Detacher, error) {}

func (plugin *FakeVolumePlugin) NewDeviceUnmounter() (volume.DeviceUnmounter, error) {}

func (plugin *FakeVolumePlugin) GetDetachers() (Detachers []*FakeVolume) {}

func (plugin *FakeVolumePlugin) GetNewDetacherCallCount() int {}

func (plugin *FakeVolumePlugin) CanAttach(spec *volume.Spec) (bool, error) {}

func (plugin *FakeVolumePlugin) CanDeviceMount(spec *volume.Spec) (bool, error) {}

func (plugin *FakeVolumePlugin) Recycle(pvName string, spec *volume.Spec, eventRecorder recyclerclient.RecycleEventRecorder) error {}

func (plugin *FakeVolumePlugin) NewDeleter(logger klog.Logger, spec *volume.Spec) (volume.Deleter, error) {}

func (plugin *FakeVolumePlugin) NewProvisioner(logger klog.Logger, options volume.VolumeOptions) (volume.Provisioner, error) {}

func (plugin *FakeVolumePlugin) GetAccessModes() []v1.PersistentVolumeAccessMode {}

func (plugin *FakeVolumePlugin) ConstructVolumeSpec(volumeName, mountPath string) (volume.ReconstructedVolume, error) {}

// Block volume support
func (plugin *FakeVolumePlugin) ConstructBlockVolumeSpec(podUID types.UID, volumeName, mountPath string) (*volume.Spec, error) {}

func (plugin *FakeVolumePlugin) GetDeviceMountRefs(deviceMountPath string) ([]string, error) {}

// Expandable volume support
func (plugin *FakeVolumePlugin) ExpandVolumeDevice(spec *volume.Spec, newSize resource.Quantity, oldSize resource.Quantity) (resource.Quantity, error) {}

func (plugin *FakeVolumePlugin) RequiresFSResize() bool {}

func (plugin *FakeVolumePlugin) NodeExpand(resizeOptions volume.NodeResizeOptions) (bool, error) {}

func (plugin *FakeVolumePlugin) GetVolumeLimits() (map[string]int64, error) {}

func (plugin *FakeVolumePlugin) VolumeLimitKey(spec *volume.Spec) string {}

type FakeBasicVolumePlugin

func (f *FakeBasicVolumePlugin) GetPluginName() string {}

func (f *FakeBasicVolumePlugin) GetVolumeName(spec *volume.Spec) (string, error) {}

// CanSupport tests whether the plugin supports a given volume specification by
// testing volume spec name begins with plugin name or not.
// This is useful to choose plugin by volume in testing.
func (f *FakeBasicVolumePlugin) CanSupport(spec *volume.Spec) bool {}

func (f *FakeBasicVolumePlugin) ConstructVolumeSpec(ame, mountPath string) (volume.ReconstructedVolume, error) {}

func (f *FakeBasicVolumePlugin) Init(ost volume.VolumeHost) error {}

func (f *FakeBasicVolumePlugin) NewMounter(spec *volume.Spec, pod *v1.Pod) (volume.Mounter, error) {}

func (f *FakeBasicVolumePlugin) NewUnmounter(volName string, podUID types.UID) (volume.Unmounter, error) {}

func (f *FakeBasicVolumePlugin) RequiresRemount(spec *volume.Spec) bool {}

func (f *FakeBasicVolumePlugin) SupportsSELinuxContextMount(spec *volume.Spec) (bool, error) {}

func (f *FakeBasicVolumePlugin) SupportsMountOption() bool {}

var _

type FakeDeviceMountableVolumePlugin

func (f *FakeDeviceMountableVolumePlugin) CanDeviceMount(spec *volume.Spec) (bool, error) {}

func (f *FakeDeviceMountableVolumePlugin) NewDeviceMounter() (volume.DeviceMounter, error) {}

func (f *FakeDeviceMountableVolumePlugin) NewDeviceUnmounter() (volume.DeviceUnmounter, error) {}

func (f *FakeDeviceMountableVolumePlugin) GetDeviceMountRefs(deviceMountPath string) ([]string, error) {}

var _

var _

type FakeAttachableVolumePlugin

func (f *FakeAttachableVolumePlugin) NewAttacher() (volume.Attacher, error) {}

func (f *FakeAttachableVolumePlugin) NewDetacher() (volume.Detacher, error) {}

func (f *FakeAttachableVolumePlugin) CanAttach(spec *volume.Spec) (bool, error) {}

var _

var _

type FakeFileVolumePlugin

func (plugin *FakeFileVolumePlugin) Init(host volume.VolumeHost) error {}

func (plugin *FakeFileVolumePlugin) GetPluginName() string {}

func (plugin *FakeFileVolumePlugin) GetVolumeName(spec *volume.Spec) (string, error) {}

func (plugin *FakeFileVolumePlugin) CanSupport(spec *volume.Spec) bool {}

func (plugin *FakeFileVolumePlugin) RequiresRemount(spec *volume.Spec) bool {}

func (plugin *FakeFileVolumePlugin) SupportsMountOption() bool {}

func (plugin *FakeFileVolumePlugin) SupportsSELinuxContextMount(spec *volume.Spec) (bool, error) {}

func (plugin *FakeFileVolumePlugin) NewMounter(spec *volume.Spec, podRef *v1.Pod) (volume.Mounter, error) {}

func (plugin *FakeFileVolumePlugin) NewUnmounter(name string, podUID types.UID) (volume.Unmounter, error) {}

func (plugin *FakeFileVolumePlugin) ConstructVolumeSpec(volumeName, mountPath string) (volume.ReconstructedVolume, error) {}

func NewFakeFileVolumePlugin() []volume.VolumePlugin {}

type FakeVolume

func getUniqueVolumeName(spec *volume.Spec) (string, error) {}

func (_ *FakeVolume) GetAttributes() volume.Attributes {}

func (fv *FakeVolume) SetUp(mounterArgs volume.MounterArgs) error {}

func (fv *FakeVolume) setupInternal(mounterArgs volume.MounterArgs) error {}

func (fv *FakeVolume) GetSetUpCallCount() int {}

func (fv *FakeVolume) SetUpAt(dir string, mounterArgs volume.MounterArgs) error {}

func (fv *FakeVolume) GetPath() string {}

func (fv *FakeVolume) getPath() string {}

func (fv *FakeVolume) TearDown() error {}

func (fv *FakeVolume) GetTearDownCallCount() int {}

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

// Block volume support
func (fv *FakeVolume) SetUpDevice() (string, error) {}

func (fv *FakeVolume) GetStagingPath() string {}

// Block volume support
func (fv *FakeVolume) GetSetUpDeviceCallCount() int {}

// Block volume support
func (fv *FakeVolume) GetGlobalMapPath(spec *volume.Spec) (string, error) {}

// Block volume support
func (fv *FakeVolume) getGlobalMapPath() (string, error) {}

// Block volume support
func (fv *FakeVolume) GetGlobalMapPathCallCount() int {}

// Block volume support
func (fv *FakeVolume) GetPodDeviceMapPath() (string, string) {}

// Block volume support
func (fv *FakeVolume) getPodDeviceMapPath() (string, string) {}

// Block volume support
func (fv *FakeVolume) GetPodDeviceMapPathCallCount() int {}

// Block volume support
func (fv *FakeVolume) TearDownDevice(mapPath string, devicePath string) error {}

// Block volume support
func (fv *FakeVolume) GetTearDownDeviceCallCount() int {}

// Block volume support
func (fv *FakeVolume) UnmapPodDevice() error {}

// Block volume support
func (fv *FakeVolume) GetUnmapPodDeviceCallCount() int {}

// Block volume support
func (fv *FakeVolume) MapPodDevice() (string, error) {}

// Block volume support
func (fv *FakeVolume) GetMapPodDeviceCallCount() int {}

func (fv *FakeVolume) Attach(spec *volume.Spec, nodeName types.NodeName) (string, error) {}

func (fv *FakeVolume) GetAttachCallCount() int {}

func (fv *FakeVolume) WaitForAttach(spec *volume.Spec, devicePath string, pod *v1.Pod, spectimeout time.Duration) (string, error) {}

func (fv *FakeVolume) GetWaitForAttachCallCount() int {}

func (fv *FakeVolume) GetDeviceMountPath(spec *volume.Spec) (string, error) {}

func (fv *FakeVolume) mountDeviceInternal(spec *volume.Spec, devicePath string, deviceMountPath string) error {}

func (fv *FakeVolume) MountDevice(spec *volume.Spec, devicePath string, deviceMountPath string, _ volume.DeviceMounterArgs) error {}

func (fv *FakeVolume) GetMountDeviceCallCount() int {}

func (fv *FakeVolume) GetUnmountDeviceCallCount() int {}

func (fv *FakeVolume) Detach(volumeName string, nodeName types.NodeName) error {}

func (fv *FakeVolume) VolumesAreAttached(spec []*volume.Spec, nodeName types.NodeName) (map[*volume.Spec]bool, error) {}

func (fv *FakeVolume) GetDetachCallCount() int {}

func (fv *FakeVolume) UnmountDevice(globalMountPath string) error {}

type FakeDeleter

func (fd *FakeDeleter) Delete() error {}

func (fd *FakeDeleter) GetPath() string {}

type FakeProvisioner

func (fc *FakeProvisioner) Provision(selectedNode *v1.Node, allowedTopologies []v1.TopologySelectorTerm) (*v1.PersistentVolume, error) {}

var _

// NewDeviceHandler Create a new IoHandler implementation
func NewBlockVolumePathHandler() volumepathhandler.BlockVolumePathHandler {}

type FakeVolumePathHandler

func (fv *FakeVolumePathHandler) MapDevice(devicePath string, mapDir string, linkName string, bindMount bool) error {}

func (fv *FakeVolumePathHandler) UnmapDevice(mapDir string, linkName string, bindMount bool) error {}

func (fv *FakeVolumePathHandler) RemoveMapPath(mapPath string) error {}

func (fv *FakeVolumePathHandler) IsSymlinkExist(mapPath string) (bool, error) {}

func (fv *FakeVolumePathHandler) IsDeviceBindMountExist(mapPath string) (bool, error) {}

func (fv *FakeVolumePathHandler) GetDeviceBindMountRefs(devPath string, mapPath string) ([]string, error) {}

func (fv *FakeVolumePathHandler) FindGlobalMapPathUUIDFromPod(pluginDir, mapPath string, podUID types.UID) (string, error) {}

func (fv *FakeVolumePathHandler) AttachFileDevice(path string) (string, error) {}

func (fv *FakeVolumePathHandler) DetachFileDevice(path string) error {}

func (fv *FakeVolumePathHandler) GetLoopDevice(path string) (string, error) {}

// FindEmptyDirectoryUsageOnTmpfs finds the expected usage of an empty directory existing on
// a tmpfs filesystem on this system.
func FindEmptyDirectoryUsageOnTmpfs() (*resource.Quantity, error) {}

// VerifyAttachCallCount ensures that at least one of the Attachers for this
// plugin has the expectedAttachCallCount number of calls. Otherwise it returns
// an error.
func VerifyAttachCallCount(
	expectedAttachCallCount int,
	fakeVolumePlugin *FakeVolumePlugin) error {}

// VerifyZeroAttachCalls ensures that all of the Attachers for this plugin have
// a zero AttachCallCount. Otherwise it returns an error.
func VerifyZeroAttachCalls(fakeVolumePlugin *FakeVolumePlugin) error {}

// VerifyWaitForAttachCallCount ensures that at least one of the Mounters for
// this plugin has the expectedWaitForAttachCallCount number of calls. Otherwise
// it returns an error.
func VerifyWaitForAttachCallCount(
	expectedWaitForAttachCallCount int,
	fakeVolumePlugin *FakeVolumePlugin) error {}

// VerifyZeroWaitForAttachCallCount ensures that all Attachers for this plugin
// have a zero WaitForAttachCallCount. Otherwise it returns an error.
func VerifyZeroWaitForAttachCallCount(fakeVolumePlugin *FakeVolumePlugin) error {}

// VerifyMountDeviceCallCount ensures that at least one of the Mounters for
// this plugin has the expectedMountDeviceCallCount number of calls. Otherwise
// it returns an error.
func VerifyMountDeviceCallCount(
	expectedMountDeviceCallCount int,
	fakeVolumePlugin *FakeVolumePlugin) error {}

func VerifyUnmountDeviceCallCount(expectedCallCount int, fakeVolumePlugin *FakeVolumePlugin) error {}

// VerifyZeroMountDeviceCallCount ensures that all Attachers for this plugin
// have a zero MountDeviceCallCount. Otherwise it returns an error.
func VerifyZeroMountDeviceCallCount(fakeVolumePlugin *FakeVolumePlugin) error {}

// VerifySetUpCallCount ensures that at least one of the Mounters for this
// plugin has the expectedSetUpCallCount number of calls. Otherwise it returns
// an error.
func VerifySetUpCallCount(
	expectedSetUpCallCount int,
	fakeVolumePlugin *FakeVolumePlugin) error {}

// VerifyZeroSetUpCallCount ensures that all Mounters for this plugin have a
// zero SetUpCallCount. Otherwise it returns an error.
func VerifyZeroSetUpCallCount(fakeVolumePlugin *FakeVolumePlugin) error {}

// VerifyTearDownCallCount ensures that at least one of the Unounters for this
// plugin has the expectedTearDownCallCount number of calls. Otherwise it
// returns an error.
func VerifyTearDownCallCount(
	expectedTearDownCallCount int,
	fakeVolumePlugin *FakeVolumePlugin) error {}

// VerifyZeroTearDownCallCount ensures that all Mounters for this plugin have a
// zero TearDownCallCount. Otherwise it returns an error.
func VerifyZeroTearDownCallCount(fakeVolumePlugin *FakeVolumePlugin) error {}

// VerifyDetachCallCount ensures that at least one of the Attachers for this
// plugin has the expectedDetachCallCount number of calls. Otherwise it returns
// an error.
func VerifyDetachCallCount(
	expectedDetachCallCount int,
	fakeVolumePlugin *FakeVolumePlugin) error {}

// VerifyZeroDetachCallCount ensures that all Detachers for this plugin have a
// zero DetachCallCount. Otherwise it returns an error.
func VerifyZeroDetachCallCount(fakeVolumePlugin *FakeVolumePlugin) error {}

// VerifyTearDownDeviceCallCount ensures that at least one of the Unmappers for this
// plugin has the expectedTearDownDeviceCallCount number of calls. Otherwise it
// returns an error.
func VerifyTearDownDeviceCallCount(
	expectedTearDownDeviceCallCount int,
	fakeVolumePlugin *FakeVolumePlugin) error {}

// VerifyZeroTearDownDeviceCallCount ensures that all Mappers for this plugin have a
// zero TearDownDeviceCallCount. Otherwise it returns an error.
func VerifyZeroTearDownDeviceCallCount(fakeVolumePlugin *FakeVolumePlugin) error {}

// VerifyUnmapPodDeviceCallCount ensures that at least one of the Unmappers for this
// plugin has the expected number of UnmapPodDevice calls. Otherwise it
// returns an error.
func VerifyUnmapPodDeviceCallCount(
	expectedUnmapPodDeviceCallCount int,
	fakeVolumePlugin *FakeVolumePlugin) error {}

// VerifyZeroUnmapPodDeviceCallCount ensures that all Mappers for this plugin have a
// zero UnmapPodDevice calls. Otherwise it returns an error.
func VerifyZeroUnmapPodDeviceCallCount(fakeVolumePlugin *FakeVolumePlugin) error {}

// VerifyGetGlobalMapPathCallCount ensures that at least one of the Mappers for this
// plugin has the expectedGlobalMapPathCallCount number of calls. Otherwise it returns
// an error.
func VerifyGetGlobalMapPathCallCount(
	expectedGlobalMapPathCallCount int,
	fakeVolumePlugin *FakeVolumePlugin) error {}

// VerifyGetPodDeviceMapPathCallCount ensures that at least one of the Mappers for this
// plugin has the expectedPodDeviceMapPathCallCount number of calls. Otherwise it returns
// an error.
func VerifyGetPodDeviceMapPathCallCount(
	expectedPodDeviceMapPathCallCount int,
	fakeVolumePlugin *FakeVolumePlugin) error {}

// VerifyGetMapPodDeviceCallCount ensures that at least one of the Mappers for this
// plugin has the expectedMapPodDeviceCallCount number of calls. Otherwise it
// returns an error.
func VerifyGetMapPodDeviceCallCount(
	expectedMapPodDeviceCallCount int,
	fakeVolumePlugin *FakeVolumePlugin) error {}

// GetTestVolumePluginMgr creates, initializes, and returns a test volume plugin
// manager and fake volume plugin using a fake volume host.
func GetTestVolumePluginMgr(t *testing.T) (*volume.VolumePluginMgr, *FakeVolumePlugin) {}

func GetTestKubeletVolumePluginMgr(t *testing.T) (*volume.VolumePluginMgr, *FakeVolumePlugin) {}

func GetTestKubeletVolumePluginMgrWithNode(t *testing.T, node *v1.Node) (*volume.VolumePluginMgr, *FakeVolumePlugin) {}

func GetTestKubeletVolumePluginMgrWithNodeAndRoot(t *testing.T, node *v1.Node, rootDir string) (*volume.VolumePluginMgr, *FakeVolumePlugin) {}

// CreateTestPVC returns a provisionable PVC for tests
func CreateTestPVC(capacity string, accessModes []v1.PersistentVolumeAccessMode) *v1.PersistentVolumeClaim {}

func MetricsEqualIgnoreTimestamp(a *volume.Metrics, b *volume.Metrics) bool {}

func ContainsAccessMode(modes []v1.PersistentVolumeAccessMode, mode v1.PersistentVolumeAccessMode) bool {}