cmd

package
v0.0.0-...-e560ebb Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FetchCrashes = &subcommands.Command{
	UsageLine: "fetch-crashes -input_json /path/to/input.json -output_json /path/to/output.json",
	ShortDesc: "Fetch crashes from a DUT, optionally uploading them to http://crash/.",
	LongDesc: `Fetch crashes from a DUT, optionally uploading them to http://crash/.

Uses the TLS FetchCrashes API to retrieve crashes from a specified DUT and,
depending on settings in the input proto, may upload them to http://crash/ for
internal debugging.`,
	CommandRun: func() subcommands.CommandRun {
		c := &fetchCrashesRun{}
		c.Flags.StringVar(&c.InputPath, "input_json", "", "Path that contains JSON encoded test_platform.phosphorus.FetchCrashesRequest")
		c.Flags.StringVar(&c.OutputPath, "output_json", "", "Path to write JSON encoded test_platform.phosphorus.FetchCrashesResponse to")
		return c
	},
}

FetchCrashes subcommand: fetches crashes from a DUT, optionally uploading them.

View Source
var Prejob = &subcommands.Command{
	UsageLine: "prejob -input_json /path/to/input.json",
	ShortDesc: "Run a prejob against a DUT.",
	LongDesc: `Run a prejob against a DUT.

Provision the DUT via 'autoserv --provision' if desired provisionable labels
do not match the existing ones. Otherwise, reset the DUT via
'autosev --reset'`,
	CommandRun: func() subcommands.CommandRun {
		c := &prejobRun{}
		c.Flags.StringVar(&c.InputPath, "input_json", "", "Path that contains JSON encoded test_platform.phosphorus.PrejobRequest")
		c.Flags.StringVar(&c.OutputPath, "output_json", "", "Path to write JSON encoded test_platform.phosphorus.PrejobResponse to")
		return c
	},
}

Prejob subcommand: Run a prejob (e.g. provision) against a DUT.

View Source
var RunTest = &subcommands.Command{
	UsageLine: "run-test -input_json /path/to/input.json",
	ShortDesc: "Run a test against one or multiple DUTs.",
	LongDesc: `Run a test against one or multiple DUTs.

A wrapper around 'autoserv'.`,
	CommandRun: func() subcommands.CommandRun {
		c := &runTestRun{}
		c.Flags.StringVar(&c.InputPath, "input_json", "", "Path that contains JSON encoded test_platform.phosphorus.RunTestRequest")
		c.Flags.StringVar(&c.OutputPath, "output_json", "", "Path to write JSON encoded test_platform.phosphorus.RunTestResponse to")
		return c
	},
}

RunTest subcommand: Run a test against one or multiple DUTs.

View Source
var UploadToTKO = &subcommands.Command{
	UsageLine: "upload-to-tko -input_json /path/to/input.json",
	ShortDesc: "Parse test results and upload them to TKO.",
	LongDesc: `Parse test results and upload them to TKO.

A wrapper around 'tko/parse'.`,
	CommandRun: func() subcommands.CommandRun {
		c := &uploadToTKORun{}
		c.Flags.StringVar(&c.InputPath, "input_json", "", "Path that contains JSON encoded test_platform.phosphorus.UploadToTkoRequest")
		return c
	},
}

UploadToTKO subcommand: Parse test results and upload them to TKO.

Functions

func ReadJSONPB

func ReadJSONPB(inFile string, payload proto.Message) error

ReadJSONPB reads a JSON string from inFile and unpacks it as a proto. Unexpected fields are ignored.

func UploadToGS

func UploadToGS(authOpts auth.Options) *subcommands.Command

UploadToGS subcommand: Upload selected directory to Google Storage.

func WriteJSONPB

func WriteJSONPB(outFile string, payload proto.Message) error

WriteJSONPB writes a JSON encoded proto to outFile.

Types

type CommonRun

type CommonRun struct {
	subcommands.CommandRunBase

	AuthFlags  authcli.Flags
	InputPath  string
	OutputPath string
}

CommonRun provides the basis for a command that accepts a protobuf as input and optionally produces a protobuf as output. It should be embedded in another struct that implements Run().

func (*CommonRun) ValidateArgs

func (c *CommonRun) ValidateArgs() error

ValidateArgs performs common validation.

Jump to

Keyboard shortcuts

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