2021-11-08 12:25:13 +00:00
|
|
|
package containertest
|
|
|
|
|
|
|
|
import (
|
2022-06-21 09:42:18 +00:00
|
|
|
"math/rand"
|
|
|
|
|
2023-03-07 11:20:03 +00:00
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container"
|
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/acl"
|
|
|
|
netmaptest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap/test"
|
|
|
|
usertest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/user/test"
|
2021-11-08 12:25:13 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// Container returns random container.Container.
|
2022-06-25 09:54:42 +00:00
|
|
|
func Container() (x container.Container) {
|
|
|
|
owner := usertest.ID()
|
2021-11-08 12:25:13 +00:00
|
|
|
|
2022-06-25 09:54:42 +00:00
|
|
|
x.Init()
|
|
|
|
x.SetAttribute("some attribute", "value")
|
2023-11-21 08:35:10 +00:00
|
|
|
x.SetOwner(owner)
|
2022-06-20 15:28:27 +00:00
|
|
|
x.SetBasicACL(BasicACL())
|
2022-06-25 09:54:42 +00:00
|
|
|
x.SetPlacementPolicy(netmaptest.PlacementPolicy())
|
2021-11-08 12:25:13 +00:00
|
|
|
|
|
|
|
return x
|
|
|
|
}
|
|
|
|
|
2022-06-20 15:28:27 +00:00
|
|
|
// BasicACL returns random acl.Basic.
|
|
|
|
func BasicACL() (x acl.Basic) {
|
2022-06-21 09:42:18 +00:00
|
|
|
x.FromBits(rand.Uint32())
|
2022-06-20 15:28:27 +00:00
|
|
|
return
|
|
|
|
}
|