예제 #1
0
func TestGitFsXAttr(t *testing.T) {
	gitfs, cleaner := setupGitFsTest(t)
	defer cleaner()

	xattrs := make([]byte, 0)
	sz, err := unix.Listxattr(gitfs.GitFsDir+"/pry/ruby-pry/bin/pry", xattrs)
	assert.Nil(t, err)
	assert.EqualValues(t, sz, 0)
	assert.Len(t, xattrs, 0)

	sz, err = unix.Listxattr(gitfs.GitFsDir+"/pry/ruby-pry/bin/pry.unexisted", xattrs)
	assert.EqualValues(t, err, unix.ENOENT)
	assert.EqualValues(t, sz, -1)
	assert.Len(t, xattrs, 0)

	xattr := make([]byte, 0)
	sz, err = unix.Getxattr(gitfs.GitFsDir+"/pry/ruby-pry/bin/pry", "a.b.c", xattr)
	assert.EqualValues(t, err, unix.ENODATA)
	assert.EqualValues(t, sz, -1)
	assert.Len(t, xattr, 0)

	sz, err = unix.Getxattr(gitfs.GitFsDir+"/pry/ruby-pry/bin/pry.unexisted", "a.b.c", xattr)
	assert.EqualValues(t, err, unix.ENOENT)
	assert.EqualValues(t, sz, -1)
	assert.Len(t, xattr, 0)
}
예제 #2
0
func listxattr(path string, dest []byte, flags int) (sz int, err error) {
	return unix.Listxattr(path, dest)
}
예제 #3
0
func Listxattr(path string, dest []byte) (sz int, err error) {
	return unix.Listxattr(path, dest)
}