@@ -53,7 +53,7 @@ func TestFileNode_Add(t *testing.T) {
5353
5454 fx .index .EXPECT ().CheckLimits (ctx , storeKey )
5555 fx .index .EXPECT ().Migrate (ctx , storeKey )
56- fx .index .EXPECT ().CheckOwnership (ctx , storeKey , storeKey .GroupId , gomock .Any ()).Return (nil )
56+ fx .index .EXPECT ().CheckAndMoveOwnership (ctx , storeKey , storeKey .GroupId , gomock .Any ()).Return (nil )
5757 fx .index .EXPECT ().BlocksLock (ctx , []blocks.Block {b }).Return (func () {}, nil )
5858 fx .index .EXPECT ().BlocksGetNonExistent (ctx , []blocks.Block {b }).Return ([]blocks.Block {b }, nil )
5959 fx .store .EXPECT ().Add (ctx , []blocks.Block {b })
@@ -92,7 +92,7 @@ func TestFileNode_Add(t *testing.T) {
9292 })
9393
9494 fx .index .EXPECT ().Migrate (ctx , storeKey )
95- fx .index .EXPECT ().CheckOwnership (ctx , storeKey , storeKey .GroupId , gomock .Any ()).Return (nil )
95+ fx .index .EXPECT ().CheckAndMoveOwnership (ctx , storeKey , storeKey .GroupId , gomock .Any ()).Return (nil )
9696 fx .index .EXPECT ().CheckLimits (ctx , storeKey ).Return (index .ErrLimitExceed )
9797
9898 resp , err := fx .handler .BlockPush (ctx , & fileproto.BlockPushRequest {
@@ -217,7 +217,7 @@ func TestFileNode_Check(t *testing.T) {
217217 })
218218
219219 fx .index .EXPECT ().Migrate (ctx , storeKey )
220- fx .index .EXPECT ().CheckOwnership (ctx , storeKey , storeKey .GroupId , gomock .Any ()).Return (nil )
220+ fx .index .EXPECT ().CheckAndMoveOwnership (ctx , storeKey , storeKey .GroupId , gomock .Any ()).Return (nil )
221221 fx .index .EXPECT ().CidExistsInSpace (ctx , storeKey , testutil .BlocksToKeys (bs )).Return (testutil .BlocksToKeys (bs [:1 ]), nil )
222222 fx .index .EXPECT ().CidExists (ctx , bs [1 ].Cid ()).Return (true , nil )
223223 fx .index .EXPECT ().CidExists (ctx , bs [2 ].Cid ()).Return (false , nil )
@@ -260,7 +260,7 @@ func TestFileNode_BlocksBind(t *testing.T) {
260260
261261 fx .index .EXPECT ().CheckLimits (ctx , storeKey )
262262 fx .index .EXPECT ().Migrate (ctx , storeKey )
263- fx .index .EXPECT ().CheckOwnership (ctx , storeKey , storeKey .GroupId , gomock .Any ()).Return (nil )
263+ fx .index .EXPECT ().CheckAndMoveOwnership (ctx , storeKey , storeKey .GroupId , gomock .Any ()).Return (nil )
264264 fx .index .EXPECT ().CidEntries (ctx , cids ).Return (cidEntries , nil )
265265 fx .index .EXPECT ().FileBind (ctx , storeKey , fileId , cidEntries )
266266
@@ -295,7 +295,7 @@ func TestFileNode_FileInfo(t *testing.T) {
295295 })
296296
297297 fx .index .EXPECT ().Migrate (ctx , storeKey )
298- fx .index .EXPECT ().CheckOwnership (ctx , storeKey , storeKey .GroupId , gomock .Any ()).Return (nil )
298+ fx .index .EXPECT ().CheckAndMoveOwnership (ctx , storeKey , storeKey .GroupId , gomock .Any ()).Return (nil )
299299 fx .index .EXPECT ().FileInfo (ctx , storeKey , fileId1 , fileId2 ).Return ([]index.FileInfo {{1 , 1 }, {2 , 2 }}, nil )
300300
301301 resp , err := fx .handler .FilesInfo (ctx , & fileproto.FilesInfoRequest {
@@ -376,7 +376,7 @@ func TestFileNode_SpaceInfo(t *testing.T) {
376376 })
377377
378378 fx .index .EXPECT ().Migrate (ctx , storeKey )
379- fx .index .EXPECT ().CheckOwnership (ctx , storeKey , storeKey .GroupId , gomock .Any ()).Return (nil )
379+ fx .index .EXPECT ().CheckAndMoveOwnership (ctx , storeKey , storeKey .GroupId , gomock .Any ()).Return (nil )
380380
381381 fx .index .EXPECT ().GroupInfo (ctx , storeKey .GroupId ).Return (index.GroupInfo {
382382 BytesUsage : 100 ,
@@ -421,7 +421,7 @@ func TestFileNode_SpaceInfo(t *testing.T) {
421421 })
422422
423423 fx .index .EXPECT ().Migrate (ctx , storeKey )
424- fx .index .EXPECT ().CheckOwnership (ctx , storeKey , storeKey .GroupId , gomock .Any ()).Return (nil )
424+ fx .index .EXPECT ().CheckAndMoveOwnership (ctx , storeKey , storeKey .GroupId , gomock .Any ()).Return (nil )
425425
426426 fx .index .EXPECT ().GroupInfo (ctx , storeKey .GroupId ).Return (index.GroupInfo {
427427 BytesUsage : 100 ,
@@ -463,7 +463,7 @@ func TestFileNode_StoreKey(t *testing.T) {
463463 }
464464
465465 fx .index .EXPECT ().Migrate (ctx , expectedStoreKey )
466- fx .index .EXPECT ().CheckOwnership (ctx , expectedStoreKey , expectedStoreKey .GroupId , gomock .Any ()).Return (nil )
466+ fx .index .EXPECT ().CheckAndMoveOwnership (ctx , expectedStoreKey , expectedStoreKey .GroupId , gomock .Any ()).Return (nil )
467467 fx .index .EXPECT ().CheckLimits (ctx , expectedStoreKey )
468468 fx .aclService .EXPECT ().ReadList (gomock .Any (), gomock .Any (), gomock .Any ()).
469469 DoAndReturn (func (ctx context.Context , spaceId string , fn func (list.AclList ) error ) error {
@@ -577,7 +577,7 @@ func TestFileNode_SpaceLimitSet(t *testing.T) {
577577 })
578578
579579 fx .index .EXPECT ().Migrate (ctx , storeKey )
580- fx .index .EXPECT ().CheckOwnership (ctx , storeKey , storeKey .GroupId , gomock .Any ()).Return (nil )
580+ fx .index .EXPECT ().CheckAndMoveOwnership (ctx , storeKey , storeKey .GroupId , gomock .Any ()).Return (nil )
581581 fx .index .EXPECT ().SetSpaceLimit (ctx , storeKey , uint64 (12345 ))
582582 require .NoError (t , fx .SpaceLimitSet (ctx , storeKey .SpaceId , 12345 ))
583583}
0 commit comments