Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jacobsa-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
jacobsa-fuse
Commits
8b7833ba
Commit
8b7833ba
authored
Feb 29, 2016
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TestNonEmptyMountPoint: clean up in the event of a successful mount.
parent
38175a2e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
mount_test.go
mount_test.go
+11
-3
No files found.
mount_test.go
View file @
8b7833ba
...
...
@@ -66,6 +66,8 @@ func TestSuccessfulMount(t *testing.T) {
}
func
TestNonEmptyMountPoint
(
t
*
testing
.
T
)
{
ctx
:=
context
.
Background
()
// Set up a temporary directory.
dir
,
err
:=
ioutil
.
TempDir
(
""
,
"mount_test"
)
if
err
!=
nil
{
...
...
@@ -82,13 +84,19 @@ func TestNonEmptyMountPoint(t *testing.T) {
// Attempt to mount.
fs
:=
&
minimalFS
{}
_
,
err
=
fuse
.
Mount
(
mfs
,
err
:
=
fuse
.
Mount
(
dir
,
fuseutil
.
NewFileSystemServer
(
fs
),
&
fuse
.
MountConfig
{})
if
err
==
nil
{
fuse
.
Unmount
(
mfs
.
Dir
())
mfs
.
Join
(
ctx
)
t
.
Fatal
(
"fuse.Mount returned nil"
)
}
const
want
=
"not empty"
if
err
==
nil
||
!
strings
.
Contains
(
err
.
Error
()
,
want
)
{
t
.
Errorf
(
"Unexpected error: %v"
,
err
)
if
got
:=
err
.
Error
();
!
strings
.
Contains
(
got
,
want
)
{
t
.
Errorf
(
"Unexpected error: %v"
,
got
)
}
}
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