tasks

package
v0.0.0-...-3c039c4 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: 43 Imported by: 0

Documentation

Overview

Package tasks contains subcommands for mallet.

Index

Constants

This section is empty.

Variables

View Source
var BatteryCutOff = &subcommands.Command{
	UsageLine: "battery-cut-off",
	ShortDesc: "battery-cut-off describe in b/268089647#comment38",
	CommandRun: func() subcommands.CommandRun {
		c := &BatteryCutOffRun{}
		c.authFlags.Register(&c.Flags, site.DefaultAuthOptions)
		c.envFlags.Register(&c.Flags)
		c.Flags.BoolVar(&c.latest, "latest", true, "Use latest version of CIPD when scheduling. By default yes.")
		c.Flags.StringVar(&c.adminSession, "admin-session", "", "Admin session used to group created tasks. By default generated.")
		return c
	},
}

Recovery devices requires battery cut-off.

View Source
var CustomProvision = &subcommands.Command{
	UsageLine: "provision DUT1 DUT2 DUT3 ...",
	ShortDesc: "Quick provision ChromeOS device(s).",
	LongDesc:  "Quick provision ChromeOS device(s). Tool allows provide custom values for provisioning.",
	CommandRun: func() subcommands.CommandRun {
		c := &customProvisionRun{}
		c.authFlags.Register(&c.Flags, site.DefaultAuthOptions)
		c.envFlags.Register(&c.Flags)
		c.Flags.StringVar(&c.osName, "os", "", "ChromeOS version name like eve-release/R86-13380.0.0")
		c.Flags.StringVar(&c.osPath, "os-path", "", "GS path to where the payloads are located. Example: gs://chromeos-image-archive/eve-release/R86-13380.0.0")
		c.Flags.StringVar(&c.adminSession, "admin-session", "", "Admin session used to group created tasks. By default generated.")
		c.Flags.BoolVar(&c.noReboot, "no-reboot", false, "prevent reboot during the provision.")
		c.Flags.BoolVar(&c.latest, "latest", false, "Use latest version of CIPD when scheduling. By default no.")
		return c
	},
}

Recovery subcommand: Recovering the devices.

View Source
var DeepRepair = &subcommands.Command{
	UsageLine: "deep-repair",
	ShortDesc: "Schedule deep repair task.",
	CommandRun: func() subcommands.CommandRun {
		c := &fwUpdateRun{}
		c.authFlags.Register(&c.Flags, site.DefaultAuthOptions)
		c.envFlags.Register(&c.Flags)
		c.Flags.StringVar(&c.gbbFlag, "flag", "0x18", "GBB flag")
		c.Flags.BoolVar(&c.latest, "latest", false, "Use latest version of CIPD when scheduling. By default no.")
		c.Flags.StringVar(&c.adminSession, "admin-session", "", "Admin session used to group created tasks. By default generated.")
		return c
	},
}

Recovery subcommand: Deep repair task

View Source
var DownloadToUsbDrive = &subcommands.Command{
	UsageLine: "usb-download",
	ShortDesc: "Download image to servo USB-drive.",
	LongDesc:  "Download image to servo USB-drive.",
	CommandRun: func() subcommands.CommandRun {
		c := &downloadToUsbDriveRun{}
		c.authFlags.Register(&c.Flags, site.DefaultAuthOptions)
		c.envFlags.Register(&c.Flags)
		c.Flags.StringVar(&c.imageName, "image", "", "ChromeOS version name like eve-release/R86-13380.0.0")
		c.Flags.StringVar(&c.gsImagePath, "gs-path", "", "GS path to where the payloads are located. Example: gs://chromeos-image-archive/eve-release/R86-13380.0.0")
		return c
	},
}

Recovery subcommand: Recovering the devices.

View Source
var EthernetHook = &subcommands.Command{
	UsageLine: "ethernet-hook",
	ShortDesc: "ethernet-hook",
	LongDesc:  `ethernet-hook prints ethernet hook events for a single day.`,
	CommandRun: func() subcommands.CommandRun {
		c := &ethernetHookRun{}
		c.authFlags.Register(&c.Flags, site.EthernetHookCallbackOptions)
		c.commonFlags.Register(&c.Flags)
		c.Flags.StringVar(&c.bucket, "bucket", "chromeos-test-logs", "the base GS bucket to check for logs")
		c.Flags.StringVar(&c.prefix, "prefix", "", "prefix of the objects in question")
		c.Flags.StringVar(&c.delimiter, "delimiter", "", "delimiter of the objects in question")
		return c
	},
}

EthernetHook does nothing, but eventually it will print all the ethernet events for a single day as a convenient list of protos.

View Source
var Labqual = &subcommands.Command{
	UsageLine: "labqual [FLAGS...] HOSTNAME [HOSTNAME...]",
	ShortDesc: "Run a lab qualification on given host(s) using the board's stable build",
	CommandRun: func() subcommands.CommandRun {
		c := &LabqualRun{}
		c.authFlags.Register(&c.Flags, site.DefaultAuthOptions)
		c.envFlags.Register(&c.Flags)
		c.Flags.StringVar(&c.imagePath, "image", "", "Image to use for qualification")
		return c
	},
}
View Source
var ParseStableVersion = &subcommands.Command{
	UsageLine: "parse-stable-version",
	ShortDesc: "Parse stable-version file for startlark.",
	CommandRun: func() subcommands.CommandRun {
		c := &parseStableVersionRun{}
		c.authFlags.Register(&c.Flags, site.DefaultAuthOptions)
		c.CommonFlags.Register(&c.Flags)
		c.envFlags.Register(&c.Flags)
		c.Flags.StringVar(&c.targetFile, "target", "", "Path to target file. Example: `/usr/local/google/home/{user}/chromeos/infra/config/lab_platform/stable_version_data/stable_versions.cfg`")
		c.Flags.StringVar(&c.compareFile, "compare", "", "Path to comparing file. Example: `/usr/local/google/home/{user}/chromeos/infra/config/lab_platform/generated/stable_versions.cfg`")
		return c
	},
}
View Source
var ProvisionBtpeers = &subcommands.Command{
	UsageLine: "provision-btpeer",
	ShortDesc: "Provision a DUTs btpeers with a specified image",
	CommandRun: func() subcommands.CommandRun {
		c := &provisionBtpeerCommand{}
		c.authFlags.Register(&c.Flags, site.DefaultAuthOptions)
		c.envFlags.Register(&c.Flags)
		c.Flags.StringVar(&c.imagePath, "image-path", "", "GCS path or URL to the image to use during the provisioning.")
		c.Flags.BoolVar(&c.printOnly, "print-config", false, "If we should only print the config .json to the stdout and exit.")
		return c
	},
}

ProvisionBtpeers provisions a DUTs btpeers.

View Source
var Recovery = &subcommands.Command{
	UsageLine: "recovery",
	ShortDesc: "Recovery the DUT",
	LongDesc:  "Recovery the DUT.",
	CommandRun: func() subcommands.CommandRun {
		c := &recoveryRun{}
		c.authFlags.Register(&c.Flags, site.DefaultAuthOptions)
		c.envFlags.Register(&c.Flags)
		c.Flags.BoolVar(&c.onlyVerify, "only-verify", false, "Block recovery actions and run only verifiers.")
		c.Flags.StringVar(&c.configFile, "config", "", "Path to the custom json config file.")
		c.Flags.BoolVar(&c.noStepper, "no-stepper", false, "Block steper from using. This will prevent by using steps and you can only see logs.")
		c.Flags.BoolVar(&c.useCsa, "use-csa", true, "Use CSA Service or not.")
		c.Flags.BoolVar(&c.disableCft, "disable-cft", false, "Disable CFT.")
		c.Flags.BoolVar(&c.deployTask, "deploy", false, "Run deploy task. By default run recovery task.")
		c.Flags.StringVar(&c.taskName, "task-name", "", `What type of task name to use.".`)
		c.Flags.BoolVar(&c.updateUFS, "update-ufs", false, "Update result to UFS. By default no.")
		c.Flags.BoolVar(&c.latest, "latest", false, "Use latest version of CIPD when scheduling. By default no.")
		c.Flags.StringVar(&c.adminSession, "admin-session", "", "Admin session used to group created tasks. By default generated.")
		c.Flags.StringVar(&c.bbBucket, "bucket", "", "Buildbucket bucket to use.")
		c.Flags.StringVar(&c.bbBuilder, "builder", "", "Buildbucket builder to use.")
		return c
	},
}

Recovery subcommand: recover the devices.

View Source
var RecoveryHWID = &subcommands.Command{
	UsageLine: "recovery-hwid",
	ShortDesc: "Recovering HWID from inventory to host.",
	CommandRun: func() subcommands.CommandRun {
		c := &recoveryHWIDRun{}
		c.authFlags.Register(&c.Flags, site.DefaultAuthOptions)
		c.envFlags.Register(&c.Flags)
		return c
	},
}

Recovery HWID: Recovering HWID from inventory to host.

View Source
var RepairCBI = &subcommands.Command{
	UsageLine: "repair-cbi",
	ShortDesc: "Restore backup CBI contents from UFS",
	CommandRun: func() subcommands.CommandRun {
		c := &cbiRepairCommandRun{}
		c.authFlags.Register(&c.Flags, site.DefaultAuthOptions)
		c.envFlags.Register(&c.Flags)
		return c
	},
}

Repair CBI: Restore backup CBI contents from UFS go/cbi-auto-recovery-dd

View Source
var SerialConsole = &subcommands.Command{
	UsageLine: "serial-fw",
	ShortDesc: "flashes serial-fw to the DUT to enable CPU console",
	CommandRun: func() subcommands.CommandRun {
		c := &SerialConsoleRun{}
		c.authFlags.Register(&c.Flags, site.DefaultAuthOptions)
		c.envFlags.Register(&c.Flags)
		c.Flags.BoolVar(&c.latest, "latest", true, "Use latest version of CIPD when scheduling. By default yes.")
		c.Flags.StringVar(&c.adminSession, "admin-session", "", "Admin session used to group created tasks. By default generated.")
		return c
	},
}

Run FW update to enable serial for the DUT.

View Source
var SetFwTarget = &subcommands.Command{
	UsageLine: "set-fw-target [options] dut-name",
	ShortDesc: "Update fw-targets for DUTs.",
	CommandRun: func() subcommands.CommandRun {
		c := &SetFwTargetRun{}
		c.authFlags.Register(&c.Flags, site.DefaultAuthOptions)
		c.envFlags.Register(&c.Flags)
		c.Flags.BoolVar(&c.latest, "latest", true, "Use latest version of CIPD when scheduling. By default yes.")
		c.Flags.StringVar(&c.adminSession, "admin-session", "", "Admin session used to group created tasks. By default generated.")
		c.Flags.StringVar(&c.ecTarget, "ec-target", "", "Update target for EC.")
		c.Flags.StringVar(&c.apTarget, "ap-target", "", "Update target for AP.")
		return c
	},
}

SetFwTarget creates task to update fw-targets for the DUT.

View Source
var TestStateChange = &subcommands.Command{
	UsageLine: "test-state [-provision] [-reimage] [-usbkey] host...",
	ShortDesc: "update dut_state and set repair-requests for hosts",
	CommandRun: func() subcommands.CommandRun {
		c := &testStateChangeRun{}
		c.authFlags.Register(&c.Flags, site.DefaultAuthOptions)
		c.envFlags.Register(&c.Flags)
		c.Flags.StringVar(&c.newState, "state", "needs_repair", "Specify the state need to set for the DUT. Default needs-repair to address repair-requests")
		c.Flags.BoolVar(&c.needToClean, "clean", false, "Clean up repair-requests for DUT.")
		c.Flags.BoolVar(&c.needProvision, "provision", false, "Repair-request for provision request for DUT.")
		c.Flags.BoolVar(&c.needReimage, "reimage", false, "Repair-request for reimage request for DUT.")
		c.Flags.BoolVar(&c.needUpdateUSBkey, "usbkey", false, "Repair-request for re-downlaod image to USB drive request for DUT.")
		return c
	},
}

Run FW update to enable serial for the DUT.

Functions

This section is empty.

Types

type BatteryCutOffRun

type BatteryCutOffRun struct {
	subcommands.CommandRunBase
	// contains filtered or unexported fields
}

func (*BatteryCutOffRun) Run

type Key

type Key struct {
	Board string
	Model string
}

type LabqualRun

type LabqualRun struct {
	subcommands.CommandRunBase
	// contains filtered or unexported fields
}

func (*LabqualRun) Run

func (c *LabqualRun) Run(a subcommands.Application, args []string, env subcommands.Env) int

type SerialConsoleRun

type SerialConsoleRun struct {
	subcommands.CommandRunBase
	// contains filtered or unexported fields
}

func (*SerialConsoleRun) Run

type SetFwTargetRun

type SetFwTargetRun struct {
	subcommands.CommandRunBase
	// contains filtered or unexported fields
}

func (*SetFwTargetRun) Run

type Version

type Version struct {
	Os      string
	Fw      string
	FwImage string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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