Documentation
¶
Overview ¶
Package hostinfo provides support for Autotest's serialized hostinfo data.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalIndent ¶
MarshalIndent serializes the HostInfo struct into a slice of bytes. The prefix and indent options of json.MarshalIndent are not exposed to the user because You Don't Need Them.
func RevertDut ¶
func RevertDut(d *inventory.DeviceUnderTest, hi *HostInfo)
RevertDut reverts the Autotest hostinfo back to an inventory DUT struct.
Types ¶
type AdminClient ¶
type AdminClient interface {
GetRecoveryVersion(ctx context.Context, in *fleet.GetRecoveryVersionRequest, opts ...grpc.CallOption) (*fleet.GetRecoveryVersionResponse, error)
}
AdminClient is a client that knows how to respond to the GetStableVersion RPC call. Its prototypical implementation is fleet.InventoryClient.
type Getter ¶
type Getter struct {
// contains filtered or unexported fields
}
Getter is a container for the clients needed to construct the host_info_store contents for a given hostname.
func NewGetter ¶
func NewGetter( ic InventoryClient, ac AdminClient, ) *Getter
NewGetter constructs a getter in the default configuration.
func (*Getter) GetContentsForHostname ¶
GetContentsForHostname gets the entire hostinfostore file contents for a given hostname as a string.
func (*Getter) GetStableVersion ¶
func (g *Getter) GetStableVersion(ctx context.Context, deviceType, hostname, board, model string, pools []string) (*lab_platform.StableVersion, error)
GetStableVersion gets the stable version info.
type HostInfo ¶
type HostInfo struct { Labels []string `json:"labels"` Attributes map[string]string `json:"attributes"` StableVersions map[string]string `json:"stable_versions"` }
HostInfo stores the host information. Hostinfo files are used to pass host information to Autotest and receive host information changes from Autotest.
func ConvertDut ¶
func ConvertDut(d *inventory.DeviceUnderTest) *HostInfo
ConvertDut converts the inventory DUT struct to Autotest hostinfo.
type InventoryClient ¶
type InventoryClient interface {
GetChromeOSDeviceData(context.Context, *ufsAPI.GetChromeOSDeviceDataRequest, ...grpc.CallOption) (*models.ChromeOSDeviceData, error)
}
InventoryClient is a client that knows how to resolve a ChromeosDeviceDataRequest contains hostname to ChromeOSDeviceData that contains information about the DUT V1.