2021-08-16 13:04:33 +01:00
|
|
|
// Copyright (C) 2021 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
package metabase_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2021-08-31 12:44:18 +01:00
|
|
|
"storj.io/common/storj"
|
2021-08-16 13:04:33 +01:00
|
|
|
"storj.io/common/testcontext"
|
|
|
|
"storj.io/common/testrand"
|
|
|
|
"storj.io/storj/satellite/metabase"
|
|
|
|
"storj.io/storj/satellite/metabase/metabasetest"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestBeginMoveObject(t *testing.T) {
|
|
|
|
metabasetest.Run(t, func(ctx *testcontext.Context, t *testing.T, db *metabase.DB) {
|
|
|
|
obj := metabasetest.RandObjectStream()
|
|
|
|
|
|
|
|
for _, test := range metabasetest.InvalidObjectLocations(obj.Location()) {
|
|
|
|
test := test
|
|
|
|
t.Run(test.Name, func(t *testing.T) {
|
|
|
|
defer metabasetest.DeleteAll{}.Check(ctx, t, db)
|
|
|
|
metabasetest.BeginMoveObject{
|
|
|
|
Opts: metabase.BeginMoveObject{
|
|
|
|
ObjectLocation: test.ObjectLocation,
|
|
|
|
},
|
|
|
|
ErrClass: test.ErrClass,
|
|
|
|
ErrText: test.ErrText,
|
|
|
|
}.Check(ctx, t, db)
|
|
|
|
|
|
|
|
metabasetest.Verify{}.Check(ctx, t, db)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
t.Run("invalid version", func(t *testing.T) {
|
|
|
|
defer metabasetest.DeleteAll{}.Check(ctx, t, db)
|
|
|
|
|
|
|
|
metabasetest.BeginMoveObject{
|
|
|
|
Opts: metabase.BeginMoveObject{
|
|
|
|
ObjectLocation: obj.Location(),
|
|
|
|
Version: 0,
|
|
|
|
},
|
|
|
|
ErrClass: &metabase.ErrInvalidRequest,
|
|
|
|
ErrText: "Version invalid: 0",
|
|
|
|
}.Check(ctx, t, db)
|
|
|
|
|
|
|
|
metabasetest.Verify{}.Check(ctx, t, db)
|
|
|
|
})
|
|
|
|
|
|
|
|
t.Run("begin move object", func(t *testing.T) {
|
|
|
|
defer metabasetest.DeleteAll{}.Check(ctx, t, db)
|
|
|
|
|
|
|
|
expectedMetadataNonce := testrand.Nonce()
|
|
|
|
expectedMetadataKey := testrand.Bytes(265)
|
|
|
|
expectedObject := metabasetest.CreateTestObject{
|
|
|
|
CommitObject: &metabase.CommitObject{
|
|
|
|
ObjectStream: obj,
|
2021-10-29 12:04:55 +01:00
|
|
|
EncryptedMetadata: testrand.Bytes(64),
|
2021-10-12 14:37:12 +01:00
|
|
|
EncryptedMetadataNonce: expectedMetadataNonce[:],
|
2021-08-16 13:04:33 +01:00
|
|
|
EncryptedMetadataEncryptedKey: expectedMetadataKey,
|
|
|
|
},
|
|
|
|
}.Run(ctx, t, db, obj, 10)
|
|
|
|
|
|
|
|
var encKeyAndNonces []metabase.EncryptedKeyAndNonce
|
|
|
|
expectedRawSegments := make([]metabase.RawSegment, 10)
|
|
|
|
for i := range expectedRawSegments {
|
|
|
|
expectedRawSegments[i] = metabasetest.DefaultRawSegment(expectedObject.ObjectStream, metabase.SegmentPosition{
|
|
|
|
Index: uint32(i),
|
|
|
|
})
|
|
|
|
expectedRawSegments[i].PlainOffset = int64(i) * int64(expectedRawSegments[i].PlainSize)
|
|
|
|
expectedRawSegments[i].EncryptedSize = 1060
|
|
|
|
|
|
|
|
encKeyAndNonces = append(encKeyAndNonces, metabase.EncryptedKeyAndNonce{
|
|
|
|
EncryptedKeyNonce: expectedRawSegments[i].EncryptedKeyNonce,
|
|
|
|
EncryptedKey: expectedRawSegments[i].EncryptedKey,
|
|
|
|
Position: expectedRawSegments[i].Position,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
metabasetest.BeginMoveObject{
|
|
|
|
Opts: metabase.BeginMoveObject{
|
|
|
|
Version: expectedObject.Version,
|
|
|
|
ObjectLocation: obj.Location(),
|
|
|
|
},
|
|
|
|
Result: metabase.BeginMoveObjectResult{
|
|
|
|
StreamID: expectedObject.StreamID,
|
2021-10-29 12:04:55 +01:00
|
|
|
EncryptedMetadata: expectedObject.EncryptedMetadata,
|
2021-08-16 13:04:33 +01:00
|
|
|
EncryptedMetadataKey: expectedMetadataKey,
|
2021-10-12 14:37:12 +01:00
|
|
|
EncryptedMetadataKeyNonce: expectedMetadataNonce[:],
|
2021-08-16 13:04:33 +01:00
|
|
|
EncryptedKeysNonces: encKeyAndNonces,
|
|
|
|
EncryptionParameters: expectedObject.Encryption,
|
|
|
|
},
|
|
|
|
}.Check(ctx, t, db)
|
|
|
|
|
|
|
|
metabasetest.Verify{
|
|
|
|
Objects: []metabase.RawObject{
|
|
|
|
metabase.RawObject(expectedObject),
|
|
|
|
},
|
|
|
|
Segments: expectedRawSegments,
|
|
|
|
}.Check(ctx, t, db)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
2021-08-31 12:44:18 +01:00
|
|
|
|
|
|
|
func TestFinishMoveObject(t *testing.T) {
|
|
|
|
metabasetest.Run(t, func(ctx *testcontext.Context, t *testing.T, db *metabase.DB) {
|
|
|
|
obj := metabasetest.RandObjectStream()
|
2021-09-22 08:50:24 +01:00
|
|
|
newBucketName := "New bucket name"
|
2021-08-31 12:44:18 +01:00
|
|
|
|
|
|
|
for _, test := range metabasetest.InvalidObjectStreams(obj) {
|
|
|
|
test := test
|
|
|
|
t.Run(test.Name, func(t *testing.T) {
|
|
|
|
defer metabasetest.DeleteAll{}.Check(ctx, t, db)
|
|
|
|
metabasetest.FinishMoveObject{
|
|
|
|
Opts: metabase.FinishMoveObject{
|
2021-09-22 08:50:24 +01:00
|
|
|
NewBucket: newBucketName,
|
2021-08-31 12:44:18 +01:00
|
|
|
ObjectStream: test.ObjectStream,
|
|
|
|
},
|
|
|
|
ErrClass: test.ErrClass,
|
|
|
|
ErrText: test.ErrText,
|
|
|
|
}.Check(ctx, t, db)
|
|
|
|
|
|
|
|
metabasetest.Verify{}.Check(ctx, t, db)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2021-09-22 08:50:24 +01:00
|
|
|
t.Run("invalid NewBucket", func(t *testing.T) {
|
|
|
|
defer metabasetest.DeleteAll{}.Check(ctx, t, db)
|
|
|
|
|
|
|
|
metabasetest.FinishMoveObject{
|
|
|
|
Opts: metabase.FinishMoveObject{
|
|
|
|
ObjectStream: obj,
|
|
|
|
NewEncryptedObjectKey: []byte{1, 2, 3},
|
|
|
|
NewEncryptedMetadataKey: []byte{1, 2, 3},
|
2021-10-12 14:37:12 +01:00
|
|
|
NewEncryptedMetadataKeyNonce: []byte{1, 2, 3},
|
2021-09-22 08:50:24 +01:00
|
|
|
},
|
|
|
|
ErrClass: &metabase.ErrInvalidRequest,
|
|
|
|
ErrText: "NewBucket is missing",
|
|
|
|
}.Check(ctx, t, db)
|
|
|
|
|
|
|
|
metabasetest.Verify{}.Check(ctx, t, db)
|
|
|
|
})
|
|
|
|
|
2021-08-31 12:44:18 +01:00
|
|
|
t.Run("invalid NewEncryptedObjectKey", func(t *testing.T) {
|
|
|
|
defer metabasetest.DeleteAll{}.Check(ctx, t, db)
|
|
|
|
|
|
|
|
metabasetest.FinishMoveObject{
|
|
|
|
Opts: metabase.FinishMoveObject{
|
2021-09-22 08:50:24 +01:00
|
|
|
NewBucket: newBucketName,
|
2021-08-31 12:44:18 +01:00
|
|
|
ObjectStream: obj,
|
|
|
|
},
|
|
|
|
ErrClass: &metabase.ErrInvalidRequest,
|
|
|
|
ErrText: "NewEncryptedObjectKey is missing",
|
|
|
|
}.Check(ctx, t, db)
|
|
|
|
|
|
|
|
metabasetest.Verify{}.Check(ctx, t, db)
|
|
|
|
})
|
|
|
|
|
|
|
|
t.Run("invalid EncryptedMetadataKeyNonce", func(t *testing.T) {
|
|
|
|
defer metabasetest.DeleteAll{}.Check(ctx, t, db)
|
|
|
|
|
|
|
|
metabasetest.FinishMoveObject{
|
|
|
|
Opts: metabase.FinishMoveObject{
|
2021-09-22 08:50:24 +01:00
|
|
|
NewBucket: newBucketName,
|
2021-08-31 12:44:18 +01:00
|
|
|
ObjectStream: obj,
|
|
|
|
NewEncryptedObjectKey: []byte{0},
|
|
|
|
},
|
|
|
|
ErrClass: &metabase.ErrInvalidRequest,
|
|
|
|
ErrText: "EncryptedMetadataKeyNonce is missing",
|
|
|
|
}.Check(ctx, t, db)
|
|
|
|
|
|
|
|
metabasetest.Verify{}.Check(ctx, t, db)
|
|
|
|
})
|
|
|
|
|
|
|
|
t.Run("invalid EncryptedMetadataKey", func(t *testing.T) {
|
|
|
|
defer metabasetest.DeleteAll{}.Check(ctx, t, db)
|
|
|
|
|
|
|
|
metabasetest.FinishMoveObject{
|
|
|
|
Opts: metabase.FinishMoveObject{
|
2021-09-22 08:50:24 +01:00
|
|
|
NewBucket: newBucketName,
|
2021-08-31 12:44:18 +01:00
|
|
|
ObjectStream: obj,
|
|
|
|
NewEncryptedObjectKey: []byte{0},
|
2021-10-12 14:37:12 +01:00
|
|
|
NewEncryptedMetadataKeyNonce: []byte{0},
|
2021-08-31 12:44:18 +01:00
|
|
|
},
|
|
|
|
ErrClass: &metabase.ErrInvalidRequest,
|
|
|
|
ErrText: "EncryptedMetadataKey is missing",
|
|
|
|
}.Check(ctx, t, db)
|
|
|
|
|
|
|
|
metabasetest.Verify{}.Check(ctx, t, db)
|
|
|
|
})
|
|
|
|
|
|
|
|
t.Run("object does not exist", func(t *testing.T) {
|
|
|
|
defer metabasetest.DeleteAll{}.Check(ctx, t, db)
|
|
|
|
|
|
|
|
newObj := metabasetest.RandObjectStream()
|
|
|
|
|
|
|
|
newEncryptedMetadataKeyNonce := testrand.Nonce()
|
|
|
|
newEncryptedMetadataKey := testrand.Bytes(32)
|
|
|
|
newEncryptedKeysNonces := make([]metabase.EncryptedKeyAndNonce, 10)
|
|
|
|
newObjectKey := testrand.Bytes(32)
|
|
|
|
|
|
|
|
metabasetest.FinishMoveObject{
|
|
|
|
Opts: metabase.FinishMoveObject{
|
2021-09-22 08:50:24 +01:00
|
|
|
NewBucket: newBucketName,
|
2021-08-31 12:44:18 +01:00
|
|
|
ObjectStream: newObj,
|
|
|
|
NewSegmentKeys: newEncryptedKeysNonces,
|
|
|
|
NewEncryptedObjectKey: newObjectKey,
|
2021-10-12 14:37:12 +01:00
|
|
|
NewEncryptedMetadataKeyNonce: newEncryptedMetadataKeyNonce.Bytes(),
|
2021-08-31 12:44:18 +01:00
|
|
|
NewEncryptedMetadataKey: newEncryptedMetadataKey,
|
|
|
|
},
|
|
|
|
ErrClass: &storj.ErrObjectNotFound,
|
|
|
|
ErrText: "object not found",
|
|
|
|
}.Check(ctx, t, db)
|
|
|
|
|
|
|
|
metabasetest.Verify{}.Check(ctx, t, db)
|
|
|
|
})
|
|
|
|
|
|
|
|
t.Run("less amount of segments", func(t *testing.T) {
|
|
|
|
defer metabasetest.DeleteAll{}.Check(ctx, t, db)
|
|
|
|
|
|
|
|
numberOfSegments := 10
|
|
|
|
newObjectKey := testrand.Bytes(32)
|
|
|
|
|
|
|
|
newObj := metabasetest.CreateTestObject{
|
|
|
|
CommitObject: &metabase.CommitObject{
|
|
|
|
ObjectStream: obj,
|
2021-10-29 12:04:55 +01:00
|
|
|
EncryptedMetadata: testrand.Bytes(64),
|
2021-10-12 14:37:12 +01:00
|
|
|
EncryptedMetadataNonce: testrand.Nonce().Bytes(),
|
2021-08-31 12:44:18 +01:00
|
|
|
EncryptedMetadataEncryptedKey: testrand.Bytes(265),
|
|
|
|
},
|
|
|
|
}.Run(ctx, t, db, obj, byte(numberOfSegments))
|
|
|
|
|
|
|
|
newEncryptedMetadataKeyNonce := testrand.Nonce()
|
|
|
|
newEncryptedMetadataKey := testrand.Bytes(32)
|
|
|
|
newEncryptedKeysNonces := make([]metabase.EncryptedKeyAndNonce, newObj.SegmentCount-1)
|
|
|
|
expectedEncryptedSize := 1060
|
|
|
|
expectedSegments := make([]metabase.RawSegment, newObj.SegmentCount)
|
|
|
|
|
|
|
|
for i := 0; i < int(newObj.SegmentCount-1); i++ {
|
|
|
|
newEncryptedKeysNonces[i] = metabase.EncryptedKeyAndNonce{
|
|
|
|
Position: metabase.SegmentPosition{Index: uint32(i)},
|
2021-10-12 14:37:12 +01:00
|
|
|
EncryptedKeyNonce: testrand.Nonce().Bytes(),
|
2021-08-31 12:44:18 +01:00
|
|
|
EncryptedKey: testrand.Bytes(32),
|
|
|
|
}
|
|
|
|
|
|
|
|
expectedSegments[i] = metabasetest.DefaultRawSegment(newObj.ObjectStream, metabase.SegmentPosition{Index: uint32(i)})
|
|
|
|
expectedSegments[i].EncryptedKeyNonce = newEncryptedKeysNonces[i].EncryptedKeyNonce
|
|
|
|
expectedSegments[i].EncryptedKey = newEncryptedKeysNonces[i].EncryptedKey
|
|
|
|
expectedSegments[i].PlainOffset = int64(int32(i) * expectedSegments[i].PlainSize)
|
|
|
|
expectedSegments[i].EncryptedSize = int32(expectedEncryptedSize)
|
|
|
|
}
|
|
|
|
|
|
|
|
metabasetest.FinishMoveObject{
|
|
|
|
Opts: metabase.FinishMoveObject{
|
2021-09-22 08:50:24 +01:00
|
|
|
NewBucket: newBucketName,
|
2021-08-31 12:44:18 +01:00
|
|
|
ObjectStream: obj,
|
|
|
|
NewSegmentKeys: newEncryptedKeysNonces,
|
|
|
|
NewEncryptedObjectKey: newObjectKey,
|
2021-10-12 14:37:12 +01:00
|
|
|
NewEncryptedMetadataKeyNonce: newEncryptedMetadataKeyNonce.Bytes(),
|
2021-08-31 12:44:18 +01:00
|
|
|
NewEncryptedMetadataKey: newEncryptedMetadataKey,
|
|
|
|
},
|
|
|
|
ErrClass: &metabase.ErrInvalidRequest,
|
|
|
|
ErrText: "wrong amount of segments keys received",
|
|
|
|
}.Check(ctx, t, db)
|
|
|
|
})
|
|
|
|
|
|
|
|
t.Run("wrong segment indexes", func(t *testing.T) {
|
|
|
|
defer metabasetest.DeleteAll{}.Check(ctx, t, db)
|
|
|
|
|
|
|
|
numberOfSegments := 10
|
|
|
|
newObjectKey := testrand.Bytes(32)
|
|
|
|
|
|
|
|
newObj := metabasetest.CreateTestObject{
|
|
|
|
CommitObject: &metabase.CommitObject{
|
|
|
|
ObjectStream: obj,
|
2021-10-29 12:04:55 +01:00
|
|
|
EncryptedMetadata: testrand.Bytes(64),
|
2021-10-12 14:37:12 +01:00
|
|
|
EncryptedMetadataNonce: testrand.Nonce().Bytes(),
|
2021-08-31 12:44:18 +01:00
|
|
|
EncryptedMetadataEncryptedKey: testrand.Bytes(265),
|
|
|
|
},
|
|
|
|
}.Run(ctx, t, db, obj, byte(numberOfSegments))
|
|
|
|
|
|
|
|
newEncryptedMetadataKeyNonce := testrand.Nonce()
|
|
|
|
newEncryptedMetadataKey := testrand.Bytes(32)
|
|
|
|
newEncryptedKeysNonces := make([]metabase.EncryptedKeyAndNonce, newObj.SegmentCount)
|
|
|
|
expectedEncryptedSize := 1060
|
|
|
|
expectedSegments := make([]metabase.RawSegment, newObj.SegmentCount)
|
|
|
|
|
|
|
|
for i := 0; i < int(newObj.SegmentCount); i++ {
|
|
|
|
newEncryptedKeysNonces[i] = metabase.EncryptedKeyAndNonce{
|
|
|
|
Position: metabase.SegmentPosition{Index: uint32(i + 5)},
|
2021-10-12 14:37:12 +01:00
|
|
|
EncryptedKeyNonce: testrand.Nonce().Bytes(),
|
2021-08-31 12:44:18 +01:00
|
|
|
EncryptedKey: testrand.Bytes(32),
|
|
|
|
}
|
|
|
|
|
|
|
|
expectedSegments[i] = metabasetest.DefaultRawSegment(newObj.ObjectStream, metabase.SegmentPosition{Index: uint32(i)})
|
|
|
|
expectedSegments[i].EncryptedKeyNonce = newEncryptedKeysNonces[i].EncryptedKeyNonce
|
|
|
|
expectedSegments[i].EncryptedKey = newEncryptedKeysNonces[i].EncryptedKey
|
|
|
|
expectedSegments[i].PlainOffset = int64(int32(i) * expectedSegments[i].PlainSize)
|
|
|
|
expectedSegments[i].EncryptedSize = int32(expectedEncryptedSize)
|
|
|
|
}
|
|
|
|
|
|
|
|
metabasetest.FinishMoveObject{
|
|
|
|
Opts: metabase.FinishMoveObject{
|
2021-09-22 08:50:24 +01:00
|
|
|
NewBucket: newBucketName,
|
2021-08-31 12:44:18 +01:00
|
|
|
ObjectStream: obj,
|
|
|
|
NewSegmentKeys: newEncryptedKeysNonces,
|
|
|
|
NewEncryptedObjectKey: newObjectKey,
|
2021-10-12 14:37:12 +01:00
|
|
|
NewEncryptedMetadataKeyNonce: newEncryptedMetadataKeyNonce.Bytes(),
|
2021-08-31 12:44:18 +01:00
|
|
|
NewEncryptedMetadataKey: newEncryptedMetadataKey,
|
|
|
|
},
|
|
|
|
ErrClass: &metabase.Error,
|
|
|
|
ErrText: "segment is missing",
|
|
|
|
}.Check(ctx, t, db)
|
|
|
|
})
|
|
|
|
|
|
|
|
t.Run("finish move object", func(t *testing.T) {
|
|
|
|
defer metabasetest.DeleteAll{}.Check(ctx, t, db)
|
|
|
|
|
2021-10-12 14:37:12 +01:00
|
|
|
numberOfSegments := 10
|
|
|
|
newObjectKey := testrand.Bytes(32)
|
|
|
|
|
2021-08-31 12:44:18 +01:00
|
|
|
newObj := metabasetest.CreateTestObject{
|
|
|
|
CommitObject: &metabase.CommitObject{
|
|
|
|
ObjectStream: obj,
|
2021-10-29 12:04:55 +01:00
|
|
|
EncryptedMetadata: testrand.Bytes(64),
|
2021-10-12 14:37:12 +01:00
|
|
|
EncryptedMetadataNonce: testrand.Nonce().Bytes(),
|
2021-08-31 12:44:18 +01:00
|
|
|
EncryptedMetadataEncryptedKey: testrand.Bytes(265),
|
|
|
|
},
|
2021-10-12 14:37:12 +01:00
|
|
|
}.Run(ctx, t, db, obj, byte(numberOfSegments))
|
2021-08-31 12:44:18 +01:00
|
|
|
|
|
|
|
newEncryptedMetadataKeyNonce := testrand.Nonce()
|
|
|
|
newEncryptedMetadataKey := testrand.Bytes(32)
|
|
|
|
newEncryptedKeysNonces := make([]metabase.EncryptedKeyAndNonce, newObj.SegmentCount)
|
|
|
|
expectedEncryptedSize := 1060
|
|
|
|
expectedSegments := make([]metabase.RawSegment, newObj.SegmentCount)
|
|
|
|
|
|
|
|
for i := 0; i < int(newObj.SegmentCount); i++ {
|
|
|
|
newEncryptedKeysNonces[i] = metabase.EncryptedKeyAndNonce{
|
|
|
|
Position: metabase.SegmentPosition{Index: uint32(i)},
|
2021-10-12 14:37:12 +01:00
|
|
|
EncryptedKeyNonce: testrand.Nonce().Bytes(),
|
2021-08-31 12:44:18 +01:00
|
|
|
EncryptedKey: testrand.Bytes(32),
|
|
|
|
}
|
|
|
|
|
|
|
|
expectedSegments[i] = metabasetest.DefaultRawSegment(newObj.ObjectStream, metabase.SegmentPosition{Index: uint32(i)})
|
|
|
|
expectedSegments[i].EncryptedKeyNonce = newEncryptedKeysNonces[i].EncryptedKeyNonce
|
|
|
|
expectedSegments[i].EncryptedKey = newEncryptedKeysNonces[i].EncryptedKey
|
|
|
|
// TODO: place this calculation in metabasetest.
|
|
|
|
expectedSegments[i].PlainOffset = int64(int32(i) * expectedSegments[i].PlainSize)
|
|
|
|
// TODO: we should use the same value for encrypted size in both test methods.
|
|
|
|
expectedSegments[i].EncryptedSize = int32(expectedEncryptedSize)
|
|
|
|
}
|
|
|
|
|
|
|
|
metabasetest.FinishMoveObject{
|
|
|
|
Opts: metabase.FinishMoveObject{
|
2021-09-22 08:50:24 +01:00
|
|
|
NewBucket: newBucketName,
|
2021-08-31 12:44:18 +01:00
|
|
|
ObjectStream: obj,
|
|
|
|
NewSegmentKeys: newEncryptedKeysNonces,
|
|
|
|
NewEncryptedObjectKey: newObjectKey,
|
2021-10-12 14:37:12 +01:00
|
|
|
NewEncryptedMetadataKeyNonce: newEncryptedMetadataKeyNonce.Bytes(),
|
2021-08-31 12:44:18 +01:00
|
|
|
NewEncryptedMetadataKey: newEncryptedMetadataKey,
|
|
|
|
},
|
|
|
|
ErrText: "",
|
|
|
|
}.Check(ctx, t, db)
|
|
|
|
|
|
|
|
newObj.ObjectKey = metabase.ObjectKey(newObjectKey)
|
|
|
|
newObj.EncryptedMetadataEncryptedKey = newEncryptedMetadataKey
|
2021-10-12 14:37:12 +01:00
|
|
|
newObj.EncryptedMetadataNonce = newEncryptedMetadataKeyNonce[:]
|
2021-09-22 08:50:24 +01:00
|
|
|
newObj.BucketName = newBucketName
|
2021-08-31 12:44:18 +01:00
|
|
|
|
|
|
|
metabasetest.Verify{
|
|
|
|
Objects: []metabase.RawObject{
|
|
|
|
metabase.RawObject(newObj),
|
|
|
|
},
|
|
|
|
Segments: expectedSegments,
|
|
|
|
}.Check(ctx, t, db)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|