driver

package
v0.0.0-...-fb8c843 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: BSD-3-Clause Imports: 31 Imported by: 0

Documentation

Overview

Package driver implements drivers to execute tests.

Package driver implements test drivers for Tast and Autotest tests.

Package driver implements drivers to execute tests.

Package driver implements drivers to execute tests.

Package driver implements drivers to execute tests.

Package driver implements drivers to execute tests.

Package driver implements drivers to execute tests.

Package driver implements drivers to execute tests.

Package driver implements drivers to execute tests.

Package driver implements drivers to execute tests.

Package driver implements drivers to execute tests.

Package driver implements drivers to execute tests.

Package driver implements drivers to execute tests.

Package driver implements drivers to execute tests.

Index

Constants

View Source
const (
	GitMainALDev = "git_main-al-dev"
	GitMain      = "git_main"
)
View Source
const (
	DTS = "dts"
)
View Source
const (
	RawStatusKeyName = "raw_status"
)

Variables

This section is empty.

Functions

func BuildNonXtsTestCommand

func BuildNonXtsTestCommand(logger *log.Logger, testType string, tests []*api.TestCaseMetadata,
	serials []string, metadata *api.ExecutionMetadata, board string, args map[string]string, model string,
	servo *labapi.Servo) []string

func BuildXtsTestCommand

func BuildXtsTestCommand(logger *log.Logger, testType string, tests []*api.TestCaseMetadata,
	serials []string, metadata *api.ExecutionMetadata, board string, args map[string]string, model string,
	servo *labapi.Servo) []string

func GenerateMoblyConfig

func GenerateMoblyConfig(logger *log.Logger, dir string, serials []string, metadata []*api.Arg) (err error)

func ParseArg

func ParseArg(logger *log.Logger, arg *api.Arg, argMap paramMap) paramMap

func ParseDeviceArg

func ParseDeviceArg(logger *log.Logger, arg *api.Arg) deviceParamMap

Types

type AndroidDevice

type AndroidDevice struct {
	Serial string   `yaml:"serial"`
	Role   string   `yaml:"role"`
	Params paramMap `yaml:",inline"`
}

func GenerateAndroidDevices

func GenerateAndroidDevices(serials []string, androidParams deviceParamMap) []*AndroidDevice

type BtReferenceDevice

type BtReferenceDevice struct {
	Hostname string   `yaml:"hostname"`
	Username string   `yaml:"username"`
	Password string   `yaml:"password"`
	Params   paramMap `yaml:",inline"`
}

func GenerateBtReferenceDevices

func GenerateBtReferenceDevices(serials []string, btReferenceParams deviceParamMap) []*BtReferenceDevice

type ConfigParams

type ConfigParams struct {
	// Keyed by `test-params`
	TestParams paramMap
	// Values prefixed by `primary` or `secondary` will only apply to that device.
	// Keyed by `android-params`
	AndroidParams deviceParamMap
	// Values prefixed by `primary-<suffix>` or `secondary-<suffix>` will only apply to that device.
	// Keyed by `openwrt-params`
	OpenWrtParams deviceParamMap
	// Keyed by `btreference-params`
	BtReferenceParams deviceParamMap
}

ConfigParams holds config parameters from ExecutionMetadata Keyed by `config-params`

func ParseMetadata

func ParseMetadata(logger *log.Logger, metadata []*api.Arg) *ConfigParams

type Controllers

type Controllers struct {
	OpenWrtDevices    []*OpenWrtDevice     `yaml:"OpenWrtDevice,omitempty"`
	AndroidDevices    []*AndroidDevice     `yaml:"AndroidDevice,omitempty"`
	BtReferenceDevice []*BtReferenceDevice `yaml:"BtReferenceDevice,omitempty"`
}

type CrosierDriver

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

CrosierDriver runs gtest and report its results.

func NewCrosierDriver

func NewCrosierDriver(logger *log.Logger) *CrosierDriver

NewCrosierDriver creates a new driver to run tests.

func (*CrosierDriver) Name

func (td *CrosierDriver) Name() string

Name returns the name of the driver.

func (*CrosierDriver) RunTests

func (td *CrosierDriver) RunTests(ctx context.Context, resultsDir string, req *api.CrosTestRequest, tlwAddr string, tests []*api.TestCaseMetadata) (*api.CrosTestResponse, error)

RunTests drives a test framework to execute tests.

type Driver

type Driver interface {
	// RunTests drives a test framework to execute tests.
	RunTests(ctx context.Context, resultsDir string, req *api.CrosTestRequest, tlwAddr string, tests []*api.TestCaseMetadata) (*api.CrosTestResponse, error)

	// Name returns the name of the driver.
	Name() string
}

Driver provides common interface to execute Tast and Autotest.

type GtestDriver

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

GtestDriver runs gtest and report its results.

func NewGtestDriver

func NewGtestDriver(logger *log.Logger) *GtestDriver

NewGtestDriver creates a new driver to run tests.

func (*GtestDriver) Name

func (td *GtestDriver) Name() string

Name returns the name of the driver.

func (*GtestDriver) RunTests

func (td *GtestDriver) RunTests(ctx context.Context, resultsDir string, req *api.CrosTestRequest, tlwAddr string, tests []*api.TestCaseMetadata) (*api.CrosTestResponse, error)

RunTests drives a test framework to execute tests.

type Labels

type Labels struct {
	AutotestHostInfoLabels string
}

Labels contains AutotestHostInfoLabels Note, the name is intentionally `AutotestHostInfoLabels` as that is a key string for parsing.

type LuciJSONResult

type LuciJSONResult struct {
	Tr []struct {
		TestID        string  `json:"testId"`
		Name          string  `json:"result_name"`
		Status        string  `json:"status"`
		Expected      bool    `json:"expected"`
		FailureReason string  `json:"failureReason"`
		Duration      float32 `json:"duration"`
		Tags          []struct {
			Key   string `json:"key"`
			Value string `json:"value"`
		} `json:"tags"`
	} `json:"tr"`
}

type MoblyDriver

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

MoblyDriver runs Mobly tests.

func NewMoblyDriver

func NewMoblyDriver(logger *log.Logger) *MoblyDriver

NewMoblyDriver creates a new Mobly driver.

func (*MoblyDriver) Name

func (md *MoblyDriver) Name() string

Name returns the name of the driver.

func (*MoblyDriver) RunTests

func (md *MoblyDriver) RunTests(ctx context.Context, resultsDir string, req *api.CrosTestRequest, tlwAddr string, tests []*api.TestCaseMetadata) (*api.CrosTestResponse, error)

RunTests executes Mobly tests.

type MoblyTestConfig

type MoblyTestConfig struct {
	TestBeds []*TestBed `yaml:"TestBeds"`
}

type Module

type Module struct {
	Name       string             `xml:"name,attr"`
	Abi        string             `xml:"abi,attr"`
	Runtime    string             `xml:"runtime,attr"`
	Done       string             `xml:"done,attr"`
	Pass       string             `xml:"pass,attr"`
	TotalTests string             `xml:"total_tests,attr"`
	TestCases  []TradefedTestCase `xml:"TestCase"`
	Reason     Reason             `xml:"Reason"`
}

type OpenWrtDevice

type OpenWrtDevice struct {
	Hostname string   `yaml:"hostname"`
	Params   paramMap `yaml:",inline"`
}

func GenerateOpenWrtDevices

func GenerateOpenWrtDevices(serials []string, openWrtParams deviceParamMap) []*OpenWrtDevice

type Reason

type Reason struct {
	Message   string `xml:"message,attr"`
	ErrorName string `xml:"error_name,attr"`
	ErrorCode string `xml:"error_code,attr"`
}

type Result

type Result struct {
	// Start time and end time in milliseconds.
	Start    string   `xml:"start,attr"`
	End      string   `xml:"end,attr"`
	BuildNum string   `xml:"suite_build_number,attr"`
	Modules  []Module `xml:"Module"`
}

type TastDriver

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

TastDriver runs tast and report its results.

func NewTastDriver

func NewTastDriver(logger *log.Logger) *TastDriver

NewTastDriver creates a new driver to run tast tests.

func (*TastDriver) Name

func (td *TastDriver) Name() string

Name returns the name of the driver.

func (*TastDriver) RunTests

func (td *TastDriver) RunTests(ctx context.Context, resultsDir string, req *api.CrosTestRequest, tlwAddr string, tests []*api.TestCaseMetadata) (*api.CrosTestResponse, error)

RunTests drives a test framework to execute tests.

type TautoDriver

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

TautoDriver runs Tauto and report its results.

func NewTautoDriver

func NewTautoDriver(logger *log.Logger) *TautoDriver

NewTautoDriver creates a new driver to run tests.

func (*TautoDriver) Name

func (td *TautoDriver) Name() string

Name returns the name of the driver.

func (*TautoDriver) RunTests

func (td *TautoDriver) RunTests(ctx context.Context, resultsDir string, req *api.CrosTestRequest, tlwAddr string, tests []*api.TestCaseMetadata) (*api.CrosTestResponse, error)

RunTests drives a test framework to execute tests.

type TestBed

type TestBed struct {
	Name        string       `yaml:"Name"`
	TestParams  *TestParams  `yaml:"TestParams"`
	Controllers *Controllers `yaml:"Controllers"`
}

type TestParams

type TestParams struct {
	Params paramMap `yaml:",inline"`
}

type TradeFedTest

type TradeFedTest struct {
	Result  string `xml:"result,attr"`
	Abi     string
	Name    string              `xml:"name,attr"`
	Failure TradeFedTestFailure `xml:"Failure"`
}

type TradeFedTestFailure

type TradeFedTestFailure struct {
	Message    string `xml:"message,attr"`
	StackTrace string `xml:"StackTrace"`
}

type TradefedDriver

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

func NewTradefedDriver

func NewTradefedDriver(logger *log.Logger) *TradefedDriver

func (*TradefedDriver) Name

func (td *TradefedDriver) Name() string

func (*TradefedDriver) RunTests

func (td *TradefedDriver) RunTests(ctx context.Context, resultsDir string, req *api.CrosTestRequest, tlwAddr string, tests []*api.TestCaseMetadata) (*api.CrosTestResponse, error)

RunTests drives a test framework to execute tests.

type TradefedTestCase

type TradefedTestCase struct {
	Name  string         `xml:"name,attr"`
	Tests []TradeFedTest `xml:"Test"`
}

type Type

type Type struct {
	Device string `json:"device,omitempty"`
	Driver string `json:"driver,omitempty"`
}

Jump to

Keyboard shortcuts

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