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
Kirill Smelkov
go-fuse
Commits
f45e18d6
Commit
f45e18d6
authored
Jan 30, 2019
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unionfs: fix capitalization of TTL
parent
7f7894d2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
21 deletions
+21
-21
unionfs/autounion_test.go
unionfs/autounion_test.go
+3
-3
unionfs/unionfs_test.go
unionfs/unionfs_test.go
+12
-12
unionfs/unionfs_xattr_test.go
unionfs/unionfs_xattr_test.go
+6
-6
No files found.
unionfs/autounion_test.go
View file @
f45e18d6
...
@@ -16,13 +16,13 @@ import (
...
@@ -16,13 +16,13 @@ import (
"github.com/hanwen/go-fuse/internal/testutil"
"github.com/hanwen/go-fuse/internal/testutil"
)
)
const
entryT
tl
=
100
*
time
.
Millisecond
const
entryT
TL
=
100
*
time
.
Millisecond
var
testAOpts
=
AutoUnionFsOptions
{
var
testAOpts
=
AutoUnionFsOptions
{
UnionFsOptions
:
testOpts
,
UnionFsOptions
:
testOpts
,
Options
:
nodefs
.
Options
{
Options
:
nodefs
.
Options
{
EntryTimeout
:
entryT
tl
,
EntryTimeout
:
entryT
TL
,
AttrTimeout
:
entryT
tl
,
AttrTimeout
:
entryT
TL
,
NegativeTimeout
:
0
,
NegativeTimeout
:
0
,
Debug
:
testutil
.
VerboseTest
(),
Debug
:
testutil
.
VerboseTest
(),
LookupKnownChildren
:
true
,
LookupKnownChildren
:
true
,
...
...
unionfs/unionfs_test.go
View file @
f45e18d6
...
@@ -33,9 +33,9 @@ func TestFilePathHash(t *testing.T) {
...
@@ -33,9 +33,9 @@ func TestFilePathHash(t *testing.T) {
}
}
var
testOpts
=
UnionFsOptions
{
var
testOpts
=
UnionFsOptions
{
DeletionCacheTTL
:
entryT
tl
,
DeletionCacheTTL
:
entryT
TL
,
DeletionDirName
:
"DELETIONS"
,
DeletionDirName
:
"DELETIONS"
,
BranchCacheTTL
:
entryT
tl
,
BranchCacheTTL
:
entryT
TL
,
HiddenFiles
:
[]
string
{
"hidden"
},
HiddenFiles
:
[]
string
{
"hidden"
},
}
}
...
@@ -94,9 +94,9 @@ func setupUfs(t *testing.T) (wd string, cleanup func()) {
...
@@ -94,9 +94,9 @@ func setupUfs(t *testing.T) (wd string, cleanup func()) {
// We configure timeouts are smaller, so we can check for
// We configure timeouts are smaller, so we can check for
// UnionFs's cache consistency.
// UnionFs's cache consistency.
opts
:=
&
nodefs
.
Options
{
opts
:=
&
nodefs
.
Options
{
EntryTimeout
:
entryT
tl
/
2
,
EntryTimeout
:
entryT
TL
/
2
,
AttrTimeout
:
entryT
tl
/
2
,
AttrTimeout
:
entryT
TL
/
2
,
NegativeTimeout
:
entryT
tl
/
2
,
NegativeTimeout
:
entryT
TL
/
2
,
PortableInodes
:
true
,
PortableInodes
:
true
,
Debug
:
testutil
.
VerboseTest
(),
Debug
:
testutil
.
VerboseTest
(),
LookupKnownChildren
:
true
,
LookupKnownChildren
:
true
,
...
@@ -832,7 +832,7 @@ func TestUnionFsCopyChmod(t *testing.T) {
...
@@ -832,7 +832,7 @@ func TestUnionFsCopyChmod(t *testing.T) {
if
fi
.
Mode
()
&
0111
==
0
{
if
fi
.
Mode
()
&
0111
==
0
{
t
.
Errorf
(
"Lstat(%v): mode %o"
,
fn
,
fi
.
Mode
())
t
.
Errorf
(
"Lstat(%v): mode %o"
,
fn
,
fi
.
Mode
())
}
}
time
.
Sleep
(
entryT
tl
)
time
.
Sleep
(
entryT
TL
)
fi
,
err
=
os
.
Lstat
(
fn
)
fi
,
err
=
os
.
Lstat
(
fn
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"Lstat(%v) after sleep: %v"
,
fn
,
err
)
t
.
Fatalf
(
"Lstat(%v) after sleep: %v"
,
fn
,
err
)
...
@@ -1040,7 +1040,7 @@ func TestUnionFsDropDeletionCache(t *testing.T) {
...
@@ -1040,7 +1040,7 @@ func TestUnionFsDropDeletionCache(t *testing.T) {
}
}
// Expire kernel entry.
// Expire kernel entry.
time
.
Sleep
((
6
*
entryT
tl
)
/
10
)
time
.
Sleep
((
6
*
entryT
TL
)
/
10
)
err
=
ioutil
.
WriteFile
(
wd
+
"/mnt/.drop_cache"
,
[]
byte
(
""
),
0644
)
err
=
ioutil
.
WriteFile
(
wd
+
"/mnt/.drop_cache"
,
[]
byte
(
""
),
0644
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"WriteFile: %v"
,
err
)
t
.
Fatalf
(
"WriteFile: %v"
,
err
)
...
@@ -1164,9 +1164,9 @@ func TestUnionFsDisappearing(t *testing.T) {
...
@@ -1164,9 +1164,9 @@ func TestUnionFsDisappearing(t *testing.T) {
}
}
opts
:=
&
nodefs
.
Options
{
opts
:=
&
nodefs
.
Options
{
EntryTimeout
:
entryT
tl
,
EntryTimeout
:
entryT
TL
,
AttrTimeout
:
entryT
tl
,
AttrTimeout
:
entryT
TL
,
NegativeTimeout
:
entryT
tl
,
NegativeTimeout
:
entryT
TL
,
Debug
:
testutil
.
VerboseTest
(),
Debug
:
testutil
.
VerboseTest
(),
LookupKnownChildren
:
true
,
LookupKnownChildren
:
true
,
}
}
...
@@ -1192,7 +1192,7 @@ func TestUnionFsDisappearing(t *testing.T) {
...
@@ -1192,7 +1192,7 @@ func TestUnionFsDisappearing(t *testing.T) {
}
}
wrFs
.
visibleChan
<-
false
wrFs
.
visibleChan
<-
false
time
.
Sleep
((
3
*
entryT
tl
)
/
2
)
time
.
Sleep
((
3
*
entryT
TL
)
/
2
)
_
,
err
=
ioutil
.
ReadDir
(
wd
+
"/mnt"
)
_
,
err
=
ioutil
.
ReadDir
(
wd
+
"/mnt"
)
if
err
==
nil
{
if
err
==
nil
{
...
@@ -1205,7 +1205,7 @@ func TestUnionFsDisappearing(t *testing.T) {
...
@@ -1205,7 +1205,7 @@ func TestUnionFsDisappearing(t *testing.T) {
}
}
// Wait for the caches to purge, and then restore.
// Wait for the caches to purge, and then restore.
time
.
Sleep
((
3
*
entryT
tl
)
/
2
)
time
.
Sleep
((
3
*
entryT
TL
)
/
2
)
wrFs
.
visibleChan
<-
true
wrFs
.
visibleChan
<-
true
_
,
err
=
ioutil
.
ReadDir
(
wd
+
"/mnt"
)
_
,
err
=
ioutil
.
ReadDir
(
wd
+
"/mnt"
)
...
...
unionfs/unionfs_xattr_test.go
View file @
f45e18d6
...
@@ -54,15 +54,15 @@ func TestXAttrCaching(t *testing.T) {
...
@@ -54,15 +54,15 @@ func TestXAttrCaching(t *testing.T) {
}
}
ufs
,
err
:=
NewUnionFs
([]
pathfs
.
FileSystem
{
rwFS
,
ufs
,
err
:=
NewUnionFs
([]
pathfs
.
FileSystem
{
rwFS
,
NewCachingFileSystem
(
roFS
,
entryT
tl
)},
testOpts
)
NewCachingFileSystem
(
roFS
,
entryT
TL
)},
testOpts
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"NewUnionFs: %v"
,
err
)
t
.
Fatalf
(
"NewUnionFs: %v"
,
err
)
}
}
opts
:=
&
nodefs
.
Options
{
opts
:=
&
nodefs
.
Options
{
EntryTimeout
:
entryT
tl
/
2
,
EntryTimeout
:
entryT
TL
/
2
,
AttrTimeout
:
entryT
tl
/
2
,
AttrTimeout
:
entryT
TL
/
2
,
NegativeTimeout
:
entryT
tl
/
2
,
NegativeTimeout
:
entryT
TL
/
2
,
Debug
:
testutil
.
VerboseTest
(),
Debug
:
testutil
.
VerboseTest
(),
LookupKnownChildren
:
true
,
LookupKnownChildren
:
true
,
}
}
...
@@ -94,7 +94,7 @@ func TestXAttrCaching(t *testing.T) {
...
@@ -94,7 +94,7 @@ func TestXAttrCaching(t *testing.T) {
t
.
Fatalf
(
"Got %q want %q"
,
got
,
err
)
t
.
Fatalf
(
"Got %q want %q"
,
got
,
err
)
}
}
time
.
Sleep
(
entryT
tl
/
3
)
time
.
Sleep
(
entryT
TL
/
3
)
n
,
err
=
Getxattr
(
wd
+
"/mnt/file"
,
"user.attr"
,
buf
)
n
,
err
=
Getxattr
(
wd
+
"/mnt/file"
,
"user.attr"
,
buf
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -105,7 +105,7 @@ func TestXAttrCaching(t *testing.T) {
...
@@ -105,7 +105,7 @@ func TestXAttrCaching(t *testing.T) {
t
.
Fatalf
(
"Got %q want %q"
,
got
,
err
)
t
.
Fatalf
(
"Got %q want %q"
,
got
,
err
)
}
}
time
.
Sleep
(
entryT
tl
/
3
)
time
.
Sleep
(
entryT
TL
/
3
)
// Make sure that an interceding Getxattr() to a filesystem that doesn't implement GetXAttr() doesn't affect future calls.
// Make sure that an interceding Getxattr() to a filesystem that doesn't implement GetXAttr() doesn't affect future calls.
Getxattr
(
wd
,
"whatever"
,
buf
)
Getxattr
(
wd
,
"whatever"
,
buf
)
...
...
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