common

package
v0.0.0-...-0342304 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package common provide command utilities and variables for all components in cros-test to use.

Package common provide command utilities and variables for all components in cros-test to use.

Package common provide command utilities and variables for all components in cros-test to use.

Package driver implements drivers to execute tests.

Index

Constants

View Source
const (
	TestExecServerRoot  = "/tmp/test/cros-test"
	TestRequestJSONFile = "request.json"
	TestResultJSONFile  = "result.json"
	TestResultDir       = "/tmp/test/results"
	TestMetadataDir     = "/tmp/test/metadata"
	AutotestDir         = "/usr/local/autotest/"
)

Constants for different components to use.

View Source
const NO_STATUS = "----"
View Source
const START = "START"

Variables

This section is empty.

Functions

func Companions

func Companions(devices []*api.CrosTestRequest_Device) (chromeOSCompanions []*device.DutInfo,
	AndriodCompanions []*device.AndroidInfo, err error)

Companions separates devices to ChromeOS devices and Android devices.

func ConvertDutTopologyToHostInfo

func ConvertDutTopologyToHostInfo(dut *device.DutInfo) (map[string]string, []string, error)

ConvertDutTopologyToHostInfo returns attr map, label list for the attr/labels from the dut info.

func ExtraArgs

func ExtraArgs(req *api.CrosTestRequest) (args []*api.Arg)

ExtraArgs upacks the extra arguements from test reqeusts.

func PublishTkoStatusFile

func PublishTkoStatusFile(resultsDir string, results []*api.TestCaseResult) error

PublishTkoStatusFile publishes the responseProto into a TKO status log in the given resultsDirectory.

func TestScanner

func TestScanner(stream io.Reader, logger *log.Logger, harness string)

TestScanner makes a scanner to read from test streams.

func UnpackMetadata

func UnpackMetadata(req *api.CrosTestRequest) (args []*api.Arg, resultsRootDir string, err error)

UnpackMetadata unpacks the Any metadata field into AutotestExecutionMetadata

func WriteHostInfoToFile

func WriteHostInfoToFile(resultsDir string, hostname string, dut *device.DutInfo, log *log.Logger) error

WriteHostInfoToFile writes the host_info_store file based off dutinfo to ResutsDir

Types

type HostInfo

type HostInfo struct {
	Attributes map[string]string `json:"attributes"`
	Labels     []string          `json:"labels"`
}

HostInfo struct is the attr/label struct used to write a mimicd host info file.

Jump to

Keyboard shortcuts

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