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
882312bf
Commit
882312bf
authored
Apr 06, 2019
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nodefs: skip tests if kernel doesn't support lseek/copy_file_range
parent
71c48e77
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
21 additions
and
14 deletions
+21
-14
fuse/opcode.go
fuse/opcode.go
+2
-2
nodefs/cache_test.go
nodefs/cache_test.go
+1
-1
nodefs/directio_test.go
nodefs/directio_test.go
+4
-1
nodefs/interrupt_test.go
nodefs/interrupt_test.go
+1
-1
nodefs/loopback_linux_test.go
nodefs/loopback_linux_test.go
+4
-0
nodefs/mem_test.go
nodefs/mem_test.go
+5
-5
nodefs/readonly_test.go
nodefs/readonly_test.go
+2
-2
nodefs/zip_test.go
nodefs/zip_test.go
+2
-2
No files found.
fuse/opcode.go
View file @
882312bf
...
...
@@ -58,8 +58,8 @@ const (
_OP_FALLOCATE
=
uint32
(
43
)
// protocol version 19.
_OP_READDIRPLUS
=
uint32
(
44
)
// protocol version 21.
_OP_RENAME2
=
uint32
(
45
)
// protocol version 23.
_OP_LSEEK
=
uint32
(
46
)
_OP_COPY_FILE_RANGE
=
uint32
(
47
)
_OP_LSEEK
=
uint32
(
46
)
// protocol version 24
_OP_COPY_FILE_RANGE
=
uint32
(
47
)
// protocol version 28.
// The following entries don't have to be compatible across Go-FUSE versions.
_OP_NOTIFY_INVAL_ENTRY
=
uint32
(
100
)
...
...
nodefs/cache_test.go
View file @
882312bf
...
...
@@ -92,7 +92,7 @@ func (r *keepCacheRoot) OnAdd(ctx context.Context) {
// change content but no metadata.
func
TestKeepCache
(
t
*
testing
.
T
)
{
root
:=
&
keepCacheRoot
{}
mntDir
,
clean
:=
testMount
(
t
,
root
,
nil
)
mntDir
,
_
,
clean
:=
testMount
(
t
,
root
,
nil
)
defer
clean
()
c1
,
err
:=
ioutil
.
ReadFile
(
mntDir
+
"/keep"
)
if
err
!=
nil
{
...
...
nodefs/directio_test.go
View file @
882312bf
...
...
@@ -54,7 +54,7 @@ func (f *dioFile) Open(ctx context.Context, flags uint32) (fh FileHandle, fuseFl
func
TestDirectIO
(
t
*
testing
.
T
)
{
root
:=
&
dioRoot
{}
mntDir
,
clean
:=
testMount
(
t
,
root
,
nil
)
mntDir
,
server
,
clean
:=
testMount
(
t
,
root
,
nil
)
defer
clean
()
f
,
err
:=
os
.
Open
(
mntDir
+
"/file"
)
...
...
@@ -74,6 +74,9 @@ func TestDirectIO(t *testing.T) {
t
.
Errorf
(
"got %q want %q"
,
got
,
want
)
}
if
!
server
.
KernelSettings
()
.
SupportsVersion
(
7
,
24
)
{
t
.
Skip
(
"Kernel does not support lseek"
)
}
if
n
,
err
:=
syscall
.
Seek
(
int
(
f
.
Fd
()),
512
,
_SEEK_DATA
);
err
!=
nil
{
t
.
Errorf
(
"Seek: %v"
,
err
)
}
else
if
n
!=
1024
{
...
...
nodefs/interrupt_test.go
View file @
882312bf
...
...
@@ -55,7 +55,7 @@ func TestInterrupt(t *testing.T) {
root
:=
&
interruptRoot
{}
oneSec
:=
time
.
Second
mntDir
,
clean
:=
testMount
(
t
,
root
,
&
Options
{
mntDir
,
_
,
clean
:=
testMount
(
t
,
root
,
&
Options
{
EntryTimeout
:
&
oneSec
,
AttrTimeout
:
&
oneSec
,
})
...
...
nodefs/loopback_linux_test.go
View file @
882312bf
...
...
@@ -140,6 +140,10 @@ func TestCopyFileRange(t *testing.T) {
tc
:=
newTestCase
(
t
,
true
,
true
)
defer
tc
.
Clean
()
if
!
tc
.
server
.
KernelSettings
()
.
SupportsVersion
(
7
,
28
)
{
t
.
Skip
(
"need v7.28 for CopyFileRange"
)
}
tc
.
writeOrig
(
"src"
,
"01234567890123456789"
,
0644
)
tc
.
writeOrig
(
"dst"
,
"abcdefghijabcdefghij"
,
0644
)
...
...
nodefs/mem_test.go
View file @
882312bf
...
...
@@ -17,7 +17,7 @@ import (
"github.com/hanwen/go-fuse/internal/testutil"
)
func
testMount
(
t
*
testing
.
T
,
root
InodeEmbedder
,
opts
*
Options
)
(
string
,
func
())
{
func
testMount
(
t
*
testing
.
T
,
root
InodeEmbedder
,
opts
*
Options
)
(
string
,
*
fuse
.
Server
,
func
())
{
t
.
Helper
()
mntDir
:=
testutil
.
TempDir
()
...
...
@@ -32,7 +32,7 @@ func testMount(t *testing.T, root InodeEmbedder, opts *Options) (string, func())
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
return
mntDir
,
func
()
{
return
mntDir
,
server
,
func
()
{
server
.
Unmount
()
os
.
Remove
(
mntDir
)
}
...
...
@@ -41,7 +41,7 @@ func testMount(t *testing.T, root InodeEmbedder, opts *Options) (string, func())
func
TestDataFile
(
t
*
testing
.
T
)
{
want
:=
"hello"
root
:=
&
Inode
{}
mntDir
,
clean
:=
testMount
(
t
,
root
,
&
Options
{
mntDir
,
_
,
clean
:=
testMount
(
t
,
root
,
&
Options
{
FirstAutomaticIno
:
1
,
OnAdd
:
func
(
ctx
context
.
Context
)
{
n
:=
root
.
EmbeddedInode
()
...
...
@@ -94,7 +94,7 @@ func TestDataFileLargeRead(t *testing.T) {
data
:=
make
([]
byte
,
256
*
1024
)
rand
.
Read
(
data
[
:
])
mntDir
,
clean
:=
testMount
(
t
,
root
,
&
Options
{
mntDir
,
_
,
clean
:=
testMount
(
t
,
root
,
&
Options
{
FirstAutomaticIno
:
1
,
OnAdd
:
func
(
ctx
context
.
Context
)
{
n
:=
root
.
EmbeddedInode
()
...
...
@@ -137,7 +137,7 @@ func (s *SymlinkerRoot) Symlink(ctx context.Context, target, name string, out *f
func
TestDataSymlink
(
t
*
testing
.
T
)
{
root
:=
&
SymlinkerRoot
{}
mntDir
,
clean
:=
testMount
(
t
,
root
,
nil
)
mntDir
,
_
,
clean
:=
testMount
(
t
,
root
,
nil
)
defer
clean
()
if
err
:=
syscall
.
Symlink
(
"target"
,
mntDir
+
"/link"
);
err
!=
nil
{
...
...
nodefs/readonly_test.go
View file @
882312bf
...
...
@@ -16,7 +16,7 @@ import (
func
TestReadonlyCreate
(
t
*
testing
.
T
)
{
root
:=
&
Inode
{}
mntDir
,
clean
:=
testMount
(
t
,
root
,
nil
)
mntDir
,
_
,
clean
:=
testMount
(
t
,
root
,
nil
)
defer
clean
()
_
,
err
:=
syscall
.
Creat
(
mntDir
+
"/test"
,
0644
)
...
...
@@ -28,7 +28,7 @@ func TestReadonlyCreate(t *testing.T) {
func
TestDefaultPermissions
(
t
*
testing
.
T
)
{
root
:=
&
Inode
{}
mntDir
,
clean
:=
testMount
(
t
,
root
,
&
Options
{
mntDir
,
_
,
clean
:=
testMount
(
t
,
root
,
&
Options
{
DefaultPermissions
:
true
,
OnAdd
:
func
(
ctx
context
.
Context
)
{
dir
:=
root
.
NewPersistentInode
(
ctx
,
&
Inode
{},
NodeAttr
{
Mode
:
syscall
.
S_IFDIR
})
...
...
nodefs/zip_test.go
View file @
882312bf
...
...
@@ -62,7 +62,7 @@ func TestZipFS(t *testing.T) {
}
root
:=
&
zipRoot
{
zr
:
r
}
mntDir
,
clean
:=
testMount
(
t
,
root
,
nil
)
mntDir
,
_
,
clean
:=
testMount
(
t
,
root
,
nil
)
defer
clean
()
for
k
,
v
:=
range
testData
{
...
...
@@ -104,7 +104,7 @@ func TestZipFSOnAdd(t *testing.T) {
zr
:=
&
zipRoot
{
zr
:
r
}
root
:=
&
Inode
{}
mnt
,
clean
:=
testMount
(
t
,
root
,
&
Options
{
mnt
,
_
,
clean
:=
testMount
(
t
,
root
,
&
Options
{
OnAdd
:
func
(
ctx
context
.
Context
)
{
root
.
AddChild
(
"sub"
,
root
.
NewPersistentInode
(
ctx
,
zr
,
NodeAttr
{
Mode
:
syscall
.
S_IFDIR
}),
false
)
...
...
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