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
363c44cd
Commit
363c44cd
authored
Nov 07, 2017
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Shayan Pooya as author.
parent
cc4e21f7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
1 deletion
+36
-1
AUTHORS
AUTHORS
+1
-0
fuse/test/xattr_test.go
fuse/test/xattr_test.go
+35
-1
No files found.
AUTHORS
View file @
363c44cd
...
...
@@ -11,5 +11,6 @@ Logan Hanks <logan@bitcasa.com>
Nick Cooper <gh@smoogle.org>
Patrick Crosby <pcrosby@gmail.com>
Paul Jolly <paul@myitcv.org.uk>
Shayan Pooya <shayan@arista.com>
Valient Gough <vgough@pobox.com>
Yongwoo Park <nnnlife@gmail.com>
fuse/test/xattr_test.go
View file @
363c44cd
...
...
@@ -32,7 +32,11 @@ type xattrChildNode struct {
}
func
(
n
*
xattrChildNode
)
GetXAttr
(
attr
string
,
context
*
fuse
.
Context
)
([]
byte
,
fuse
.
Status
)
{
return
[]
byte
(
"value"
),
fuse
.
OK
if
attr
==
"attr"
{
return
[]
byte
(
"value"
),
fuse
.
OK
}
else
{
return
[]
byte
(
""
),
fuse
.
OK
}
}
func
TestDefaultXAttr
(
t
*
testing
.
T
)
{
...
...
@@ -64,3 +68,33 @@ func TestDefaultXAttr(t *testing.T) {
t
.
Fatalf
(
"got %q, want %q"
,
got
,
want
)
}
}
func
TestEmptyXAttr
(
t
*
testing
.
T
)
{
dir
:=
testutil
.
TempDir
()
defer
os
.
RemoveAll
(
dir
)
root
:=
&
xattrNode
{
Node
:
nodefs
.
NewDefaultNode
(),
}
opts
:=
nodefs
.
NewOptions
()
opts
.
Debug
=
testutil
.
VerboseTest
()
s
,
_
,
err
:=
nodefs
.
MountRoot
(
dir
,
root
,
opts
)
if
err
!=
nil
{
t
.
Fatalf
(
"MountRoot: %v"
,
err
)
}
go
s
.
Serve
()
if
err
:=
s
.
WaitMount
();
err
!=
nil
{
t
.
Fatal
(
"WaitMount"
,
err
)
}
defer
s
.
Unmount
()
var
data
[
1024
]
byte
sz
,
err
:=
syscall
.
Getxattr
(
filepath
.
Join
(
dir
,
"child"
),
"attr2"
,
data
[
:
])
if
err
!=
nil
{
t
.
Fatalf
(
"Getxattr: %v"
,
err
)
}
else
if
got
,
want
:=
string
(
data
[
:
sz
]),
""
;
got
!=
want
{
t
.
Fatalf
(
"got %q, want %q"
,
got
,
want
)
}
}
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