mountmanager

package
v0.0.0-...-f34f863 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCustomFakeSafeMounter

func NewCustomFakeSafeMounter(mounter mount.Interface, exec exec.Interface) *mount.SafeFormatAndMount

func NewDeviceUtils

func NewDeviceUtils() *deviceUtils

func NewFakeDeviceUtils

func NewFakeDeviceUtils() *fakeDeviceUtils

func NewFakeSafeBlockingMounter

func NewFakeSafeBlockingMounter(readyToExecute chan chan struct{}) *mount.SafeFormatAndMount

func NewFakeSafeMounter

func NewFakeSafeMounter() *mount.SafeFormatAndMount

func NewFakeSafeMounterWithCustomExec

func NewFakeSafeMounterWithCustomExec(exec exec.Interface) *mount.SafeFormatAndMount

func NewFakeStatter

func NewFakeStatter(mounter *mount.SafeFormatAndMount) *fakeStatter

func NewSafeMounter

func NewSafeMounter() (*mount.SafeFormatAndMount, error)

func NewStatter

func NewStatter(mounter *mount.SafeFormatAndMount) *realStatter

Types

type DeviceUtils

type DeviceUtils interface {
	// VerifyDevicePath returns the first of the list of device paths that
	// exists on the machine, or an empty string if none exists
	VerifyDevicePath(devicePath string, deviceName string) (bool, error)
}

DeviceUtils are a collection of methods that act on the devices attached to a GCE Instance

type FakeBlockingMounter

type FakeBlockingMounter struct {
	*mount.FakeMounter
	ReadyToExecute chan chan struct{}
}

func (*FakeBlockingMounter) Mount

func (mounter *FakeBlockingMounter) Mount(source string, target string, fstype string, options []string) error

Mount is overridden and adds functionality to finely control the order of execution of FakeMounter's Mount calls. Upon starting a Mount, it passes a chan 'executeMount' into readyToExecute, then blocks on executeMount. The test calling this function can block on readyToExecute to ensure that the operation has started and allowed the Mount to continue by passing a struct into executeMount.

type Statter

type Statter interface {
	StatFS(path string) (int64, int64, int64, int64, int64, int64, error)
	IsBlockDevice(string) (bool, error)
}

Jump to

Keyboard shortcuts

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