forked from TrueCloudLab/frostfs-s3-gw
[#623] Fix using copy numbers during multipart
Signed-off-by: Denis Kirillov <d.kirillov@yadro.com>
This commit is contained in:
parent
a53e50b324
commit
da9703ab63
5 changed files with 72 additions and 20 deletions
|
@ -76,6 +76,7 @@ var _ frostfs.FrostFS = (*TestFrostFS)(nil)
|
|||
|
||||
type TestFrostFS struct {
|
||||
objects map[string]*object.Object
|
||||
copiesNumbers map[string][]uint32
|
||||
objectErrors map[string]error
|
||||
objectPutErrors map[string]error
|
||||
containers map[string]*container.Container
|
||||
|
@ -88,6 +89,7 @@ type TestFrostFS struct {
|
|||
func NewTestFrostFS(key *keys.PrivateKey) *TestFrostFS {
|
||||
return &TestFrostFS{
|
||||
objects: make(map[string]*object.Object),
|
||||
copiesNumbers: make(map[string][]uint32),
|
||||
objectErrors: make(map[string]error),
|
||||
objectPutErrors: make(map[string]error),
|
||||
containers: make(map[string]*container.Container),
|
||||
|
@ -126,6 +128,10 @@ func (t *TestFrostFS) Objects() []*object.Object {
|
|||
return res
|
||||
}
|
||||
|
||||
func (t *TestFrostFS) CopiesNumbers(addr string) []uint32 {
|
||||
return t.copiesNumbers[addr]
|
||||
}
|
||||
|
||||
func (t *TestFrostFS) ObjectExists(objID oid.ID) bool {
|
||||
for _, obj := range t.objects {
|
||||
if id, _ := obj.ID(); id.Equals(objID) {
|
||||
|
@ -346,6 +352,8 @@ func (t *TestFrostFS) CreateObject(ctx context.Context, prm frostfs.PrmObjectCre
|
|||
|
||||
addr := newAddress(cnrID, objID)
|
||||
t.objects[addr.EncodeToString()] = obj
|
||||
t.copiesNumbers[addr.EncodeToString()] = prm.CopiesNumber
|
||||
|
||||
return &frostfs.CreateObjectResult{
|
||||
ObjectID: objID,
|
||||
CreationEpoch: t.currentEpoch - 1,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue