forked from TrueCloudLab/frostfs-node
[#1377] oid, cid: Upgrade SDK package
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
f65898a354
commit
f15e6e888f
118 changed files with 1455 additions and 886 deletions
|
@ -10,6 +10,7 @@ import (
|
|||
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/shard"
|
||||
cidtest "github.com/nspcc-dev/neofs-sdk-go/container/id/test"
|
||||
objectSDK "github.com/nspcc-dev/neofs-sdk-go/object"
|
||||
oidtest "github.com/nspcc-dev/neofs-sdk-go/object/id/test"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
|
@ -50,7 +51,7 @@ func testShardGet(t *testing.T, hasWriteCache bool) {
|
|||
t.Run("big object", func(t *testing.T) {
|
||||
obj := generateObject(t)
|
||||
addAttribute(obj, "foo", "bar")
|
||||
obj.SetID(generateOID())
|
||||
obj.SetID(oidtest.ID())
|
||||
addPayload(obj, 1<<20) // big obj
|
||||
|
||||
putPrm.WithObject(obj)
|
||||
|
@ -66,17 +67,19 @@ func testShardGet(t *testing.T, hasWriteCache bool) {
|
|||
})
|
||||
|
||||
t.Run("parent object", func(t *testing.T) {
|
||||
t.Skip("not working, see neofs-sdk-go#242")
|
||||
obj := generateObject(t)
|
||||
addAttribute(obj, "foo", "bar")
|
||||
cid := cidtest.ID()
|
||||
cnr := cidtest.ID()
|
||||
splitID := objectSDK.NewSplitID()
|
||||
|
||||
parent := generateObjectWithCID(t, cid)
|
||||
parent := generateObjectWithCID(t, cnr)
|
||||
addAttribute(parent, "parent", "attribute")
|
||||
|
||||
child := generateObjectWithCID(t, cid)
|
||||
child := generateObjectWithCID(t, cnr)
|
||||
child.SetParent(parent)
|
||||
child.SetParentID(parent.ID())
|
||||
idParent, _ := parent.ID()
|
||||
child.SetParentID(idParent)
|
||||
child.SetSplitID(splitID)
|
||||
addPayload(child, 1<<5)
|
||||
|
||||
|
@ -100,8 +103,11 @@ func testShardGet(t *testing.T, hasWriteCache bool) {
|
|||
|
||||
si, ok := err.(*objectSDK.SplitInfoError)
|
||||
require.True(t, ok)
|
||||
require.Nil(t, si.SplitInfo().Link())
|
||||
require.Equal(t, child.ID(), si.SplitInfo().LastPart())
|
||||
_, ok = si.SplitInfo().Link()
|
||||
require.False(t, ok)
|
||||
id1, _ := child.ID()
|
||||
id2, _ := si.SplitInfo().LastPart()
|
||||
require.Equal(t, id1, id2)
|
||||
require.Equal(t, splitID, si.SplitInfo().SplitID())
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue