forked from TrueCloudLab/frostfs-node
[#1085] shard/test: add object integrity check for Evacuate
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
c0f6c988f0
commit
b432ec3a03
1 changed files with 4 additions and 1 deletions
|
@ -4,6 +4,7 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"math/rand"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"testing"
|
"testing"
|
||||||
|
@ -77,6 +78,7 @@ func testEvacuate(t *testing.T, objCount int, hasWriteCache bool) {
|
||||||
size = bsBigObjectSize - headerSize
|
size = bsBigObjectSize - headerSize
|
||||||
}
|
}
|
||||||
data := make([]byte, size)
|
data := make([]byte, size)
|
||||||
|
rand.Read(data)
|
||||||
obj := generateRawObjectWithPayload(cid, data)
|
obj := generateRawObjectWithPayload(cid, data)
|
||||||
objects[i] = obj.Object()
|
objects[i] = obj.Object()
|
||||||
|
|
||||||
|
@ -212,7 +214,8 @@ func checkRestore(t *testing.T, sh *shard.Shard, prm *shard.RestorePrm, objects
|
||||||
require.Equal(t, len(objects), res.Count())
|
require.Equal(t, len(objects), res.Count())
|
||||||
|
|
||||||
for i := range objects {
|
for i := range objects {
|
||||||
_, err := sh.Get(new(shard.GetPrm).WithAddress(objects[i].Address()))
|
res, err := sh.Get(new(shard.GetPrm).WithAddress(objects[i].Address()))
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
require.Equal(t, objects[i], res.Object())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue