Aleksey Savchuk
9c5e32a183
All checks were successful
DCO action / DCO (pull_request) Successful in 42s
Tests and linters / Tests (1.22) (pull_request) Successful in 1m2s
Tests and linters / Tests (1.23) (pull_request) Successful in 1m1s
Tests and linters / Lint (pull_request) Successful in 1m6s
Tests and linters / Tests with -race (pull_request) Successful in 1m14s
Some tests are using invalid data that do not meet the requirements of the FrostFS protocol, e.g. - Container/Object IDs aren't 32 bytes long - Signature key and sign have invalid length - Split IDs aren't valid UUIDv4 and etc. Signed-off-by: Aleksey Savchuk <a.savchuk@yadro.com>
23 lines
446 B
Go
23 lines
446 B
Go
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"
|
|
)
|
|
|
|
func GenerateTombstone(empty bool) *tombstone.Tombstone {
|
|
m := new(tombstone.Tombstone)
|
|
|
|
if !empty {
|
|
id := make([]byte, 16)
|
|
_, _ = rand.Read(id)
|
|
|
|
m.SetExpirationEpoch(89)
|
|
m.SetSplitID(id)
|
|
m.SetMembers(refstest.GenerateObjectIDs(false))
|
|
}
|
|
|
|
return m
|
|
}
|