helpers

package
v0.0.0-...-65069d1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Commonly used base-keys in the dynamic
	// lookup table.
	InstallPath  = LookupKey("installPath")
	Board        = LookupKey("board")
	AndroidBoard = LookupKey("androidBoard")
)

Functions

func DefaultAndroidProvisionInstallRequest

func DefaultAndroidProvisionInstallRequest() *interfaces.ProvisionTaskInstallRequest

DefaultAndroidProvisionInstallRequest sets up a android-provision request.

func DefaultCrosProvisionInstallRequest

func DefaultCrosProvisionInstallRequest(installPath string) *interfaces.ProvisionTaskInstallRequest

DefaultCrosProvisionInstallRequest sets up a cros-provision request with an empty metadata field, solely passing along the installPath.

func DefaultProvisionStartUpRequest

func DefaultProvisionStartUpRequest(deviceId *common.DeviceIdentifier) *interfaces.ProvisionTaskStartUpRequest

DefaultProvisionStartUpRequest outlines the default values typically required for starting up a provision task.

func GenerateProvisionRequest

func GenerateProvisionRequest(
	req *api.InternalTestplan,
	taskId *common.TaskIdentifier,
	deviceId *common.DeviceIdentifier,
	provisionContainers []*builders.ContainerBuilder,
	provisionInstallRequest *interfaces.ProvisionTaskInstallRequest) error

GenerateProvisionRequest provides some defaults for a provision request, while also requiring some variable inputs between differing flavors.

func NewAndroidProvisionContainer

func NewAndroidProvisionContainer(taskId *common.TaskIdentifier) *builders.ContainerBuilder

func NewCrosDutContainer

func NewCrosDutContainer(deviceId *common.DeviceIdentifier) *builders.ContainerBuilder

func NewCrosProvisionContainer

func NewCrosProvisionContainer(ContainerId *common.TaskIdentifier) *builders.ContainerBuilder

Types

type AndroidProvisionLookupValues

type AndroidProvisionLookupValues struct {
	Board string
}

AndroidProvisionLookupValues adds a concrete helper layer for defining which values are being loaded into the dynamic lookup table.

type CrosProvisionLookupValues

type CrosProvisionLookupValues struct {
	Board       string
	InstallPath string
}

CrosProvisionLookupValues adds a concrete helper layer for defining which values are being loaded into the dynamic lookup table.

type DynamicProvisionHelper

type DynamicProvisionHelper struct {
	// contains filtered or unexported fields
}

DynamicProvisionHelper tracks the count of provision types relating to lookup keys.

func NewDynamicProvisionHelper

func NewDynamicProvisionHelper() *DynamicProvisionHelper

NewDynamicProvisionHelper creates an initialized helper with counts set to 0.

func (*DynamicProvisionHelper) ApplyAndroidProvisionToLookup

func (LH *DynamicProvisionHelper) ApplyAndroidProvisionToLookup(lookupTable map[string]string, values *AndroidProvisionLookupValues)

ApplyAndroidProvisionToLookup adds the android provision lookup values to the lookup table using the globally defined common lookup keys. Increments the counter.

func (*DynamicProvisionHelper) ApplyCrosProvisionToLookup

func (LH *DynamicProvisionHelper) ApplyCrosProvisionToLookup(lookupTable map[string]string, values *CrosProvisionLookupValues)

ApplyCrosProvisionToLookup adds the cros provision lookup values to the lookup table using the globally defined common lookup keys. Increments the counter.

func (*DynamicProvisionHelper) GenerateProvisionRequest

func (LH *DynamicProvisionHelper) GenerateProvisionRequest(req *api.InternalTestplan, swarmingDef *api.SwarmingDefinition, isPrimary bool) error

type LookupKey

type LookupKey string

LookupKey is a string wrapper that helps with defining the keys that are used within the dynamic lookup tables.

func (LookupKey) AsKey

func (L LookupKey) AsKey() string

AsKey is intended for when adding a value to the lookup table.

func (LookupKey) AsPlaceholder

func (L LookupKey) AsPlaceholder() string

AsPlaceholder is intended when calling upon the lookup key for defining a dynamic update.

func (LookupKey) WithIndex

func (L LookupKey) WithIndex(idx int) LookupKey

WithIndex is intended for multi-dut use, where multiple duts may use the same base lookup key but should be marked with an index to indicate being the 2nd or 3rd o this key.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL