hostinfo

package
v0.0.0-...-e560ebb Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package hostinfo implements the parts of harness management pertaining to Autotest hostinfo.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Borrower

type Borrower struct {
	// contains filtered or unexported fields
}

Borrower represents borrowing LocalDUTState into a HostInfo. It is used for returning any relevant Hostinfo changes back to the LocalDUTState.

func BorrowLocalDUTState

func BorrowLocalDUTState(hi *hostinfo.HostInfo, lds *swmbot.LocalDUTState) *Borrower

BorrowLocalDUTState takes some info stored in the LocalDUTState and adds it to the HostInfo. The returned Borrower should be closed to return any relevant HostInfo changes back to the LocalDUTState.

func (*Borrower) Close

func (b *Borrower) Close(ctx context.Context) error

Close returns any relevant Hostinfo changes back to the localDUTState. Subsequent calls do nothing. This is safe to call on a nil pointer.

type File

type File struct {
	// contains filtered or unexported fields
}

File represents a hostinfo file exposed for Autotest to use.

func Expose

func Expose(hi *hostinfo.HostInfo, resultsDir string, dutHostname string) (*File, error)

Expose exposes the HostInfo as a file for Autotest to use.

func (*File) Close

func (f *File) Close(ctx context.Context) error

Close marks that Autotest is finished using the exposed HostInfo file and loads any changes back into the original HostInfo. Subsequent calls do nothing. This is safe to call on a nil pointer.

type Proxy

type Proxy struct {
	*hostinfo.HostInfo
	// contains filtered or unexported fields
}

Proxy holds a DUT's hostinfo derived from inventory info and adds a Close method.

func FromDUT

func FromDUT(d *inventory.DeviceUnderTest, stableVersions map[string]string) *Proxy

FromDUT returns a DUT's hostinfo derived from its inventory info. The Close method must be called to update the inventory info with any changes.

func (*Proxy) Close

func (p *Proxy) Close(ctx context.Context) error

Close updates the original DUT with any hostinfo changes. This method does nothing on subsequent calls. This method is safe to call on a nil pointer.

Jump to

Keyboard shortcuts

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