satellite: update tests to pass etag.Reader to multipart.PutObjectPart
Change-Id: Ibe99357945ae7a91f5b5d4f87b83d425c9fa84a5
This commit is contained in:
parent
74b243d1ca
commit
035c393da0
4
go.mod
4
go.mod
@ -51,6 +51,6 @@ require (
|
|||||||
storj.io/common v0.0.0-20210325225810-6cd9934a276a
|
storj.io/common v0.0.0-20210325225810-6cd9934a276a
|
||||||
storj.io/drpc v0.0.20
|
storj.io/drpc v0.0.20
|
||||||
storj.io/monkit-jaeger v0.0.0-20210225162224-66fb37637bf6
|
storj.io/monkit-jaeger v0.0.0-20210225162224-66fb37637bf6
|
||||||
storj.io/private v0.0.0-20210203200143-9d2ec06f0d3c
|
storj.io/private v0.0.0-20210225200021-48b617cbe817
|
||||||
storj.io/uplink v1.4.6-0.20210212112107-f7f8a3c8321a
|
storj.io/uplink v1.4.6-0.20210326162107-c1403fdd9e35
|
||||||
)
|
)
|
||||||
|
13
go.sum
13
go.sum
@ -748,7 +748,6 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ
|
|||||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
|
||||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
|
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
|
||||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
@ -948,18 +947,16 @@ sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2
|
|||||||
sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0=
|
sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0=
|
||||||
storj.io/common v0.0.0-20200424175742-65ac59022f4f/go.mod h1:pZyXiIE7bGETIRXtfs0nICqMwp7PM8HqnDuyUeldNA0=
|
storj.io/common v0.0.0-20200424175742-65ac59022f4f/go.mod h1:pZyXiIE7bGETIRXtfs0nICqMwp7PM8HqnDuyUeldNA0=
|
||||||
storj.io/common v0.0.0-20201026135900-1aaeec90670b/go.mod h1:GqdmNf3fLm2UZX/7Zr0BLFCJ4gFjgm6eHrk/fnmr5jQ=
|
storj.io/common v0.0.0-20201026135900-1aaeec90670b/go.mod h1:GqdmNf3fLm2UZX/7Zr0BLFCJ4gFjgm6eHrk/fnmr5jQ=
|
||||||
storj.io/common v0.0.0-20210208122718-577b1f8a0a0f/go.mod h1:b8XP/TdW8OyTZ/J2BDFOIE9KojSUNZgImBFZI99zS04=
|
storj.io/common v0.0.0-20210324105846-0a39fd4f6781/go.mod h1:Udjm4roy/lhL7PHDWlNVhuVxlohcPiyHMeuigw94SDE=
|
||||||
storj.io/common v0.0.0-20210325225810-6cd9934a276a h1:p0v9vSI6WafbtGQwtH5dA+wsrEJ10hXN9O6r9IF/O4s=
|
storj.io/common v0.0.0-20210325225810-6cd9934a276a h1:p0v9vSI6WafbtGQwtH5dA+wsrEJ10hXN9O6r9IF/O4s=
|
||||||
storj.io/common v0.0.0-20210325225810-6cd9934a276a/go.mod h1:Udjm4roy/lhL7PHDWlNVhuVxlohcPiyHMeuigw94SDE=
|
storj.io/common v0.0.0-20210325225810-6cd9934a276a/go.mod h1:Udjm4roy/lhL7PHDWlNVhuVxlohcPiyHMeuigw94SDE=
|
||||||
storj.io/drpc v0.0.11/go.mod h1:TiFc2obNjL9/3isMW1Rpxjy8V9uE0B2HMeMFGiiI7Iw=
|
storj.io/drpc v0.0.11/go.mod h1:TiFc2obNjL9/3isMW1Rpxjy8V9uE0B2HMeMFGiiI7Iw=
|
||||||
storj.io/drpc v0.0.14/go.mod h1:82nfl+6YwRwF6UG31cEWWUqv/FaKvP5SGqUvoqTxCMA=
|
storj.io/drpc v0.0.14/go.mod h1:82nfl+6YwRwF6UG31cEWWUqv/FaKvP5SGqUvoqTxCMA=
|
||||||
storj.io/drpc v0.0.16/go.mod h1:zdmQ93nx4Z35u11pQ+GAnBy4DGOK3HJCSOfeh2RryTo=
|
|
||||||
storj.io/drpc v0.0.20 h1:nzOxsetLi0fJ8xCL92LPlYL0B6iYdDDk1Cpdbn0/r9Y=
|
storj.io/drpc v0.0.20 h1:nzOxsetLi0fJ8xCL92LPlYL0B6iYdDDk1Cpdbn0/r9Y=
|
||||||
storj.io/drpc v0.0.20/go.mod h1:eAxUDk8HWvGl9iqznpuphtZ+WIjIGPJFqNXuKHgRiMM=
|
storj.io/drpc v0.0.20/go.mod h1:eAxUDk8HWvGl9iqznpuphtZ+WIjIGPJFqNXuKHgRiMM=
|
||||||
storj.io/monkit-jaeger v0.0.0-20200518165323-80778fc3f91b/go.mod h1:gj4vuCeyCRjRmH8LIrgoyU9Dc9uR6H+/GcDUXmTbf80=
|
|
||||||
storj.io/monkit-jaeger v0.0.0-20210225162224-66fb37637bf6 h1:LTDmeZDrFWD9byqNOf/Bc1VmMNKvja/9Cs52d1V5aTk=
|
storj.io/monkit-jaeger v0.0.0-20210225162224-66fb37637bf6 h1:LTDmeZDrFWD9byqNOf/Bc1VmMNKvja/9Cs52d1V5aTk=
|
||||||
storj.io/monkit-jaeger v0.0.0-20210225162224-66fb37637bf6/go.mod h1:gj4vuCeyCRjRmH8LIrgoyU9Dc9uR6H+/GcDUXmTbf80=
|
storj.io/monkit-jaeger v0.0.0-20210225162224-66fb37637bf6/go.mod h1:gj4vuCeyCRjRmH8LIrgoyU9Dc9uR6H+/GcDUXmTbf80=
|
||||||
storj.io/private v0.0.0-20210203200143-9d2ec06f0d3c h1:9sLvfSIZgUhw98J8/3FBOVVJ+huhgYedhYpbrLbE+uk=
|
storj.io/private v0.0.0-20210225200021-48b617cbe817 h1:qNA4Ex4ZvEEDfcp+htWkWKuAM80D0/ibgayFHCZZ9m8=
|
||||||
storj.io/private v0.0.0-20210203200143-9d2ec06f0d3c/go.mod h1:VHaDkpBka3Pp5rXqFSDHbEmzMaFFW4BYrXJfGIN1Udo=
|
storj.io/private v0.0.0-20210225200021-48b617cbe817/go.mod h1:tltqsmUl/K47kfxf5OXn45GZ6H5oa35GMEe6IMdViU0=
|
||||||
storj.io/uplink v1.4.6-0.20210212112107-f7f8a3c8321a h1:s4adJCY5sKrc96LLk/oHBemuq4V2yM9a2uju1c6P3xo=
|
storj.io/uplink v1.4.6-0.20210326162107-c1403fdd9e35 h1:NTanKD4CCLKFzckgEoYoK9LaO1WhF2eHyF+XTvY2F0c=
|
||||||
storj.io/uplink v1.4.6-0.20210212112107-f7f8a3c8321a/go.mod h1:IXHjzdYHnFChyTE7YSD7UlSz2jyAMlFFFeFoQEgsCmg=
|
storj.io/uplink v1.4.6-0.20210326162107-c1403fdd9e35/go.mod h1:UVUGcqtPRXmQET9tXzaARsaJ11Sks5uU5skjqU0rNqM=
|
||||||
|
@ -6,6 +6,7 @@ package gc_test
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
|
"crypto/sha256"
|
||||||
"errors"
|
"errors"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
@ -27,6 +28,7 @@ import (
|
|||||||
"storj.io/storj/satellite/metainfo/metabase"
|
"storj.io/storj/satellite/metainfo/metabase"
|
||||||
"storj.io/storj/storage"
|
"storj.io/storj/storage"
|
||||||
"storj.io/storj/storagenode"
|
"storj.io/storj/storagenode"
|
||||||
|
"storj.io/uplink/private/etag"
|
||||||
"storj.io/uplink/private/multipart"
|
"storj.io/uplink/private/multipart"
|
||||||
"storj.io/uplink/private/testuplink"
|
"storj.io/uplink/private/testuplink"
|
||||||
)
|
)
|
||||||
@ -253,7 +255,8 @@ func startMultipartUpload(ctx context.Context, t *testing.T, uplink *testplanet.
|
|||||||
info, err := multipart.NewMultipartUpload(ctx, project, bucketName, path, nil)
|
info, err := multipart.NewMultipartUpload(ctx, project, bucketName, path, nil)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
_, err = multipart.PutObjectPart(ctx, project, bucketName, path, info.StreamID, 1, bytes.NewReader(data))
|
_, err = multipart.PutObjectPart(ctx, project, bucketName, path, info.StreamID, 1,
|
||||||
|
etag.NewHashReader(bytes.NewReader(data), sha256.New()))
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
return info.StreamID
|
return info.StreamID
|
||||||
|
@ -6,6 +6,7 @@ package gracefulexit_test
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
|
"crypto/sha256"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -22,6 +23,7 @@ import (
|
|||||||
"storj.io/storj/satellite/metainfo/metabase"
|
"storj.io/storj/satellite/metainfo/metabase"
|
||||||
"storj.io/storj/satellite/overlay"
|
"storj.io/storj/satellite/overlay"
|
||||||
"storj.io/storj/satellite/satellitedb/satellitedbtest"
|
"storj.io/storj/satellite/satellitedb/satellitedbtest"
|
||||||
|
"storj.io/uplink/private/etag"
|
||||||
"storj.io/uplink/private/multipart"
|
"storj.io/uplink/private/multipart"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -59,7 +61,8 @@ func TestChore(t *testing.T) {
|
|||||||
info, err := multipart.NewMultipartUpload(ctx, project, "testbucket", "test/path3", nil)
|
info, err := multipart.NewMultipartUpload(ctx, project, "testbucket", "test/path3", nil)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
_, err = multipart.PutObjectPart(ctx, project, "testbucket", "test/path3", info.StreamID, 1, bytes.NewReader(testrand.Bytes(5*memory.KiB)))
|
_, err = multipart.PutObjectPart(ctx, project, "testbucket", "test/path3", info.StreamID, 1,
|
||||||
|
etag.NewHashReader(bytes.NewReader(testrand.Bytes(5*memory.KiB)), sha256.New()))
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
exitStatusRequest := overlay.ExitStatusRequest{
|
exitStatusRequest := overlay.ExitStatusRequest{
|
||||||
@ -168,7 +171,8 @@ func TestDurabilityRatio(t *testing.T) {
|
|||||||
info, err := multipart.NewMultipartUpload(ctx, project, "testbucket", "test/path2", nil)
|
info, err := multipart.NewMultipartUpload(ctx, project, "testbucket", "test/path2", nil)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
_, err = multipart.PutObjectPart(ctx, project, "testbucket", "test/path2", info.StreamID, 1, bytes.NewReader(testrand.Bytes(5*memory.KiB)))
|
_, err = multipart.PutObjectPart(ctx, project, "testbucket", "test/path2", info.StreamID, 1,
|
||||||
|
etag.NewHashReader(bytes.NewReader(testrand.Bytes(5*memory.KiB)), sha256.New()))
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
exitStatusRequest := overlay.ExitStatusRequest{
|
exitStatusRequest := overlay.ExitStatusRequest{
|
||||||
|
@ -6,6 +6,7 @@ package gracefulexit_test
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
|
"crypto/sha256"
|
||||||
"io"
|
"io"
|
||||||
"strconv"
|
"strconv"
|
||||||
"testing"
|
"testing"
|
||||||
@ -35,6 +36,7 @@ import (
|
|||||||
"storj.io/storj/satellite/overlay"
|
"storj.io/storj/satellite/overlay"
|
||||||
"storj.io/storj/storagenode"
|
"storj.io/storj/storagenode"
|
||||||
"storj.io/storj/storagenode/gracefulexit"
|
"storj.io/storj/storagenode/gracefulexit"
|
||||||
|
"storj.io/uplink/private/etag"
|
||||||
"storj.io/uplink/private/multipart"
|
"storj.io/uplink/private/multipart"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -1104,12 +1106,14 @@ func TestSegmentChangedOrDeletedMultipart(t *testing.T) {
|
|||||||
// TODO: activate when an object part can be overwritten
|
// TODO: activate when an object part can be overwritten
|
||||||
// info0, err := multipart.NewMultipartUpload(ctx, project, "testbucket", "test/path0", nil)
|
// info0, err := multipart.NewMultipartUpload(ctx, project, "testbucket", "test/path0", nil)
|
||||||
// require.NoError(t, err)
|
// require.NoError(t, err)
|
||||||
// _, err = multipart.PutObjectPart(ctx, project, "testbucket", "test/path0", info0.StreamID, 1, bytes.NewReader(testrand.Bytes(5*memory.KiB)))
|
// _, err = multipart.PutObjectPart(ctx, project, "testbucket", "test/path0", info0.StreamID, 1,
|
||||||
|
// etag.NewHashReader(bytes.NewReader(testrand.Bytes(5*memory.KiB)), sha256.New()))
|
||||||
// require.NoError(t, err)
|
// require.NoError(t, err)
|
||||||
|
|
||||||
info1, err := multipart.NewMultipartUpload(ctx, project, "testbucket", "test/path1", nil)
|
info1, err := multipart.NewMultipartUpload(ctx, project, "testbucket", "test/path1", nil)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
_, err = multipart.PutObjectPart(ctx, project, "testbucket", "test/path1", info1.StreamID, 1, bytes.NewReader(testrand.Bytes(5*memory.KiB)))
|
_, err = multipart.PutObjectPart(ctx, project, "testbucket", "test/path1", info1.StreamID, 1,
|
||||||
|
etag.NewHashReader(bytes.NewReader(testrand.Bytes(5*memory.KiB)), sha256.New()))
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
// check that there are no exiting nodes.
|
// check that there are no exiting nodes.
|
||||||
@ -1475,7 +1479,8 @@ func testTransfers(t *testing.T, objects int, multipartObjects int, verifier fun
|
|||||||
info, err := multipart.NewMultipartUpload(ctx, project, "testbucket", objectName, nil)
|
info, err := multipart.NewMultipartUpload(ctx, project, "testbucket", objectName, nil)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
_, err = multipart.PutObjectPart(ctx, project, "testbucket", objectName, info.StreamID, 1, bytes.NewReader(testrand.Bytes(5*memory.KiB)))
|
_, err = multipart.PutObjectPart(ctx, project, "testbucket", objectName, info.StreamID, 1,
|
||||||
|
etag.NewHashReader(bytes.NewReader(testrand.Bytes(5*memory.KiB)), sha256.New()))
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ package metainfo_test
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
|
"crypto/sha256"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
@ -17,6 +18,7 @@ import (
|
|||||||
"storj.io/common/testrand"
|
"storj.io/common/testrand"
|
||||||
"storj.io/storj/private/testplanet"
|
"storj.io/storj/private/testplanet"
|
||||||
"storj.io/storj/satellite/metainfo/metabase"
|
"storj.io/storj/satellite/metainfo/metabase"
|
||||||
|
"storj.io/uplink/private/etag"
|
||||||
"storj.io/uplink/private/multipart"
|
"storj.io/uplink/private/multipart"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -55,7 +57,8 @@ func TestEndpoint_DeletePendingObject(t *testing.T) {
|
|||||||
info, err := multipart.NewMultipartUpload(ctx, project, bucketName, "object-filename", &multipart.UploadOptions{})
|
info, err := multipart.NewMultipartUpload(ctx, project, bucketName, "object-filename", &multipart.UploadOptions{})
|
||||||
require.NoError(t, err, "failed to start multipart upload")
|
require.NoError(t, err, "failed to start multipart upload")
|
||||||
|
|
||||||
_, err = multipart.PutObjectPart(ctx, project, bucketName, bucketName, info.StreamID, 1, bytes.NewReader(data))
|
_, err = multipart.PutObjectPart(ctx, project, bucketName, bucketName, info.StreamID, 1,
|
||||||
|
etag.NewHashReader(bytes.NewReader(data), sha256.New()))
|
||||||
require.NoError(t, err, "failed to put object part")
|
require.NoError(t, err, "failed to put object part")
|
||||||
}
|
}
|
||||||
deleteObject := func(ctx context.Context, t *testing.T, planet *testplanet.Planet) {
|
deleteObject := func(ctx context.Context, t *testing.T, planet *testplanet.Planet) {
|
||||||
@ -112,7 +115,8 @@ func TestEndpoint_DeleteObjectAnyStatus(t *testing.T) {
|
|||||||
info, err := multipart.NewMultipartUpload(ctx, project, bucketName, "object-filename", &multipart.UploadOptions{})
|
info, err := multipart.NewMultipartUpload(ctx, project, bucketName, "object-filename", &multipart.UploadOptions{})
|
||||||
require.NoError(t, err, "failed to start multipart upload")
|
require.NoError(t, err, "failed to start multipart upload")
|
||||||
|
|
||||||
_, err = multipart.PutObjectPart(ctx, project, bucketName, bucketName, info.StreamID, 1, bytes.NewReader(data))
|
_, err = multipart.PutObjectPart(ctx, project, bucketName, bucketName, info.StreamID, 1,
|
||||||
|
etag.NewHashReader(bytes.NewReader(data), sha256.New()))
|
||||||
require.NoError(t, err, "failed to put object part")
|
require.NoError(t, err, "failed to put object part")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ package metainfo_test
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"crypto/sha256"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
@ -34,6 +35,7 @@ import (
|
|||||||
satMetainfo "storj.io/storj/satellite/metainfo"
|
satMetainfo "storj.io/storj/satellite/metainfo"
|
||||||
"storj.io/storj/satellite/metainfo/metabase"
|
"storj.io/storj/satellite/metainfo/metabase"
|
||||||
"storj.io/uplink"
|
"storj.io/uplink"
|
||||||
|
"storj.io/uplink/private/etag"
|
||||||
"storj.io/uplink/private/metainfo"
|
"storj.io/uplink/private/metainfo"
|
||||||
"storj.io/uplink/private/multipart"
|
"storj.io/uplink/private/multipart"
|
||||||
"storj.io/uplink/private/object"
|
"storj.io/uplink/private/object"
|
||||||
@ -1705,7 +1707,8 @@ func TestMultipartObjectDownloadRejection(t *testing.T) {
|
|||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
info, err := multipart.NewMultipartUpload(ctx, project, "pip-second", "multipart-object", nil)
|
info, err := multipart.NewMultipartUpload(ctx, project, "pip-second", "multipart-object", nil)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
_, err = multipart.PutObjectPart(ctx, project, "pip-second", "multipart-object", info.StreamID, 1, bytes.NewReader(data))
|
_, err = multipart.PutObjectPart(ctx, project, "pip-second", "multipart-object", info.StreamID, 1,
|
||||||
|
etag.NewHashReader(bytes.NewReader(data), sha256.New()))
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
_, err = multipart.CompleteMultipartUpload(ctx, project, "pip-second", "multipart-object", info.StreamID, nil)
|
_, err = multipart.CompleteMultipartUpload(ctx, project, "pip-second", "multipart-object", info.StreamID, nil)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
@ -1715,7 +1718,8 @@ func TestMultipartObjectDownloadRejection(t *testing.T) {
|
|||||||
info, err = multipart.NewMultipartUpload(ctx, project, "pip-third", "multipart-object-third", nil)
|
info, err = multipart.NewMultipartUpload(ctx, project, "pip-third", "multipart-object-third", nil)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
for i := 0; i < 4; i++ {
|
for i := 0; i < 4; i++ {
|
||||||
_, err = multipart.PutObjectPart(ctx, project, "pip-third", "multipart-object-third", info.StreamID, i+1, bytes.NewReader(data))
|
_, err = multipart.PutObjectPart(ctx, project, "pip-third", "multipart-object-third", info.StreamID, i+1,
|
||||||
|
etag.NewHashReader(bytes.NewReader(data), sha256.New()))
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
}
|
}
|
||||||
_, err = multipart.CompleteMultipartUpload(ctx, project, "pip-third", "multipart-object-third", info.StreamID, nil)
|
_, err = multipart.CompleteMultipartUpload(ctx, project, "pip-third", "multipart-object-third", info.StreamID, nil)
|
||||||
@ -1813,7 +1817,8 @@ func TestObjectOverrideOnUpload(t *testing.T) {
|
|||||||
// upload pending object
|
// upload pending object
|
||||||
info, err := multipart.NewMultipartUpload(ctx, project, "pip-first", "pending-object", nil)
|
info, err := multipart.NewMultipartUpload(ctx, project, "pip-first", "pending-object", nil)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
_, err = multipart.PutObjectPart(ctx, project, "pip-first", "pending-object", info.StreamID, 1, bytes.NewReader(initialData))
|
_, err = multipart.PutObjectPart(ctx, project, "pip-first", "pending-object", info.StreamID, 1,
|
||||||
|
etag.NewHashReader(bytes.NewReader(initialData), sha256.New()))
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
// upload once again to override
|
// upload once again to override
|
||||||
|
@ -6,6 +6,7 @@ package repair_test
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
|
"crypto/sha256"
|
||||||
"io"
|
"io"
|
||||||
"math"
|
"math"
|
||||||
"testing"
|
"testing"
|
||||||
@ -26,6 +27,7 @@ import (
|
|||||||
"storj.io/storj/satellite/overlay"
|
"storj.io/storj/satellite/overlay"
|
||||||
"storj.io/storj/satellite/repair/checker"
|
"storj.io/storj/satellite/repair/checker"
|
||||||
"storj.io/storj/storage"
|
"storj.io/storj/storage"
|
||||||
|
"storj.io/uplink/private/etag"
|
||||||
"storj.io/uplink/private/multipart"
|
"storj.io/uplink/private/multipart"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -222,7 +224,8 @@ func testDataRepairPendingObject(t *testing.T, inMemoryRepair bool) {
|
|||||||
// upload pending object
|
// upload pending object
|
||||||
info, err := multipart.NewMultipartUpload(ctx, project, "testbucket", "test/path", nil)
|
info, err := multipart.NewMultipartUpload(ctx, project, "testbucket", "test/path", nil)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
_, err = multipart.PutObjectPart(ctx, project, "testbucket", "test/path", info.StreamID, 7, bytes.NewReader(testData))
|
_, err = multipart.PutObjectPart(ctx, project, "testbucket", "test/path", info.StreamID, 7,
|
||||||
|
etag.NewHashReader(bytes.NewReader(testData), sha256.New()))
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
segment, _ := getRemoteSegment(t, ctx, satellite, planet.Uplinks[0].Projects[0].ID, "testbucket")
|
segment, _ := getRemoteSegment(t, ctx, satellite, planet.Uplinks[0].Projects[0].ID, "testbucket")
|
||||||
|
Loading…
Reference in New Issue
Block a user