Documentation ¶
Index ¶
- Constants
- Variables
- func AccAddress(t testing.TB) sdk.AccAddress
- func Attribute(t testing.TB) types.Attribute
- func Attributes(t testing.TB) []types.Attribute
- func AuditedProvider(t testing.TB) (atypes.ProviderID, atypes.Provider)
- func BidID(t testing.TB) mtypes.BidID
- func BidIDForAccount(t testing.TB, owner, provider sdk.Address) mtypes.BidID
- func CertificateRequireEqualResponse(t *testing.T, cert TestCertificate, resp types.CertificateResponse, ...)
- func ChannelWaitForValue(t *testing.T, waitOn interface{}) interface{}
- func ChannelWaitForValueUpTo(t *testing.T, waitOn interface{}, waitFor time.Duration) interface{}
- func Coin(t testing.TB) sdk.Coin
- func DefaultConfig() network.Config
- func Deployment(t testing.TB) dtypes.Deployment
- func DeploymentGroup(t testing.TB, did dtypes.DeploymentID, gseq uint32) dtypes.Group
- func DeploymentGroups(t testing.TB, did dtypes.DeploymentID, gseq uint32) []dtypes.Group
- func DeploymentID(t testing.TB) dtypes.DeploymentID
- func DeploymentIDForAccount(t testing.TB, addr sdk.Address) dtypes.DeploymentID
- func DeploymentVersion(t testing.TB) []byte
- func GroupID(t testing.TB) dtypes.GroupID
- func GroupIDForAccount(t testing.TB, addr sdk.Address) dtypes.GroupID
- func GroupSpec(t testing.TB) dtypes.GroupSpec
- func Hostname(t testing.TB) string
- func Keyring(t testing.TB) keyring.Keyring
- func LeaseID(t testing.TB) mtypes.LeaseID
- func LeaseIDForAccount(t testing.TB, owner, provider sdk.Address) mtypes.LeaseID
- func Logger(t testing.TB) log.Logger
- func Name(_ testing.TB, prefix string) string
- func NewApp(val network.Validator) servertypes.Application
- func NewServer(t testing.TB, qclient virtengineclient.QueryClient, handler http.Handler, ...) *httptest.Server
- func OrderID(t testing.TB) mtypes.OrderID
- func OrderIDForAccount(t testing.TB, addr sdk.Address) mtypes.OrderID
- func ParseDeploymentEvent(t testing.TB, events []abci.Event) sdkutil.ModuleEvent
- func ParseEvent(t testing.TB, events []abci.Event) sdkutil.Event
- func ParseMarketEvent(t testing.TB, events []abci.Event) sdkutil.ModuleEvent
- func ParseProviderEvent(t testing.TB, events []abci.Event) sdkutil.ModuleEvent
- func PlacementRequirements(t testing.TB) types.PlacementRequirements
- func Provider(t testing.TB) ptypes.Provider
- func ProviderHostname(t testing.TB) string
- func RandCPUUnits() uint
- func RandMemoryQuantity() uint64
- func RandRangeInt(min, max int) int
- func RandRangeUint(min, max uint) uint
- func RandRangeUint64(min, max uint64) uint64
- func RandStorageQuantity() uint64
- func ResourceUnits(_ testing.TB) types.ResourceUnits
- func Resources(t testing.TB) []dtypes.Resource
- func VirtEngineCoin(t testing.TB, amount int64) sdk.Coin
- func VirtEngineCoinRandom(t testing.TB) sdk.Coin
- type CertificateOption
- type ManifestGenerator
- type TestCertificate
Constants ¶
const ( CoinDenom = "uve" BechPrefix = "virtengine" )
CoinDenom provides ability to create coins in test functions and pass them into testutil functionality.
Variables ¶
var ( // DefaultManifestGenerator is the default test manifest generator DefaultManifestGenerator = RandManifestGenerator // ManifestGenerators is a list of all available manifest generators ManifestGenerators = []struct { Name string Generator ManifestGenerator }{ {"overflow", OverflowManifestGenerator}, {"random", RandManifestGenerator}, {"app", AppManifestGenerator}, } )
var AuthVersionOID = asn1.ObjectIdentifier{2, 23, 133, 2, 6}
var DefaultDeploymentVersion = sha256.Sum256([]byte(sum256Seed))
DefaultDeploymentVersion provides consistent sha256 sum for initial Deployment.Version
Functions ¶
func AccAddress ¶
func AccAddress(t testing.TB) sdk.AccAddress
AccAddress provides an Account's Address bytes from a ed25519 generated private key.
func Attributes ¶
Attributes generates a set of sdk.Attribute
func AuditedProvider ¶
func CertificateRequireEqualResponse ¶
func CertificateRequireEqualResponse(t *testing.T, cert TestCertificate, resp types.CertificateResponse, state types.Certificate_State)
func ChannelWaitForValue ¶
func ChannelWaitForValueUpTo ¶
func DefaultConfig ¶
DefaultConfig returns a default configuration suitable for nearly all testing requirements.
func Deployment ¶
func Deployment(t testing.TB) dtypes.Deployment
Deployment generates a dtype.Deployment in state `DeploymentActive`
func DeploymentGroup ¶
DeploymentGroup generates a dtype.DepDeploymentGroup in state `GroupOpen` with a set of random required attributes
func DeploymentGroups ¶
DeploymentGroups returns a set of deployment groups generated by DeploymentGroup
func DeploymentID ¶
func DeploymentID(t testing.TB) dtypes.DeploymentID
func DeploymentIDForAccount ¶
func DeploymentVersion ¶
DeploymentVersion provides a random sha256 sum for simulating Deployments.
func LeaseIDForAccount ¶
func NewApp ¶
func NewApp(val network.Validator) servertypes.Application
func NewServer ¶
func NewServer(t testing.TB, qclient virtengineclient.QueryClient, handler http.Handler, certs []tls.Certificate) *httptest.Server
func ParseDeploymentEvent ¶
func ParseMarketEvent ¶
func ParseProviderEvent ¶
func PlacementRequirements ¶
func PlacementRequirements(t testing.TB) types.PlacementRequirements
PlacementRequirements generates placement requirements
func ProviderHostname ¶
func RandCPUUnits ¶
func RandCPUUnits() uint
func RandMemoryQuantity ¶
func RandMemoryQuantity() uint64
func RandRangeInt ¶
func RandRangeUint ¶
func RandRangeUint64 ¶
func RandStorageQuantity ¶
func RandStorageQuantity() uint64
func ResourceUnits ¶
func ResourceUnits(_ testing.TB) types.ResourceUnits
func VirtEngineCoin ¶
VirtEngineCoin provides simple interface to the VirtEngine sdk.Coin type.
Types ¶
type CertificateOption ¶
type CertificateOption func(*certificateOption)
func CertificateOptionDomains ¶
func CertificateOptionDomains(domains []string) CertificateOption
func CertificateOptionMocks ¶
func CertificateOptionMocks(val *mocks.QueryClient) CertificateOption
func CertificateOptionNotAfter ¶
func CertificateOptionNotAfter(tm time.Time) CertificateOption
func CertificateOptionNotBefore ¶
func CertificateOptionNotBefore(tm time.Time) CertificateOption
type ManifestGenerator ¶
type ManifestGenerator interface { Manifest(t testing.TB) manifest.Manifest Group(t testing.TB) manifest.Group Service(t testing.TB) manifest.Service ServiceExpose(t testing.TB) manifest.ServiceExpose }
ManifestGenerator is an interface for generating test manifests
var AppManifestGenerator ManifestGenerator = manifestGeneratorApp{}
AppManifestGenerator represents a real-world, deployable configuration.
var OverflowManifestGenerator ManifestGenerator = manifestGeneratorOverflow{}
OverflowManifestGenerator generates a manifest maximum integer values
var RandManifestGenerator ManifestGenerator = manifestGeneratorRand{}
RandManifestGenerator generates a manifest with random values
type TestCertificate ¶
type TestCertificate struct { Cert []tls.Certificate Serial big.Int PEM struct { Cert []byte Priv []byte Pub []byte } }
func Certificate ¶
func Certificate(t testing.TB, addr sdk.Address, opts ...CertificateOption) TestCertificate