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

This commit is contained in:
Clayton Coleman
2017-11-03 22:20:58 -04:00
parent 66590d6f83
commit b844ac44f5
2 changed files with 7 additions and 2 deletions

View File

@@ -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