forked from TrueCloudLab/frostfs-api-go
Aleksey Savchuk
9c5e32a183
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
|
|
}
|