[#106] test: Generate correct data for tests
All checks were successful
DCO action / DCO (pull_request) Successful in 46s
Tests and linters / Tests (1.23) (pull_request) Successful in 1m2s
Tests and linters / Tests (1.22) (pull_request) Successful in 1m5s
Tests and linters / Lint (pull_request) Successful in 1m8s
Tests and linters / Tests with -race (pull_request) Successful in 1m18s

Signed-off-by: Aleksey Savchuk <a.savchuk@yadro.com>
This commit is contained in:
Aleksey Savchuk 2024-08-26 14:13:20 +03:00
parent 5e1c6a908f
commit 5e7a15f3f1
5 changed files with 68 additions and 17 deletions

View file

@ -1,6 +1,8 @@
package tombstonetest
import (
"crypto/rand"
refstest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/test"
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/tombstone"
)
@ -9,8 +11,11 @@ func GenerateTombstone(empty bool) *tombstone.Tombstone {
m := new(tombstone.Tombstone)
if !empty {
id := make([]byte, 16)
_, _ = rand.Read(id)
m.SetExpirationEpoch(89)
m.SetSplitID([]byte{3, 2, 1})
m.SetSplitID(id)
m.SetMembers(refstest.GenerateObjectIDs(false))
}