Commit c08cc6cf authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Fix tests.

parent f52a93f2
...@@ -71,7 +71,7 @@ func NewStatFs() *StatFs { ...@@ -71,7 +71,7 @@ func NewStatFs() *StatFs {
} }
func setupFs(fs fuse.FileSystem, opts *fuse.FileSystemOptions) (string, func()) { func setupFs(fs fuse.FileSystem, opts *fuse.FileSystemOptions) (string, func()) {
mountPoint := fuse.MakeTempDir() mountPoint, _ := ioutil.TempDir("", "stat_test")
state, _, err := fuse.MountPathFileSystem(mountPoint, fs, opts) state, _, err := fuse.MountPathFileSystem(mountPoint, fs, opts)
if err != nil { if err != nil {
panic(fmt.Sprintf("cannot mount %v", err)) // ugh - benchmark has no error methods. panic(fmt.Sprintf("cannot mount %v", err)) // ugh - benchmark has no error methods.
...@@ -236,7 +236,7 @@ func BenchmarkCFuseThreadedStat(b *testing.B) { ...@@ -236,7 +236,7 @@ func BenchmarkCFuseThreadedStat(b *testing.B) {
f.Close() f.Close()
log.Println("Written:", f.Name()) log.Println("Written:", f.Name())
mountPoint := fuse.MakeTempDir() mountPoint, _ := ioutil.TempDir("", "stat_test")
wd, _ := os.Getwd() wd, _ := os.Getwd()
cmd := exec.Command(wd+"/cstatfs", mountPoint) cmd := exec.Command(wd+"/cstatfs", mountPoint)
cmd.Env = append(os.Environ(), fmt.Sprintf("STATFS_INPUT=%s", f.Name())) cmd.Env = append(os.Environ(), fmt.Sprintf("STATFS_INPUT=%s", f.Name()))
......
...@@ -3,6 +3,7 @@ package fuse ...@@ -3,6 +3,7 @@ package fuse
import ( import (
"testing" "testing"
"io/ioutil" "io/ioutil"
"os"
) )
func TestCopyFile(t *testing.T) { func TestCopyFile(t *testing.T) {
......
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