2021-03-12 12:57:23 +00:00
|
|
|
package tombstonetest
|
|
|
|
|
|
|
|
import (
|
2024-08-26 11:13:20 +00:00
|
|
|
"crypto/rand"
|
|
|
|
|
2023-03-07 10:38:56 +00:00
|
|
|
refstest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/test"
|
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/tombstone"
|
2021-03-12 12:57:23 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func GenerateTombstone(empty bool) *tombstone.Tombstone {
|
|
|
|
m := new(tombstone.Tombstone)
|
|
|
|
|
|
|
|
if !empty {
|
2024-08-26 11:13:20 +00:00
|
|
|
id := make([]byte, 16)
|
|
|
|
_, _ = rand.Read(id)
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
m.SetExpirationEpoch(89)
|
2024-08-26 11:13:20 +00:00
|
|
|
m.SetSplitID(id)
|
2021-06-11 12:45:27 +00:00
|
|
|
m.SetMembers(refstest.GenerateObjectIDs(false))
|
2021-03-12 12:57:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return m
|
|
|
|
}
|