Commit 8ad69801 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

fuse/test: close file before unmounting file system.

Change-Id: I99beacd150b49e062c6df2c16d52e73fce6ab111
parent 7b281480
...@@ -159,7 +159,9 @@ func setupFAttrTest(t *testing.T, fs pathfs.FileSystem) (dir string, clean func( ...@@ -159,7 +159,9 @@ func setupFAttrTest(t *testing.T, fs pathfs.FileSystem) (dir string, clean func(
} }
return dir, func() { return dir, func() {
if state.Unmount() == nil { if err := state.Unmount(); err != nil {
t.Errorf("cleanup: Unmount: %v", err)
} else {
os.RemoveAll(dir) os.RemoveAll(dir)
} }
} }
...@@ -261,6 +263,9 @@ func TestFSetAttr(t *testing.T) { ...@@ -261,6 +263,9 @@ func TestFSetAttr(t *testing.T) {
t.Error("Fsync failed:", os.NewSyscallError("Fsync", code)) t.Error("Fsync failed:", os.NewSyscallError("Fsync", code))
} }
// Close the file, otherwise we can't unmount.
f.Close()
// Shutdown the FUSE FS so we can safely look at fSetAttrFs // Shutdown the FUSE FS so we can safely look at fSetAttrFs
clean() clean()
clean = nil clean = nil
......
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