Documentation
¶
Overview ¶
Copyright 2023 The Chromium Authors Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
Copyright 2023 The Chromium Authors Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
Index ¶
- type DUTServicesImpl
- func (d *DUTServicesImpl) GetBoard(ctx context.Context, IP string) (string, error)
- func (d *DUTServicesImpl) GetCCDStatus(ctx context.Context, address string) (string, error)
- func (d *DUTServicesImpl) GetConnectedIPs(ctx context.Context) ([]Device, error)
- func (d *DUTServicesImpl) GetGSCSerialAndServoUSBCount(ctx context.Context, IP string) (*GSCInfo, error)
- func (d *DUTServicesImpl) GetModel(ctx context.Context, IP string) (string, error)
- func (d *DUTServicesImpl) GetServoSerial(ctx context.Context, IP string, usbDevices []enumeration.USBDevice) (bool, string, error)
- func (d *DUTServicesImpl) GetUSBDevicePaths(ctx context.Context) ([]enumeration.USBDevice, error)
- func (d *DUTServicesImpl) RunCommandOnIP(ctx context.Context, IP string, cmd string) (*models.SSHResult, error)
- func (d *DUTServicesImpl) RunCommandOnIPs(ctx context.Context, IPs []string, cmd string) []*models.SSHResult
- type Device
- type GSCInfo
- type Host
- type HostVersions
- type IDUTServices
- type ListFirmwareCommandResponse
- type ListFirmwareResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DUTServicesImpl ¶
type DUTServicesImpl struct {
// contains filtered or unexported fields
}
DUTServicesImpl implement details of IDUTServices
func (*DUTServicesImpl) GetCCDStatus ¶
GetCCDStatus gets the CCD status from the given IP address. If it the command return empty string, we set it `Unknown` status.
func (*DUTServicesImpl) GetConnectedIPs ¶
func (d *DUTServicesImpl) GetConnectedIPs(ctx context.Context) ([]Device, error)
GetConnectedIPs get the connected IPs from `dnsmasq.lease` and then check the IPs are alive.
func (*DUTServicesImpl) GetGSCSerialAndServoUSBCount ¶
func (d *DUTServicesImpl) GetGSCSerialAndServoUSBCount(ctx context.Context, IP string) (*GSCInfo, error)
GetGSCSerialAndServoUSBCount returns the cr50/ti50 usb connector serial number for the given IP
func (*DUTServicesImpl) GetModel ¶
GetModel get the DUT's model from `cros_config / test-label` / `cros_config / name`
func (*DUTServicesImpl) GetServoSerial ¶
func (d *DUTServicesImpl) GetServoSerial(ctx context.Context, IP string, usbDevices []enumeration.USBDevice) (bool, string, error)
GetServoSerial returns the Servo serial number for the given IP
func (*DUTServicesImpl) GetUSBDevicePaths ¶
func (d *DUTServicesImpl) GetUSBDevicePaths(ctx context.Context) ([]enumeration.USBDevice, error)
GetUSBDevicePaths returns all the USBDevices instance of plugged devices
func (*DUTServicesImpl) RunCommandOnIP ¶
func (d *DUTServicesImpl) RunCommandOnIP(ctx context.Context, IP string, cmd string) (*models.SSHResult, error)
RunCommandOnIP send the command to the DUT device and then get the result back
ip which device ip want to execute the command. cmd which command want to be executed. TODO: consider one thing if the command was executed failed should be an error?
func (*DUTServicesImpl) RunCommandOnIPs ¶
func (d *DUTServicesImpl) RunCommandOnIPs(ctx context.Context, IPs []string, cmd string) []*models.SSHResult
RunCommandOnIPs send the command to DUT devices and then get the result back
ips the list of ip which want to execute the command. cmd which command want to be executed.
type Device ¶
type Device struct { IP string MACAddress string IsPingable bool HasTestImage bool ServoSerial string }
Device is a struct provides the information of the IP address and is connected.
type Host ¶
type Host struct {
Versions *HostVersions `json:"versions"`
}
type HostVersions ¶
type IDUTServices ¶
type IDUTServices interface { // RunCommandOnIP send the command to the DUT device and then get the result back RunCommandOnIP(ctx context.Context, IP, cmd string) (*models.SSHResult, error) // RunCommandOnIPs send the command to DUT devices and then get the result back RunCommandOnIPs(ctx context.Context, IPs []string, cmd string) []*models.SSHResult // GetConnectedIPs get the connected IPs from `dnsmasq.lease` // and then check the IPs are alive. GetConnectedIPs(ctx context.Context) ([]Device, error) // GetBoard get the DUT's board GetBoard(ctx context.Context, address string) (string, error) // GetModel gets the DUT's model GetModel(ctx context.Context, address string) (string, error) // GetGSCSerialAndServoUSBCount gets the Cr50 or Ti50 port serial number on the DUT GetGSCSerialAndServoUSBCount(ctx context.Context, address string) (*GSCInfo, error) // GetServoSerial gets the Servo serial number for given DUT IP address. GetServoSerial(ctx context.Context, IP string, usbDevices []enumeration.USBDevice) (bool, string, error) // GetUSBDevicePaths returns all the USBDevices instance of plugged devices GetUSBDevicePaths(ctx context.Context) ([]enumeration.USBDevice, error) // GetCCDStatus gets the status of CCD GetCCDStatus(ctx context.Context, address string) (string, error) }
IDUTServices provides the services that regulate the DUTs.
func New ¶
func New() (IDUTServices, error)
type ListFirmwareCommandResponse ¶
type ListFirmwareCommandResponse struct { FwId string `json:"fwid"` Model string `json:"model"` FwUpdate map[string]*ListFirmwareResult `json:"fw_update"` }