Commit 954bbbc5 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys Committed by Han-Wen Nienhuys

fs: use testing.TempDir

Change-Id: Ia0d7293d14bb4fdac9be913ba6bd92b836636070
parent ba08cb01
......@@ -79,11 +79,7 @@ func TestForget(t *testing.T) {
EntryTimeout: &sec,
}
options.Debug = testutil.VerboseTest()
dir, err := ioutil.TempDir("", "TestForget")
if err != nil {
t.Fatal(err)
}
defer os.RemoveAll(dir)
dir := t.TempDir()
rawFS := NewNodeFS(root, options)
server, err := fuse.NewServer(rawFS, dir, &options.MountOptions)
......
......@@ -17,16 +17,8 @@ import (
)
func TestWindowsEmulations(t *testing.T) {
mntDir, err := ioutil.TempDir("", "ZipFS")
if err != nil {
t.Fatal(err)
}
defer os.RemoveAll(mntDir)
origDir, err := ioutil.TempDir("", "ZipFS")
if err != nil {
t.Fatal(err)
}
defer os.RemoveAll(origDir)
mntDir := t.TempDir()
origDir := t.TempDir()
rootData := &fs.LoopbackRoot{
NewNode: newWindowsNode,
......
......@@ -59,10 +59,7 @@ func TestZipFS(t *testing.T) {
}
root := &zipRoot{zr: r}
mntDir, err := ioutil.TempDir("", "ZipFS")
if err != nil {
t.Fatal(err)
}
mntDir := t.TempDir()
server, err := fs.Mount(mntDir, root, nil)
if err != nil {
t.Fatal(err)
......@@ -108,10 +105,7 @@ func TestZipFSOnAdd(t *testing.T) {
zr := &zipRoot{zr: r}
root := &fs.Inode{}
mnt, err := ioutil.TempDir("", "ZipFS")
if err != nil {
t.Fatal(err)
}
mnt := t.TempDir()
server, err := fs.Mount(mnt, root, &fs.Options{
OnAdd: func(ctx context.Context) {
root.AddChild("sub",
......
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