Renamed function

This commit is contained in:
Janario Oliveira 2019-09-17 07:30:10 +02:00
parent 439ce51441
commit 2ca213579d
2 changed files with 8 additions and 8 deletions

View File

@ -32,11 +32,11 @@ type FakeMounter struct {
MountCheckErrors map[string]error
// Some tests run things in parallel, make sure the mounter does not produce
// any golang's DATA RACE warnings.
mutex sync.Mutex
UmountFunc UmountFunc
mutex sync.Mutex
UnmountFunc UnmountFunc
}
type UmountFunc func(path string) error
type UnmountFunc func(path string) error
var _ Interface = &FakeMounter{}
@ -120,8 +120,8 @@ func (f *FakeMounter) Unmount(target string) error {
newMountpoints := []MountPoint{}
for _, mp := range f.MountPoints {
if mp.Path == absTarget {
if f.UmountFunc != nil {
err := f.UmountFunc(absTarget)
if f.UnmountFunc != nil {
err := f.UnmountFunc(absTarget)
if err != nil {
return err
}

View File

@ -409,7 +409,7 @@ func TestCleanSubPaths(t *testing.T) {
// Function that validates directory structure after the test
validate func(base string) error
expectError bool
umount func(path string) error
unmount func(path string) error
}{
{
name: "not-exists",
@ -557,7 +557,7 @@ func TestCleanSubPaths(t *testing.T) {
}
return mounts, nil
},
umount: func(mountpath string) error {
unmount: func(mountpath string) error {
err := filepath.Walk(mountpath, func(path string, info os.FileInfo, err error) error {
if path == mountpath {
// Skip top level directory
@ -593,7 +593,7 @@ func TestCleanSubPaths(t *testing.T) {
t.Fatalf("failed to prepare test %q: %v", test.name, err.Error())
}
fm := &mount.FakeMounter{MountPoints: mounts, UmountFunc: test.umount}
fm := &mount.FakeMounter{MountPoints: mounts, UnmountFunc: test.unmount}
err = doCleanSubPaths(fm, base, testVol)
if err != nil && !test.expectError {