Skip to content

Commit ca2823b

Browse files
committed
Fix TestXAttrGet for ListV1Ext
1 parent b5af946 commit ca2823b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

internal/goofys_test.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2433,7 +2433,6 @@ func (s *GoofysTest) TestXAttrGet(t *C) {
24332433
dir1 = s.fs.inodes[lookup.Entry.Child]
24342434
file3 := dir1.findChild("file3")
24352435
t.Assert(file3, NotNil)
2436-
t.Assert(file3.userMetadata, IsNil)
24372436

24382437
if checkETag {
24392438
value, err = file3.GetXattr("s3.etag")
@@ -2451,6 +2450,15 @@ func (s *GoofysTest) TestXAttrGet(t *C) {
24512450
names, err = emptyDir2.ListXattr()
24522451
t.Assert(err, IsNil)
24532452
sort.Strings(names)
2453+
expectedXattrs = []string{
2454+
xattrPrefix + "etag",
2455+
xattrPrefix + "storage-class",
2456+
"user.name",
2457+
}
2458+
if len(names) == 2 {
2459+
// STANDARD storage-class may be present or not
2460+
expectedXattrs = []string{ xattrPrefix + "etag", "user.name" }
2461+
}
24542462
t.Assert(names, DeepEquals, expectedXattrs)
24552463

24562464
emptyDir, err := s.LookUpInode(t, "empty_dir")
@@ -2565,7 +2573,6 @@ func (s *GoofysTest) TestXAttrGetCached(t *C) {
25652573

25662574
in, err := s.LookUpInode(t, "file1")
25672575
t.Assert(err, IsNil)
2568-
t.Assert(in.userMetadata, IsNil)
25692576

25702577
_, err = in.GetXattr(xattrPrefix + "etag")
25712578
t.Assert(err, IsNil)

0 commit comments

Comments
 (0)