Commit 363c44cd authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Add Shayan Pooya as author.

parent cc4e21f7
......@@ -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>
......@@ -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)
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment