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
b064d6b3
Commit
b064d6b3
authored
Mar 16, 2015
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revised "rmdir while open for reading" tests for Linux's behavior.
parent
4c280e82
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
8 deletions
+16
-8
samples/memfs/memfs_test.go
samples/memfs/memfs_test.go
+8
-4
samples/memfs/posix_test.go
samples/memfs/posix_test.go
+8
-4
No files found.
samples/memfs/memfs_test.go
View file @
b064d6b3
...
...
@@ -734,12 +734,16 @@ func (t *MemFSTest) Rmdir_OpenedForReading() {
// https://github.com/bazillion/fuse/issues/66
// ExpectEq(0, fi.Sys().(*syscall.Stat_t).Nlink)
// Attempt to read from the directory. This should succeed even though it has
// been unlinked, and we shouldn't see any junk from the new directory.
// Attempt to read from the directory. This shouldn't see any junk from the
// new directory. It should either succeed with an empty result or should
// return ENOENT.
entries
,
err
:=
f
.
Readdir
(
0
)
AssertEq
(
nil
,
err
)
ExpectThat
(
entries
,
ElementsAre
())
if
err
!=
nil
{
ExpectThat
(
err
,
Error
(
HasSubstr
(
"no such file"
)))
}
else
{
ExpectThat
(
entries
,
ElementsAre
())
}
}
func
(
t
*
MemFSTest
)
CaseSensitive
()
{
...
...
samples/memfs/posix_test.go
View file @
b064d6b3
...
...
@@ -354,10 +354,14 @@ func (t *PosixTest) RmdirWhileOpenedForReading() {
ExpectEq
(
"dir"
,
fi
.
Name
())
ExpectEq
(
0
,
fi
.
Sys
()
.
(
*
syscall
.
Stat_t
)
.
Nlink
)
// Attempt to read from the directory. This should succeed even though it has
// been unlinked, and we shouldn't see any junk from the new directory.
// Attempt to read from the directory. This shouldn't see any junk from the
// new directory. It should either succeed with an empty result or should
// return ENOENT.
entries
,
err
:=
f
.
Readdir
(
0
)
AssertEq
(
nil
,
err
)
ExpectThat
(
entries
,
ElementsAre
())
if
err
!=
nil
{
ExpectThat
(
err
,
Error
(
HasSubstr
(
"no such file"
)))
}
else
{
ExpectThat
(
entries
,
ElementsAre
())
}
}
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