updateutil

package
v0.0.0-...-683b059 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2022 License: BSD-3-Clause Imports: 27 Imported by: 0

Documentation

Overview

Package updateutil implements helpers for autoupdate tests.

Index

Constants

View Source
const UpdateTimeout = 15 * time.Minute

UpdateTimeout is the time needed to download image and install it to DUT.

Variables

This section is empty.

Functions

func EntryFromLSBRelease

func EntryFromLSBRelease(ctx context.Context, dut *dut.DUT, rpcHint *testing.RPCHint, key string) (string, error)

EntryFromLSBRelease is a wrapper for FillFromLSBRelease to get a single entry from the /etc/lsb-realse file with a simpler call.

func FillFromLSBRelease

func FillFromLSBRelease(ctx context.Context, dut *dut.DUT, rpcHint *testing.RPCHint, req map[string]string) error

FillFromLSBRelease fills map[string]string it gets as input with values form the /etc/lsb-realse file based on matching keys.

func ImageBuilderPath

func ImageBuilderPath(ctx context.Context, dut *dut.DUT, rpcHint *testing.RPCHint) (string, error)

ImageBuilderPath gets the DUT image builder path from the parsed /etc/lsb-realse file.

func ImageVersion

func ImageVersion(ctx context.Context, dut *dut.DUT, rpcHint *testing.RPCHint) (string, error)

ImageVersion gets the DUT image version from the parsed /etc/lsb-realse file.

func UpdateFromGS

func UpdateFromGS(ctx context.Context, dut *dut.DUT, outdir string, rpcHint *testing.RPCHint, builderPath string) (retErr error)

UpdateFromGS updates the DUT to an image found in the Google Storage under the builder path folder. It saves the logs (udpdate engine logs and Nebraska logs) to the given outdir.

Types

type Board

type Board struct {
	PublicCodename string `json:"public_codename"`
	IsActive       bool   `json:"is_active"`
	BuilderName    string `json:"builder_name"`
}

Board stores the board related data in a Delta.

type Delta

type Delta struct {
	Board             Board    `json:"board"`
	DeltaType         string   `json:"delta_type"`
	Channel           string   `json:"channel"`
	ChromeOSVersion   string   `json:"chrome_os_version"`
	ChromeVersion     string   `json:"chrome_version"`
	Milestone         int      `json:"milestone"`
	GenerateDelta     bool     `json:"generate_delta"`
	DeltaPayloadTests bool     `json:"delta_payload_tests"`
	FullPayloadTests  bool     `json:"full_payload_tests"`
	Models            []string `json:"applicable_models"`
}

Delta describes an update delta in the paygen.json file.

func FindLatestStable

func FindLatestStable(ctx context.Context, board string) (*Delta, error)

FindLatestStable finds the entry in paygen.json for the latest image on the selected board.

type Paygen

type Paygen struct {
	Deltas []Delta `json:"delta"`
}

Paygen is a structure that can hold the unmarshaled paygen.json data.

func LoadPaygenFromGS

func LoadPaygenFromGS(ctx context.Context) (*Paygen, error)

LoadPaygenFromGS downloads the paygen.json file, parses it, and returns it in a Paygen object.

func (Paygen) FilterBoard

func (p Paygen) FilterBoard(board string) *Paygen

FilterBoard filters for a specific board string.

func (*Paygen) FilterBoardChannelDeltaType

func (p *Paygen) FilterBoardChannelDeltaType(board, channel, deltaType string) *Paygen

FilterBoardChannelDeltaType filters the deltas based on the board, channel and delta type. This is the most common filter combination, so it is done in one call.

func (Paygen) FilterDeltaType

func (p Paygen) FilterDeltaType(deltaType string) *Paygen

FilterDeltaType filters by type.

func (Paygen) FilterMilestone

func (p Paygen) FilterMilestone(milestone int) *Paygen

FilterMilestone filters the deltas based on the milestone.

func (*Paygen) FindLatest

func (p *Paygen) FindLatest() (*Delta, error)

FindLatest returns the Delta with the highest Chrome OS Version value.

Jump to

Keyboard shortcuts

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