Documentation ¶
Index ¶
- type FakeLVM
- func (f *FakeLVM) Blkid(dev string) (string, error)
- func (f *FakeLVM) Check() error
- func (f *FakeLVM) CheckFilesystemTools(fstype string) error
- func (f *FakeLVM) CheckUnit(filename string, content string) (bool, error)
- func (f *FakeLVM) CreateLogicalVolume(group string, volume string, size *lowlevel.LvmSize) error
- func (f *FakeLVM) CreatePhysicalVolume(dev string) error
- func (f *FakeLVM) CreateVolumeGroup(vg string, devs []string) error
- func (*FakeLVM) EvalSymlinks(s string) (string, error)
- func (f *FakeLVM) ExtendVolumeGroup(vg string, dev string) error
- func (f *FakeLVM) Mkfs(dev string, fstype string) error
- func (f *FakeLVM) Mountpoint(path string) (bool, error)
- func (f *FakeLVM) QueryLogicalVolumes(vg string) (map[string]*lowlevel.LogicalVolume, error)
- func (f *FakeLVM) QueryPhysicalVolumes() (map[string]*lowlevel.PhysicalVolume, error)
- func (f *FakeLVM) QueryVolumeGroups() (map[string]*lowlevel.VolumeGroup, error)
- func (f *FakeLVM) ReduceVolumeGroup(vg string, dev string) error
- func (f *FakeLVM) RemovePhysicalVolume(dev string, force bool) error
- func (f *FakeLVM) StartUnit(unitname string) error
- func (f *FakeLVM) UpdateUnit(filename string, content string) error
- func (f *FakeLVM) WaitForDevice(path string) error
- type MockExecutor
- func (mex *MockExecutor) EvalSymlinks(s string) (string, error)
- func (mex *MockExecutor) Exists(path string) (bool, error)
- func (mex *MockExecutor) Getuid() int
- func (mex *MockExecutor) Lookup(prog string) error
- func (mex *MockExecutor) MkdirAll(path string, perm os.FileMode) error
- func (mex *MockExecutor) Read(prog string, args []string) (string, error)
- func (mex *MockExecutor) ReadFile(fn string) ([]byte, error)
- func (mex *MockExecutor) ReadWithExitCode(prog string, args []string) (string, int, error)
- func (mex *MockExecutor) Run(prog string, args []string) error
- func (mex *MockExecutor) RunWithExitCode(prog string, args []string) (int, error)
- func (mex *MockExecutor) WriteFile(fn string, content []byte, perm os.FileMode) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeLVM ¶
type FakeLVM struct { mock.Mock LvsOutput map[string]*lowlevel.LogicalVolume }
FakeLVM is mock object implementing lowlevel.LVM
func MakeFakeLvm ¶
MakeFakeLvm create fake LVM for test injections
func MakeFakeLvmEmpty ¶
MakeFakeLvmEmpty create fake LVM for test injections This one created empty
func MakeFakeLvmNonEmpty ¶
MakeFakeLvmNonEmpty create fake LVM for test injections This one created non-empty, it have group `vg`, consisting of two devices -- /dev/sdc1 and /dev/sdd1
func (*FakeLVM) CheckFilesystemTools ¶
CheckFilesystemTools is mock for LVM.CheckFilesystemTools()
func (*FakeLVM) CreateLogicalVolume ¶
CreateLogicalVolume is mock for LVM.CreateLogicalVolume()
func (*FakeLVM) CreatePhysicalVolume ¶
CreatePhysicalVolume is mock for LVM.CreatePhysicalVolume()
func (*FakeLVM) CreateVolumeGroup ¶
CreateVolumeGroup is mock for LVM.CreateVolumeGroup()
func (*FakeLVM) EvalSymlinks ¶
EvalSymlinks mocks symlink evaluation
func (*FakeLVM) ExtendVolumeGroup ¶
ExtendVolumeGroup is mock for LVM.ExtendVolumeGroup()
func (*FakeLVM) Mountpoint ¶
Mountpoint is mock for LVM.Mountpoint()
func (*FakeLVM) QueryLogicalVolumes ¶
QueryLogicalVolumes is mock for LVM.QueryLogicalVolumes
func (*FakeLVM) QueryPhysicalVolumes ¶
func (f *FakeLVM) QueryPhysicalVolumes() (map[string]*lowlevel.PhysicalVolume, error)
QueryPhysicalVolumes is mock for LVM.QueryPhysicalVolumes()
func (*FakeLVM) QueryVolumeGroups ¶
func (f *FakeLVM) QueryVolumeGroups() (map[string]*lowlevel.VolumeGroup, error)
QueryVolumeGroups is mock for LVM.QueryVolumeGroups()
func (*FakeLVM) ReduceVolumeGroup ¶
ReduceVolumeGroup is mock for LVM.ReduceVolumeGroup()
func (*FakeLVM) RemovePhysicalVolume ¶
RemovePhysicalVolume is mock for LVM.RemovePhysicalVolume()
func (*FakeLVM) UpdateUnit ¶
UpdateUnit is mock for LVM.UpdateUnit()
func (*FakeLVM) WaitForDevice ¶
WaitForDevice is mock for LVM.WaitForDevice()
type MockExecutor ¶
type MockExecutor struct { mock.Mock // NB: need more proper injection for `lvs` executing, return different output on different calls // Related issue: https://github.com/asteris-llc/converge/issues/456 LvsFirstCall bool // ugly hack }
MockExecutor is a lowlevel.Exec impleentation for faking system interoperation
func MakeLvmWithMockExec ¶
func MakeLvmWithMockExec() (lowlevel.LVM, *MockExecutor)
MakeLvmWithMockExec creates LVM backed with MockExecutor
func (*MockExecutor) EvalSymlinks ¶
func (mex *MockExecutor) EvalSymlinks(s string) (string, error)
EvalSymlinks mocks symlink evaluation
func (*MockExecutor) Exists ¶
func (mex *MockExecutor) Exists(path string) (bool, error)
Exists is mock for Exec.Exists()
func (*MockExecutor) Lookup ¶
func (mex *MockExecutor) Lookup(prog string) error
Lookup is mock for Exec.Lookup()
func (*MockExecutor) MkdirAll ¶
func (mex *MockExecutor) MkdirAll(path string, perm os.FileMode) error
MkdirAll is mock for Exec.MkdirAll()
func (*MockExecutor) Read ¶
func (mex *MockExecutor) Read(prog string, args []string) (string, error)
Read is mock for Exec.Read()
func (*MockExecutor) ReadFile ¶
func (mex *MockExecutor) ReadFile(fn string) ([]byte, error)
ReadFile is mock for Exec.ReadFile()
func (*MockExecutor) ReadWithExitCode ¶
ReadWithExitCode is mock for Exec.ReadWithExitCode()
func (*MockExecutor) Run ¶
func (mex *MockExecutor) Run(prog string, args []string) error
Run is mock for Exec.Run()
func (*MockExecutor) RunWithExitCode ¶
func (mex *MockExecutor) RunWithExitCode(prog string, args []string) (int, error)
RunWithExitCode is mock for Exec.RunWithExitCode()