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
d5da28da
Commit
d5da28da
authored
Aug 03, 2016
by
Adam H. Leventhal
Committed by
Han-Wen Nienhuys
Aug 04, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for #115.
parent
778c9eb1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
fuse/test/mount_test.go
fuse/test/mount_test.go
+31
-0
No files found.
fuse/test/mount_test.go
View file @
d5da28da
...
...
@@ -8,6 +8,7 @@ import (
"io/ioutil"
"os"
"path/filepath"
"runtime"
"testing"
"time"
...
...
@@ -197,3 +198,33 @@ func TestDefaultNodeMount(t *testing.T) {
t
.
Fatalf
(
"got %q, want %q"
,
entries
[
0
]
.
Name
(),
"sub"
)
}
}
func
TestLiveness
(
t
*
testing
.
T
)
{
dir
,
err
:=
ioutil
.
TempDir
(
""
,
"go-fuse"
)
if
err
!=
nil
{
t
.
Fatalf
(
"TempDir: %v"
,
err
)
}
defer
os
.
RemoveAll
(
dir
)
root
:=
nodefs
.
NewDefaultNode
()
s
,
_
,
err
:=
nodefs
.
MountRoot
(
dir
,
root
,
nil
)
if
err
!=
nil
{
t
.
Fatalf
(
"MountRoot: %v"
,
err
)
}
go
s
.
Serve
()
if
err
:=
s
.
WaitMount
();
err
!=
nil
{
t
.
Fatal
(
"WaitMount"
,
err
)
}
defer
s
.
Unmount
()
if
_
,
err
:=
ioutil
.
ReadDir
(
dir
);
err
!=
nil
{
t
.
Fatalf
(
"ReadDir: %v"
,
err
)
}
// We previously encountered a sitation where a finalizer would close our fd out from under us. Try to force both finalizers to run and object destruction to complete.
runtime
.
GC
()
runtime
.
GC
()
if
_
,
err
:=
ioutil
.
ReadDir
(
dir
);
err
!=
nil
{
t
.
Fatalf
(
"ReadDir: %v"
,
err
)
}
}
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