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
Levin Zimmermann
go-fuse
Commits
ffda34eb
Commit
ffda34eb
authored
13 years ago
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix SetXAttr in xattr_test: must copy attribute value.
parent
800e5338
master
escapecomma
newapi-review
newapi-review2
t
x/bench
x/remmap-under-pagefault
y/nodefs-cancel
v20170619
v2.2.0
v2.1.0
v2.0.3
v2.0.2
v2.0.1
v2.0.0
v1.0.0
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
fuse/xattr_test.go
fuse/xattr_test.go
+12
-6
No files found.
fuse/xattr_test.go
View file @
ffda34eb
...
...
@@ -39,10 +39,13 @@ func (me *XAttrTestFs) GetAttr(name string) (*Attr, Status) {
}
func
(
me
*
XAttrTestFs
)
SetXAttr
(
name
string
,
attr
string
,
data
[]
byte
,
flags
int
)
Status
{
log
.
Println
(
"SetXAttr"
,
name
,
attr
,
string
(
data
),
flags
)
if
name
!=
me
.
filename
{
return
ENOENT
}
me
.
attrs
[
attr
]
=
data
dest
:=
make
([]
byte
,
len
(
data
))
copy
(
dest
,
data
)
me
.
attrs
[
attr
]
=
dest
return
OK
}
...
...
@@ -54,7 +57,7 @@ func (me *XAttrTestFs) GetXAttr(name string, attr string) ([]byte, Status) {
if
!
ok
{
return
nil
,
syscall
.
ENODATA
}
log
.
Println
(
"GetXAttr"
,
string
(
v
))
return
v
,
OK
}
...
...
@@ -74,7 +77,7 @@ func (me *XAttrTestFs) RemoveXAttr(name string, attr string) Status {
return
ENOENT
}
_
,
ok
:=
me
.
attrs
[
attr
]
log
.
Println
(
name
,
attr
,
ok
)
log
.
Println
(
"RemoveXAttr"
,
name
,
attr
,
ok
)
if
!
ok
{
return
syscall
.
ENODATA
}
...
...
@@ -90,7 +93,7 @@ func TestXAttrRead(t *testing.T) {
"user.attr2"
:
[]
byte
(
"val2"
)}
xfs
:=
NewXAttrFs
(
nm
,
golden
)
connector
:=
NewPathFileSystemConnector
(
xfs
)
connector
:=
NewPathFileSystemConnector
(
NewLockingPathFilesystem
(
xfs
)
)
mountPoint
:=
MakeTempDir
()
state
:=
NewMountState
(
connector
)
...
...
@@ -136,10 +139,13 @@ func TestXAttrRead(t *testing.T) {
}
}
Setxattr
(
mounted
,
"third"
,
[]
byte
(
"value"
),
0
)
errno
=
Setxattr
(
mounted
,
"third"
,
[]
byte
(
"value"
),
0
)
if
errno
!=
0
{
t
.
Error
(
"Setxattr error"
,
errno
)
}
val
,
errno
=
GetXAttr
(
mounted
,
"third"
)
if
errno
!=
0
||
string
(
val
)
!=
"value"
{
t
.
Error
(
"Read back set xattr:"
,
errno
,
val
)
t
.
Error
(
"Read back set xattr:"
,
errno
,
string
(
val
)
)
}
Removexattr
(
mounted
,
"third"
)
...
...
This diff is collapsed.
Click to expand it.
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