Skip to content

Commit

Permalink
improve tests for xattr
Browse files Browse the repository at this point in the history
  • Loading branch information
davies committed Mar 26, 2024
1 parent 346b068 commit d7225f2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion pkg/meta/load_dump_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ func testLoad(t *testing.T, uri, fname string) Meta {
if st := m.GetXattr(ctx, 2, "k", &value); st != 0 || string(value) != "v" {
t.Fatalf("getxattr: %s %v", st, value)
}
if st := m.GetXattr(ctx, 3, "dk", &value); st != 0 || string(value) != "果汁" {
if st := m.GetXattr(ctx, 3, "dk", &value); st != 0 || string(value) != "果汁%25" {
t.Fatalf("getxattr: %s %v", st, value)
}

Expand Down Expand Up @@ -284,6 +284,7 @@ func testLoadDump(t *testing.T, name, addr string) {
func TestLoadDump(t *testing.T) { //skip mutate
testLoadDump(t, "redis", "redis://127.0.0.1/10")
testLoadDump(t, "mysql", "mysql://root:@/dev")
testLoadDump(t, "badger", "badger://jfs-load-dump")
testLoadDump(t, "tikv", "tikv://127.0.0.1:2379/jfs-load-dump")
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/meta/metadata-sub.sample
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
},
"FSTree": {
"attr": {"inode":3,"type":"directory","mode":493,"uid":501,"gid":20,"atime":1623746591,"mtime":1623746610,"ctime":1623746610,"atimensec":959224111,"mtimensec":959224111,"ctimensec":959224111,"nlink":2,"length":0},
"xattrs": [{"name":"dk","value":"果汁"}],
"xattrs": [{"name":"dk","value":"果汁%2525"}],
"entries": {
"big": {
"attr": {"inode":6,"type":"regular","mode":420,"uid":501,"gid":0,"atime":1637150857,"mtime":1637150858,"ctime":1637150878,"atimensec":961503222,"mtimensec":961503222,"ctimensec":961503222,"nlink":1,"length":104857600},
Expand Down
2 changes: 1 addition & 1 deletion pkg/meta/metadata.sample
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
},
"d1": {
"attr": {"inode":3,"type":"directory","mode":493,"uid":501,"gid":20,"atime":1623746591,"mtime":1623746610,"ctime":1623746610,"atimensec":959224111,"mtimensec":959224111,"ctimensec":959224111,"nlink":2,"length":0},
"xattrs": [{"name":"dk","value":"果汁"}],
"xattrs": [{"name":"dk","value":"果汁%2525"}],
"entries": {
"big": {
"attr": {"inode":6,"type":"regular","mode":420,"uid":501,"gid":0,"atime":1637150857,"mtime":1637150858,"ctime":1637150878,"atimensec":961503222,"mtimensec":961503222,"ctimensec":961503222,"nlink":1,"length":104857600},
Expand Down

0 comments on commit d7225f2

Please sign in to comment.