Tmpdir can be a symlink, also fake mount needs to call nested mounter

parent 66590d6f
......@@ -86,7 +86,7 @@ func (mounter *Mounter) MakeRShared(path string) error {
}
func (mounter *SafeFormatAndMount) formatAndMount(source string, target string, fstype string, options []string) error {
return nil
return mounter.Interface.Mount(source, target, fstype, options)
}
func (mounter *SafeFormatAndMount) diskLooksUnformatted(disk string) (bool, error) {
......
......@@ -19,6 +19,7 @@ package rbd
import (
"fmt"
"os"
"path/filepath"
"reflect"
"strings"
"sync"
......@@ -149,7 +150,7 @@ func checkMounterLog(t *testing.T, fakeMounter *mount.FakeMounter, expected int,
lastIndex := len(fakeMounter.Log) - 1
lastAction := fakeMounter.Log[lastIndex]
if !reflect.DeepEqual(expectedAction, lastAction) {
t.Fatalf("fakeMounter.Log[%d] should be %v, not: %v", lastIndex, expectedAction, lastAction)
t.Fatalf("fakeMounter.Log[%d] should be %#v, not: %#v", lastIndex, expectedAction, lastAction)
}
}
......@@ -276,6 +277,10 @@ func TestPlugin(t *testing.T) {
t.Fatalf("error creating temp dir: %v", err)
}
defer os.RemoveAll(tmpDir)
tmpDir, err = filepath.EvalSymlinks(tmpDir)
if err != nil {
t.Fatal(err)
}
podUID := uuid.NewUUID()
var cases []*testcase
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment