Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go-fuse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Levin Zimmermann
go-fuse
Commits
830461e3
Commit
830461e3
authored
Sep 15, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop fuse.MakeTempDir()
parent
ce03e525
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
34 additions
and
30 deletions
+34
-30
fuse/cache_test.go
fuse/cache_test.go
+4
-2
fuse/copy_test.go
fuse/copy_test.go
+5
-3
fuse/fsetattr_test.go
fuse/fsetattr_test.go
+3
-1
fuse/loopback_test.go
fuse/loopback_test.go
+6
-3
fuse/misc.go
fuse/misc.go
+0
-10
fuse/notify_test.go
fuse/notify_test.go
+4
-2
fuse/owner_test.go
fuse/owner_test.go
+2
-1
fuse/xattr_test.go
fuse/xattr_test.go
+3
-1
unionfs/autounion_test.go
unionfs/autounion_test.go
+1
-1
unionfs/cachingfs_test.go
unionfs/cachingfs_test.go
+2
-1
unionfs/unionfs_test.go
unionfs/unionfs_test.go
+2
-2
zipfs/multizip_test.go
zipfs/multizip_test.go
+1
-1
zipfs/zipfs_test.go
zipfs/zipfs_test.go
+1
-2
No files found.
fuse/cache_test.go
View file @
830461e3
...
@@ -27,7 +27,8 @@ func (me *cacheFs) Open(name string, flags uint32, context *Context) (fuseFile F
...
@@ -27,7 +27,8 @@ func (me *cacheFs) Open(name string, flags uint32, context *Context) (fuseFile F
}
}
func
setupCacheTest
()
(
string
,
*
PathNodeFs
,
func
())
{
func
setupCacheTest
()
(
string
,
*
PathNodeFs
,
func
())
{
dir
:=
MakeTempDir
()
dir
,
err
:=
ioutil
.
TempDir
(
""
,
"go-fuse"
)
CheckSuccess
(
err
)
os
.
Mkdir
(
dir
+
"/mnt"
,
0755
)
os
.
Mkdir
(
dir
+
"/mnt"
,
0755
)
os
.
Mkdir
(
dir
+
"/orig"
,
0755
)
os
.
Mkdir
(
dir
+
"/orig"
,
0755
)
...
@@ -117,7 +118,8 @@ func TestNonseekable(t *testing.T) {
...
@@ -117,7 +118,8 @@ func TestNonseekable(t *testing.T) {
fs
:=
&
nonseekFs
{}
fs
:=
&
nonseekFs
{}
fs
.
Length
=
200
*
1024
fs
.
Length
=
200
*
1024
dir
:=
MakeTempDir
()
dir
,
err
:=
ioutil
.
TempDir
(
""
,
"go-fuse"
)
CheckSuccess
(
err
)
defer
os
.
RemoveAll
(
dir
)
defer
os
.
RemoveAll
(
dir
)
state
,
_
,
err
:=
MountPathFileSystem
(
dir
,
fs
,
nil
)
state
,
_
,
err
:=
MountPathFileSystem
(
dir
,
fs
,
nil
)
CheckSuccess
(
err
)
CheckSuccess
(
err
)
...
...
fuse/copy_test.go
View file @
830461e3
...
@@ -6,15 +6,17 @@ import (
...
@@ -6,15 +6,17 @@ import (
)
)
func
TestCopyFile
(
t
*
testing
.
T
)
{
func
TestCopyFile
(
t
*
testing
.
T
)
{
d1
:=
MakeTempDir
()
d1
,
err
:=
ioutil
.
TempDir
(
""
,
"go-fuse"
)
d2
:=
MakeTempDir
()
CheckSuccess
(
err
)
d2
,
err
:=
ioutil
.
TempDir
(
""
,
"go-fuse"
)
CheckSuccess
(
err
)
fs1
:=
NewLoopbackFileSystem
(
d1
)
fs1
:=
NewLoopbackFileSystem
(
d1
)
fs2
:=
NewLoopbackFileSystem
(
d2
)
fs2
:=
NewLoopbackFileSystem
(
d2
)
content1
:=
"blabla"
content1
:=
"blabla"
err
:
=
ioutil
.
WriteFile
(
d1
+
"/file"
,
[]
byte
(
content1
),
0644
)
err
=
ioutil
.
WriteFile
(
d1
+
"/file"
,
[]
byte
(
content1
),
0644
)
CheckSuccess
(
err
)
CheckSuccess
(
err
)
code
:=
CopyFile
(
fs1
,
fs2
,
"file"
,
"file"
,
nil
)
code
:=
CopyFile
(
fs1
,
fs2
,
"file"
,
"file"
,
nil
)
...
...
fuse/fsetattr_test.go
View file @
830461e3
...
@@ -2,6 +2,7 @@ package fuse
...
@@ -2,6 +2,7 @@ package fuse
import
(
import
(
"fmt"
"fmt"
"io/ioutil"
"log"
"log"
"os"
"os"
"syscall"
"syscall"
...
@@ -121,7 +122,8 @@ func NewFile() *MutableDataFile {
...
@@ -121,7 +122,8 @@ func NewFile() *MutableDataFile {
}
}
func
setupFAttrTest
(
fs
FileSystem
)
(
dir
string
,
clean
func
())
{
func
setupFAttrTest
(
fs
FileSystem
)
(
dir
string
,
clean
func
())
{
dir
=
MakeTempDir
()
dir
,
err
:=
ioutil
.
TempDir
(
""
,
"go-fuse"
)
CheckSuccess
(
err
)
state
,
_
,
err
:=
MountPathFileSystem
(
dir
,
fs
,
nil
)
state
,
_
,
err
:=
MountPathFileSystem
(
dir
,
fs
,
nil
)
CheckSuccess
(
err
)
CheckSuccess
(
err
)
state
.
Debug
=
true
state
.
Debug
=
true
...
...
fuse/loopback_test.go
View file @
830461e3
...
@@ -52,7 +52,9 @@ func NewTestCase(t *testing.T) *testCase {
...
@@ -52,7 +52,9 @@ func NewTestCase(t *testing.T) *testCase {
const
name
string
=
"hello.txt"
const
name
string
=
"hello.txt"
const
subdir
string
=
"subdir"
const
subdir
string
=
"subdir"
me
.
tmpDir
=
MakeTempDir
()
var
err
os
.
Error
me
.
tmpDir
,
err
=
ioutil
.
TempDir
(
""
,
"go-fuse"
)
CheckSuccess
(
err
)
me
.
orig
=
me
.
tmpDir
+
"/orig"
me
.
orig
=
me
.
tmpDir
+
"/orig"
me
.
mnt
=
me
.
tmpDir
+
"/mnt"
me
.
mnt
=
me
.
tmpDir
+
"/mnt"
...
@@ -689,10 +691,11 @@ func TestStatFs(t *testing.T) {
...
@@ -689,10 +691,11 @@ func TestStatFs(t *testing.T) {
}
}
func
TestOriginalIsSymlink
(
t
*
testing
.
T
)
{
func
TestOriginalIsSymlink
(
t
*
testing
.
T
)
{
tmpDir
:=
MakeTempDir
()
tmpDir
,
err
:=
ioutil
.
TempDir
(
""
,
"go-fuse"
)
CheckSuccess
(
err
)
defer
os
.
RemoveAll
(
tmpDir
)
defer
os
.
RemoveAll
(
tmpDir
)
orig
:=
tmpDir
+
"/orig"
orig
:=
tmpDir
+
"/orig"
err
:
=
os
.
Mkdir
(
orig
,
0755
)
err
=
os
.
Mkdir
(
orig
,
0755
)
CheckSuccess
(
err
)
CheckSuccess
(
err
)
link
:=
tmpDir
+
"/link"
link
:=
tmpDir
+
"/link"
mnt
:=
tmpDir
+
"/mnt"
mnt
:=
tmpDir
+
"/mnt"
...
...
fuse/misc.go
View file @
830461e3
...
@@ -11,7 +11,6 @@ import (
...
@@ -11,7 +11,6 @@ import (
"strings"
"strings"
"syscall"
"syscall"
"unsafe"
"unsafe"
"io/ioutil"
)
)
func
(
code
Status
)
String
()
string
{
func
(
code
Status
)
String
()
string
{
...
@@ -30,15 +29,6 @@ func (code Status) Ok() bool {
...
@@ -30,15 +29,6 @@ func (code Status) Ok() bool {
return
code
==
OK
return
code
==
OK
}
}
// Make a temporary directory securely.
func
MakeTempDir
()
string
{
nm
,
err
:=
ioutil
.
TempDir
(
""
,
"go-fuse"
)
if
err
!=
nil
{
panic
(
"TempDir() failed: "
+
err
.
String
())
}
return
nm
}
// Convert os.Error back to Errno based errors.
// Convert os.Error back to Errno based errors.
func
OsErrorToErrno
(
err
os
.
Error
)
Status
{
func
OsErrorToErrno
(
err
os
.
Error
)
Status
{
if
err
!=
nil
{
if
err
!=
nil
{
...
...
fuse/notify_test.go
View file @
830461e3
package
fuse
package
fuse
import
(
import
(
"io/ioutil"
"log"
"log"
"os"
"os"
"testing"
"testing"
...
@@ -42,7 +43,9 @@ type NotifyTest struct {
...
@@ -42,7 +43,9 @@ type NotifyTest struct {
func
NewNotifyTest
()
*
NotifyTest
{
func
NewNotifyTest
()
*
NotifyTest
{
me
:=
&
NotifyTest
{}
me
:=
&
NotifyTest
{}
me
.
fs
=
&
NotifyFs
{}
me
.
fs
=
&
NotifyFs
{}
me
.
dir
=
MakeTempDir
()
var
err
os
.
Error
me
.
dir
,
err
=
ioutil
.
TempDir
(
""
,
"go-fuse"
)
CheckSuccess
(
err
)
entryTtl
:=
0.1
entryTtl
:=
0.1
opts
:=
&
FileSystemOptions
{
opts
:=
&
FileSystemOptions
{
EntryTimeout
:
entryTtl
,
EntryTimeout
:
entryTtl
,
...
@@ -50,7 +53,6 @@ func NewNotifyTest() *NotifyTest {
...
@@ -50,7 +53,6 @@ func NewNotifyTest() *NotifyTest {
NegativeTimeout
:
entryTtl
,
NegativeTimeout
:
entryTtl
,
}
}
var
err
os
.
Error
me
.
pathfs
=
NewPathNodeFs
(
me
.
fs
)
me
.
pathfs
=
NewPathNodeFs
(
me
.
fs
)
me
.
state
,
me
.
connector
,
err
=
MountNodeFileSystem
(
me
.
dir
,
me
.
pathfs
,
opts
)
me
.
state
,
me
.
connector
,
err
=
MountNodeFileSystem
(
me
.
dir
,
me
.
pathfs
,
opts
)
CheckSuccess
(
err
)
CheckSuccess
(
err
)
...
...
fuse/owner_test.go
View file @
830461e3
package
fuse
package
fuse
import
(
import
(
"io/ioutil"
"os"
"os"
"testing"
"testing"
)
)
...
@@ -25,7 +26,7 @@ func (me *ownerFs) GetAttr(name string, context *Context) (*os.FileInfo, Status)
...
@@ -25,7 +26,7 @@ func (me *ownerFs) GetAttr(name string, context *Context) (*os.FileInfo, Status)
}
}
func
setupOwnerTest
(
opts
*
FileSystemOptions
)
(
workdir
string
,
cleanup
func
())
{
func
setupOwnerTest
(
opts
*
FileSystemOptions
)
(
workdir
string
,
cleanup
func
())
{
wd
:=
MakeTempDir
(
)
wd
,
err
:=
ioutil
.
TempDir
(
""
,
"go-fuse"
)
fs
:=
&
ownerFs
{}
fs
:=
&
ownerFs
{}
state
,
_
,
err
:=
MountPathFileSystem
(
wd
,
fs
,
opts
)
state
,
_
,
err
:=
MountPathFileSystem
(
wd
,
fs
,
opts
)
...
...
fuse/xattr_test.go
View file @
830461e3
...
@@ -2,6 +2,7 @@ package fuse
...
@@ -2,6 +2,7 @@ package fuse
import
(
import
(
"bytes"
"bytes"
"io/ioutil"
"testing"
"testing"
"log"
"log"
"path/filepath"
"path/filepath"
...
@@ -91,7 +92,8 @@ func TestXAttrRead(t *testing.T) {
...
@@ -91,7 +92,8 @@ func TestXAttrRead(t *testing.T) {
"user.attr1"
:
[]
byte
(
"val1"
),
"user.attr1"
:
[]
byte
(
"val1"
),
"user.attr2"
:
[]
byte
(
"val2"
)}
"user.attr2"
:
[]
byte
(
"val2"
)}
xfs
:=
NewXAttrFs
(
nm
,
golden
)
xfs
:=
NewXAttrFs
(
nm
,
golden
)
mountPoint
:=
MakeTempDir
()
mountPoint
,
err
:=
ioutil
.
TempDir
(
""
,
"go-fuse"
)
CheckSuccess
(
err
)
defer
os
.
RemoveAll
(
mountPoint
)
defer
os
.
RemoveAll
(
mountPoint
)
state
,
_
,
err
:=
MountPathFileSystem
(
mountPoint
,
xfs
,
nil
)
state
,
_
,
err
:=
MountPathFileSystem
(
mountPoint
,
xfs
,
nil
)
...
...
unionfs/autounion_test.go
View file @
830461e3
...
@@ -29,7 +29,7 @@ func WriteFile(name string, contents string) {
...
@@ -29,7 +29,7 @@ func WriteFile(name string, contents string) {
}
}
func
setup
(
t
*
testing
.
T
)
(
workdir
string
,
cleanup
func
())
{
func
setup
(
t
*
testing
.
T
)
(
workdir
string
,
cleanup
func
())
{
wd
:=
fuse
.
MakeTempDir
(
)
wd
,
_
:=
ioutil
.
TempDir
(
""
,
""
)
err
:=
os
.
Mkdir
(
wd
+
"/mount"
,
0700
)
err
:=
os
.
Mkdir
(
wd
+
"/mount"
,
0700
)
fuse
.
CheckSuccess
(
err
)
fuse
.
CheckSuccess
(
err
)
...
...
unionfs/cachingfs_test.go
View file @
830461e3
...
@@ -3,6 +3,7 @@ package unionfs
...
@@ -3,6 +3,7 @@ package unionfs
import
(
import
(
"os"
"os"
"github.com/hanwen/go-fuse/fuse"
"github.com/hanwen/go-fuse/fuse"
"io/ioutil"
"fmt"
"fmt"
"log"
"log"
"syscall"
"syscall"
...
@@ -27,7 +28,7 @@ func modeMapEq(m1, m2 map[string]uint32) bool {
...
@@ -27,7 +28,7 @@ func modeMapEq(m1, m2 map[string]uint32) bool {
}
}
func
TestCachingFs
(
t
*
testing
.
T
)
{
func
TestCachingFs
(
t
*
testing
.
T
)
{
wd
:=
fuse
.
MakeTempDir
(
)
wd
,
_
:=
ioutil
.
TempDir
(
""
,
""
)
defer
os
.
RemoveAll
(
wd
)
defer
os
.
RemoveAll
(
wd
)
fs
:=
fuse
.
NewLoopbackFileSystem
(
wd
)
fs
:=
fuse
.
NewLoopbackFileSystem
(
wd
)
...
...
unionfs/unionfs_test.go
View file @
830461e3
...
@@ -30,7 +30,7 @@ var testOpts = UnionFsOptions{
...
@@ -30,7 +30,7 @@ var testOpts = UnionFsOptions{
}
}
func
setupUfs
(
t
*
testing
.
T
)
(
workdir
string
,
cleanup
func
())
{
func
setupUfs
(
t
*
testing
.
T
)
(
workdir
string
,
cleanup
func
())
{
wd
:=
fuse
.
MakeTempDir
(
)
wd
,
_
:=
ioutil
.
TempDir
(
""
,
""
)
err
:=
os
.
Mkdir
(
wd
+
"/mount"
,
0700
)
err
:=
os
.
Mkdir
(
wd
+
"/mount"
,
0700
)
fuse
.
CheckSuccess
(
err
)
fuse
.
CheckSuccess
(
err
)
...
@@ -843,7 +843,7 @@ func TestDropCache(t *testing.T) {
...
@@ -843,7 +843,7 @@ func TestDropCache(t *testing.T) {
func
TestDisappearing
(
t
*
testing
.
T
)
{
func
TestDisappearing
(
t
*
testing
.
T
)
{
// This init is like setupUfs, but we want access to the
// This init is like setupUfs, but we want access to the
// writable Fs.
// writable Fs.
wd
:=
fuse
.
MakeTempDir
(
)
wd
,
_
:=
ioutil
.
TempDir
(
""
,
""
)
defer
os
.
RemoveAll
(
wd
)
defer
os
.
RemoveAll
(
wd
)
err
:=
os
.
Mkdir
(
wd
+
"/mount"
,
0700
)
err
:=
os
.
Mkdir
(
wd
+
"/mount"
,
0700
)
fuse
.
CheckSuccess
(
err
)
fuse
.
CheckSuccess
(
err
)
...
...
zipfs/multizip_test.go
View file @
830461e3
...
@@ -15,7 +15,7 @@ const testTtl = 0.1
...
@@ -15,7 +15,7 @@ const testTtl = 0.1
func
setupMzfs
()
(
mountPoint
string
,
cleanup
func
())
{
func
setupMzfs
()
(
mountPoint
string
,
cleanup
func
())
{
fs
:=
NewMultiZipFs
()
fs
:=
NewMultiZipFs
()
mountPoint
=
fuse
.
MakeTempDir
(
)
mountPoint
,
_
=
ioutil
.
TempDir
(
""
,
""
)
state
,
_
,
err
:=
fuse
.
MountPathFileSystem
(
mountPoint
,
fs
,
&
fuse
.
FileSystemOptions
{
state
,
_
,
err
:=
fuse
.
MountPathFileSystem
(
mountPoint
,
fs
,
&
fuse
.
FileSystemOptions
{
EntryTimeout
:
testTtl
,
EntryTimeout
:
testTtl
,
AttrTimeout
:
testTtl
,
AttrTimeout
:
testTtl
,
...
...
zipfs/zipfs_test.go
View file @
830461e3
...
@@ -22,8 +22,7 @@ func setupZipfs() (mountPoint string, cleanup func()) {
...
@@ -22,8 +22,7 @@ func setupZipfs() (mountPoint string, cleanup func()) {
zfs
,
err
:=
NewArchiveFileSystem
(
testZipFile
())
zfs
,
err
:=
NewArchiveFileSystem
(
testZipFile
())
CheckSuccess
(
err
)
CheckSuccess
(
err
)
mountPoint
=
fuse
.
MakeTempDir
()
mountPoint
,
_
=
ioutil
.
TempDir
(
""
,
""
)
state
,
_
,
err
:=
fuse
.
MountNodeFileSystem
(
mountPoint
,
zfs
,
nil
)
state
,
_
,
err
:=
fuse
.
MountNodeFileSystem
(
mountPoint
,
zfs
,
nil
)
state
.
Debug
=
true
state
.
Debug
=
true
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment