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 BotInfo into a HostInfo. It is used for returning any relevant Hostinfo changes back to the BotInfo.

      func BorrowBotInfo

      func BorrowBotInfo(hi *hostinfo.HostInfo, bi *swmbot.LocalState) *Borrower

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

        func (*Borrower) Close

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

          Close returns any relevant Hostinfo changes back to the BotInfo. 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, dutName 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.