MCPcopy
hub / github.com/cubefs/cubefs / testDeleteFile

Function testDeleteFile

metanode/multi_ver_test.go:901–928  ·  view source on GitHub ↗
(t *testing.T, verSeq uint64, parentId uint64, child *proto.Dentry)

Source from the content-addressed store, hash-verified

899}
900
901func testDeleteFile(t *testing.T, verSeq uint64, parentId uint64, child *proto.Dentry) {
902 t.Logf("testDeleteFile seq [%v]", verSeq)
903 fsmDentry := &Dentry{
904 ParentId: parentId,
905 Name: child.Name,
906 Inode: child.Inode,
907 Type: child.Type,
908 multiSnap: NewDentrySnap(verSeq),
909 }
910 t.Logf("testDeleteFile seq [%v] %v dentry %v", verSeq, fsmDentry.getSeqFiled(), fsmDentry)
911 assert.True(t, nil != mp.fsmDeleteDentry(fsmDentry, false))
912
913 rino := &Inode{
914 Inode: child.Inode,
915 Type: child.Type,
916 multiSnap: &InodeMultiSnap{
917 verSeq: verSeq,
918 },
919 }
920 rino.setVer(verSeq)
921 rspDelIno := mp.fsmUnlinkInode(rino, 0)
922
923 assert.True(t, rspDelIno.Status == proto.OpOk || rspDelIno.Status == proto.OpNotExistErr)
924 if rspDelIno.Status != proto.OpOk && rspDelIno.Status != proto.OpNotExistErr {
925 t.Logf("testDelDirSnapshotVersion: rspDelino[%v] return st %v", rspDelIno, proto.ParseErrorCode(int32(rspDelIno.Status)))
926 panic(nil)
927 }
928}
929
930func testDeleteDirTree(t *testing.T, parentId uint64, verSeq uint64) {
931 t.Logf("testDeleteDirTree parentId %v seq [%v]", parentId, verSeq)

Callers 1

testDeleteDirTreeFunction · 0.85

Calls 6

getSeqFiledMethod · 0.95
setVerMethod · 0.95
ParseErrorCodeFunction · 0.92
NewDentrySnapFunction · 0.85
fsmDeleteDentryMethod · 0.80
fsmUnlinkInodeMethod · 0.80

Tested by

no test coverage detected