Documentation ¶
Index ¶
- Constants
- func CLIMain(ctx context.Context, t0 time.Time, args []string) error
- func CheckedReboot(ctx context.Context, dialer *ssh.Dialer, client *ssh.Client, ...) (*ssh.Client, error)
- func DetectArch(c *ssh.Client) (string, error)
- func DetectBoard(c *ssh.Client) (string, error)
- func DetectPartitions(c *ssh.Client) (partitions.State, error)
- func GetBootId(ctx context.Context, c *ssh.Client) (string, error)
- func GetLatestVersion(ctx context.Context, c *storage.Client, board string) (string, error)
- func GetLatestVersionForMilestone(ctx context.Context, c *storage.Client, board string, milestone int) (string, error)
- func GetLatestVersionWithPrefix(ctx context.Context, c *storage.Client, board, prefix string) (string, error)
- func GetRebootingBootId(ctx context.Context, dialer *ssh.Dialer, host string) (string, error)
- func Main(ctx context.Context, t0 time.Time, target string, opts *Options) error
- func PushCompressedExecutable(ctx context.Context, c *ssh.Client, b []byte) (string, error)
- func Reboot(ctx context.Context, dialer *ssh.Dialer, client *ssh.Client, ...) error
- func WaitReboot(ctx context.Context, dialer *ssh.Dialer, host string, oldBootID string) error
- type Options
Constants ¶
const BootIdFile = "/proc/sys/kernel/random/boot_id"
Variables ¶
This section is empty.
Functions ¶
func CheckedReboot ¶
func CheckedReboot(ctx context.Context, dialer *ssh.Dialer, client *ssh.Client, host, wantActiveRootfs string) (*ssh.Client, error)
CheckedReboot reboots the dut with Reboot() and checkBootExpectations(). A new SSH client is provided to interact with the rebooted host. The passed in client is closed.
func DetectArch ¶
DetectArch detects the CPU architecture on c's remote host.
func DetectBoard ¶
DetectBoard detects the board of c's remote host.
func DetectPartitions ¶
func DetectPartitions(c *ssh.Client) (partitions.State, error)
DetectPartitions detects the active/inactive partition state on c's remote host.
func GetLatestVersion ¶
GetLatestVersion finds the latest version for board on gs://chromeos-image-archive.
func GetLatestVersionForMilestone ¶
func GetLatestVersionForMilestone(ctx context.Context, c *storage.Client, board string, milestone int) (string, error)
GetLatestVersionForMilestone finds the latest version for board and milestone on gs://chromeos-image-archive.
func GetLatestVersionWithPrefix ¶
func GetLatestVersionWithPrefix(ctx context.Context, c *storage.Client, board, prefix string) (string, error)
GetLatestVersionWithPrefix finds the latest build with the given prefix on gs://chromeos-image-archive.
func GetRebootingBootId ¶
GetRebootingBootId attempts to connect to host using the system SSH command. Then returns the unique boot ID of the host.
func PushCompressedExecutable ¶
PushCompressedExecutable pushes a compressed executable to c's remote host. The path of the pushed executable is returned.
Types ¶
type Options ¶
type Options struct { PayloadFile string `json:",omitempty"` // JSON payload file to flash GS string `json:",omitempty"` // gs:// directory to flash VersionString string `json:",omitempty"` // version string such as R105-14989.0.0 MilestoneNum int `json:",omitempty"` // release number such as 105 Board string `json:",omitempty"` // build target name such as brya Snapshot bool `json:",omitempty"` // flash a snapshot build Postsubmit bool `json:",omitempty"` // flash a postsubmit build Port string `json:",omitempty"` // port number to connect to on the dut-host DryRun bool `json:",omitempty"` // print what is going to be flashed but do not actually flash dut.FlashOptions }