Documentation ¶
Overview ¶
Package atutil provides a higher level Autotest interface than the autotest package.
Index ¶
- func AddProvisionDetailsToHostInfoFile(ctx context.Context, bt *tls.BackgroundTLS, ...) error
- func HostInfoFilePath(rootDir, host string) string
- func LinkHostInfoFile(srcResultsDir, dstResultDir, host string) error
- func TKOParse(c autotest.Config, resultsDir string, w io.Writer) (failed int, err error)
- type AdminTask
- type AdminTaskType
- type AutoservJob
- type HostInfo
- type MainJob
- type Provision
- type Result
- type Test
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HostInfoFilePath ¶
func LinkHostInfoFile ¶
LinkHostInfoFile prepares the host info store by linking the host file in the dstResultDir to the srcResultsDir. It is intended as an alternative to prepareHostInfo, which contains autoserv-specific logic and does not work for TLS.
Types ¶
type AdminTask ¶
type AdminTask struct { Type AdminTaskType Host string ResultsDir string }
AdminTask represents an admin task to run. AdminTask implements AutoservJob.
func (*AdminTask) AutoservArgs ¶
func (t *AdminTask) AutoservArgs() *autotest.AutoservArgs
AutoservArgs represents the CLI args for `autoserv`.
type AdminTaskType ¶
type AdminTaskType int
AdminTaskType is an enum used in AdminTask to determine what type of admin task to run.
const ( // NoTask can be used as a null AdminTaskType value. NoTask AdminTaskType = iota // Verify represents `autoserv -v`. Verify // Cleanup represents `autoserv --cleanup`. Cleanup // Reset represents `autoserv --reset`. Reset // Repair represents `autoserv -R`. Repair )
func (AdminTaskType) String ¶
func (i AdminTaskType) String() string
type AutoservJob ¶
type AutoservJob interface {
AutoservArgs() *autotest.AutoservArgs
}
AutoservJob describes the interface a job object needs to be passed to RunAutoserv.
type HostInfo ¶
type HostInfo struct { Attributes map[string]string `json:"attributes"` Labels []string `json:"labels"` SerializerVersion int `json:"serializer_version,omitempty"` StableVersions map[string]string `json:"stable_versions"` }
HostInfo is a struct providing a mapping to an autotest host_info file.
type MainJob ¶
MainJob describes the overall job, which dictates certain job global settings for running autoserv.
type Provision ¶
Provision represents a provision task to run. Provision implements AutoservJob.
func (*Provision) AutoservArgs ¶
func (p *Provision) AutoservArgs() *autotest.AutoservArgs
AutoservArgs represents the CLI args for `autoserv`.
type Result ¶
type Result struct { osutil.RunResult // Exit is the exit status for the autoserv command, if // autoserv was run. Exit int TestsFailed int }
Result contains information about RunAutoserv results.
func RunAutoserv ¶
func RunAutoserv(ctx context.Context, m *MainJob, j AutoservJob, w io.Writer) (r *Result, err error)
RunAutoserv runs an autoserv task.
This function always returns a non-nil Result, but some fields may not be meaningful. For example, Result.Exit will be 0 even if autoserv could not be run. In this case, Result.Started will be false and an error will also returned.
Output is written to the Writer.
Result.TestsFailed may not be set, depending on AutoservJob. An error is not returned for test failures.
type Test ¶
type Test struct { Args string ClientTest bool ControlFile string ControlName string ExecutionTag string Hosts []string Keyvals map[string]string Name string Owner string ParentJobID int RequireSSP bool ResultsDir string SSPBaseImageName string TestSourceBuild string }
Test represents a test to run. Test implements AutoservJob.
func (*Test) AutoservArgs ¶
func (t *Test) AutoservArgs() *autotest.AutoservArgs
AutoservArgs represents the CLI args for `autoserv`.
func (*Test) JobKeyvals ¶
JobKeyvals returns the autotest keyvals.