frostfs-sdk-go/container/test/generate.go
Evgenii Stratonikov 9da46f566f
All checks were successful
DCO / DCO (pull_request) Successful in 1m5s
Tests and linters / Tests (1.21) (pull_request) Successful in 1m18s
Tests and linters / Tests (1.22) (pull_request) Successful in 1m24s
Tests and linters / Lint (pull_request) Successful in 2m51s
[#243] go.mod: Update api-go
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-07-26 14:13:49 +03:00

29 lines
696 B
Go

package containertest
import (
"math/rand"
"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"
)
// Container returns random container.Container.
func Container() (x container.Container) {
owner := usertest.ID()
x.Init()
x.SetAttribute("some attribute", "value")
x.SetOwner(owner)
x.SetBasicACL(BasicACL())
x.SetPlacementPolicy(netmaptest.PlacementPolicy())
return x
}
// BasicACL returns random acl.Basic.
func BasicACL() (x acl.Basic) {
x.FromBits(rand.Uint32())
return
}