diff --git a/fs/simple_test.go b/fs/simple_test.go index d48d315ed..909b495f3 100644 --- a/fs/simple_test.go +++ b/fs/simple_test.go @@ -22,6 +22,7 @@ import ( "testing" "time" + "github.com/google/uuid" "github.com/hanwen/go-fuse/v2/fuse" "github.com/hanwen/go-fuse/v2/internal/testutil" "github.com/hanwen/go-fuse/v2/posixtest" @@ -76,6 +77,11 @@ func newTestCase(t *testing.T, opts *testOptions) *testCase { dir: opts.testDir, T: t, } + uid, _ := uuid.NewUUID() + tc.dir = filepath.Join(tc.dir, uid.String()) + if err := os.Mkdir(tc.dir, 0755); err != nil { + t.Fatal(err) + } tc.origDir = tc.dir + "/orig" tc.mntDir = tc.dir + "/mnt" if err := os.Mkdir(tc.origDir, 0755); err != nil { diff --git a/fuse/test/loopback_test.go b/fuse/test/loopback_test.go index e9d5216aa..ffba64416 100644 --- a/fuse/test/loopback_test.go +++ b/fuse/test/loopback_test.go @@ -18,6 +18,7 @@ import ( "testing" "time" + "github.com/google/uuid" "github.com/hanwen/go-fuse/v2/fuse" "github.com/hanwen/go-fuse/v2/fuse/nodefs" "github.com/hanwen/go-fuse/v2/fuse/pathfs" @@ -75,9 +76,13 @@ func NewTestCase(t *testing.T) *testCase { const name string = "hello.txt" const subdir string = "subdir" + uid, _ := uuid.NewUUID() var err error - tc.tmpDir = t.TempDir() + tc.tmpDir = filepath.Join(t.TempDir(), uid.String()) + if err := os.Mkdir(tc.tmpDir, 0755); err != nil { + t.Fatal(err) + } tc.orig = tc.tmpDir + "/orig" tc.mnt = tc.tmpDir + "/mnt" diff --git a/go.mod b/go.mod index aab8793a8..5fcdb355a 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,7 @@ module github.com/hanwen/go-fuse/v2 require ( + github.com/google/uuid v1.6.0 github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 github.com/moby/sys/mountinfo v0.6.2 golang.org/x/sync v0.0.0-20201207232520-09787c993a3a diff --git a/go.sum b/go.sum index 58ee319b2..534ad54a6 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,5 @@ +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 h1:MtvEpTB6LX3vkb4ax0b5D2DHbNAUsen0Gx5wZoq3lV4= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/moby/sys/mountinfo v0.6.2 h1:BzJjoreD5BMFNmD9Rus6gdd1pLuecOFPt8wC+Vygl78=