Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
zhijian-pro committed Jan 5, 2024
1 parent 8ae7c2d commit 74602b9
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions pkg/meta/random_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1033,37 +1033,37 @@ const SymlinkMax = 65536
// }
//}

func (m *fsMachine) Getattr(t *rapid.T) {
inode := m.pickNode(t)
var attr Attr
st := m.meta.GetAttr(m.ctx, inode, &attr)
t.Logf("attr %#v", attr)
var n *tNode
if st == 0 {
n = new(tNode)
n._type = attr.Typ
n.mode = attr.Mode
n.uid = attr.Uid
n.gid = attr.Gid
// n.atime = attr.Atime
// n.mtime = attr.Mtime
// n.ctime = attr.Ctime
n.length = attr.Length
}
n2, st2 := m.getattr(inode)
if st != st2 {
t.Fatalf("expect %s but got %s", st2, st)
}
if n2 != nil {
if n2._type != n._type || n2.mode != n.mode ||
n2.uid != n.uid || n2.gid != n.gid ||
// n2.atime != n.atime || n2.mtime != n.mtime || n2.ctime != n.ctime ||
n2.length != n.length {
t.Logf("expect %+v but got %+v", n2, n)
t.Fatalf("attr not matched")
}
}
}
//func (m *fsMachine) Getattr(t *rapid.T) {
// inode := m.pickNode(t)
// var attr Attr
// st := m.meta.GetAttr(m.ctx, inode, &attr)
// t.Logf("attr %#v", attr)
// var n *tNode
// if st == 0 {
// n = new(tNode)
// n._type = attr.Typ
// n.mode = attr.Mode
// n.uid = attr.Uid
// n.gid = attr.Gid
// // n.atime = attr.Atime
// // n.mtime = attr.Mtime
// // n.ctime = attr.Ctime
// n.length = attr.Length
// }
// n2, st2 := m.getattr(inode)
// if st != st2 {
// t.Fatalf("expect %s but got %s", st2, st)
// }
// if n2 != nil {
// if n2._type != n._type || n2.mode != n.mode ||
// n2.uid != n.uid || n2.gid != n.gid ||
// // n2.atime != n.atime || n2.mtime != n.mtime || n2.ctime != n.ctime ||
// n2.length != n.length {
// t.Logf("expect %+v but got %+v", n2, n)
// t.Fatalf("attr not matched")
// }
// }
//}

//func (m *fsMachine) Rename(t *rapid.T) {
// srcparent := m.pickNode(t)
Expand Down

0 comments on commit 74602b9

Please sign in to comment.