forked from TrueCloudLab/frostfs-node
[#86] node: Move testing utils to one package
Move testing utils from tests in local_object_storage package to unified testutil package Signed-off-by: Airat Arifullin <aarifullin@yadro.com>
This commit is contained in:
parent
342e571d89
commit
9808dec591
41 changed files with 495 additions and 520 deletions
|
@ -9,6 +9,7 @@ import (
|
|||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/blobstor"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/blobstor/blobovniczatree"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/blobstor/fstree"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/internal/testutil"
|
||||
meta "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/metabase"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/shard"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util/logger"
|
||||
|
@ -62,10 +63,10 @@ func TestShard_Lock(t *testing.T) {
|
|||
})
|
||||
|
||||
cnr := cidtest.ID()
|
||||
obj := generateObjectWithCID(t, cnr)
|
||||
obj := testutil.GenerateObjectWithCID(cnr)
|
||||
objID, _ := obj.ID()
|
||||
|
||||
lock := generateObjectWithCID(t, cnr)
|
||||
lock := testutil.GenerateObjectWithCID(cnr)
|
||||
lock.SetType(object.TypeLock)
|
||||
lockID, _ := lock.ID()
|
||||
|
||||
|
@ -87,7 +88,7 @@ func TestShard_Lock(t *testing.T) {
|
|||
require.NoError(t, err)
|
||||
|
||||
t.Run("inhuming locked objects", func(t *testing.T) {
|
||||
ts := generateObjectWithCID(t, cnr)
|
||||
ts := testutil.GenerateObjectWithCID(cnr)
|
||||
|
||||
var inhumePrm shard.InhumePrm
|
||||
inhumePrm.SetTarget(objectcore.AddressOf(ts), objectcore.AddressOf(obj))
|
||||
|
@ -101,7 +102,7 @@ func TestShard_Lock(t *testing.T) {
|
|||
})
|
||||
|
||||
t.Run("inhuming lock objects", func(t *testing.T) {
|
||||
ts := generateObjectWithCID(t, cnr)
|
||||
ts := testutil.GenerateObjectWithCID(cnr)
|
||||
|
||||
var inhumePrm shard.InhumePrm
|
||||
inhumePrm.SetTarget(objectcore.AddressOf(ts), objectcore.AddressOf(lock))
|
||||
|
@ -145,7 +146,7 @@ func TestShard_IsLocked(t *testing.T) {
|
|||
sh := newShard(t, false)
|
||||
|
||||
cnr := cidtest.ID()
|
||||
obj := generateObjectWithCID(t, cnr)
|
||||
obj := testutil.GenerateObjectWithCID(cnr)
|
||||
cnrID, _ := obj.ContainerID()
|
||||
objID, _ := obj.ID()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue