internal

package
v0.0.0-...-cd881a2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const BootIdFile = "/proc/sys/kernel/random/boot_id"

Variables

This section is empty.

Functions

func CLIMain

func CLIMain(ctx context.Context, t0 time.Time, args []string) error

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

func DetectArch(c *ssh.Client) (string, error)

DetectArch detects the CPU architecture on c's remote host.

func DetectBoard

func DetectBoard(c *ssh.Client) (string, error)

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 GetBootId

func GetBootId(ctx context.Context, c *ssh.Client) (string, error)

GetBootId returns the unique boot ID of c's remote host.

func GetLatestVersion

func GetLatestVersion(ctx context.Context, c *storage.Client, board string) (string, error)

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

func GetRebootingBootId(ctx context.Context, dialer *ssh.Dialer, host string) (string, error)

GetRebootingBootId attempts to connect to host using the system SSH command. Then returns the unique boot ID of the host.

func Main

func Main(ctx context.Context, t0 time.Time, target string, opts *Options) error

func PushCompressedExecutable

func PushCompressedExecutable(ctx context.Context, c *ssh.Client, b []byte) (string, error)

PushCompressedExecutable pushes a compressed executable to c's remote host. The path of the pushed executable is returned.

func Reboot

func Reboot(ctx context.Context, dialer *ssh.Dialer, client *ssh.Client, host string) error

Reboot the device connected with client and wait for the host to be online

func WaitReboot

func WaitReboot(ctx context.Context, dialer *ssh.Dialer, host string, oldBootID string) error

WaitReboot waits the ssh host to reboot

Types

type Options

type Options struct {
	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
}

Directories

Path Synopsis
Package dut contains code that are run on the DUT.
Package dut contains code that are run on the DUT.

Jump to

Keyboard shortcuts

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