dut

package
v0.0.0-...-9febfc8 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2025 License: BSD-3-Clause Imports: 31 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteDNSEntry

func DeleteDNSEntry(hostname string) error

DeleteDNSEntry removes the dns entry from /etc/dut_hosts/hosts.

Types

type AddDUT

type AddDUT struct {
	SatlabID  string
	Namespace string

	NewSpecsFile             string
	Hostname                 string
	Asset                    string
	Servo                    string
	ServoSerial              string
	ServoSetupType           string
	ServoDockerContainerName string
	SubrailConfig            string
	LicenseTypes             []string
	LicenseIds               []string
	Pools                    []string
	Rpm                      string
	RpmOutlet                string

	IgnoreUFS        bool
	DeployTags       []string
	DeploymentTicket string
	Tags             []string
	State            string
	Description      string

	// Asset location fields
	Zone string
	Rack string
	Hive string

	// ACS DUT fields
	Chameleons        []string
	Cameras           []string
	AntennaConnection string
	Router            string
	Cables            []string
	Facing            string
	Light             string
	Carrier           string
	AudioBoard        bool
	AudioBox          bool
	Atrus             bool
	WifiCell          bool
	TouchMimo         bool
	CameraBox         bool
	Chaos             bool
	AudioCable        bool
	SmartUSBHub       bool

	// Machine specific fields
	Model string
	Board string

	// AssetType is the type of the asset, it always has a value of "dut"
	AssetType string
	// Address is the IP address of the DUT
	Address string
	// SkipDNS controls whether to modify the `/etc/dut_hosts/hosts` file on the dns container
	SkipDNS bool
	// contains filtered or unexported fields
}

AddDUT contains all the commands for "satlab add dut" inherited from shivas.

Keep this up to date with infra/cmd/shivas/ufs/subcmds/dut/add_dut.go

func (*AddDUT) TriggerRun

func (c *AddDUT) TriggerRun(
	ctx context.Context,
	executor executor.IExecCommander,
	writer io.Writer,
) error

type AddDUTResponse

type AddDUTResponse struct {
	// RackMsg response message from adding a rack
	RackMsg string
	// AssetMsg response message from adding a asset
	AssetMsg string
	// DUTMsg response message from adding a DUT
	DUTMsg string
}

type CCDOpenRun

type CCDOpenRun struct {
	ServoSerial  string
	UsbDevice    string
	UseRmaAuth   bool
	ResetFactory bool
	// contains filtered or unexported fields
}

func (*CCDOpenRun) TriggerRun

func (c *CCDOpenRun) TriggerRun(
	ctx context.Context,
	executor executor.IExecCommander,
	w io.Writer,
	r bufio.Reader,
) error

TriggerRun triggers the Run with the given information

type DeleteDUT

type DeleteDUT struct {
	// SatlabID the Satlab ID from the Command Line
	// if it is empty it will get the ID from the enviornment
	SatlabID string

	// full if true, it deletes `DUT`, `rack`, and `Asset`. Otherwise,
	// it only deletes `DUT`
	Full bool

	// Names contain the DUT name that we want to delete
	Names []string
}

func (*DeleteDUT) TriggerRun

func (d *DeleteDUT) TriggerRun(ctx context.Context, executor executor.IExecCommander, ufs DeleteClient) (*DeleteDUTResult, error)

TriggerRun deletes the DUTs by given names

If we want to pass the `Namespace`, we can set up it in the context e.g. ``` import "go.chromium.org/infra/cmd/shivas/utils"

ctx = utils.SetupContext(ctx, c.envFlags.GetNamespace()) ```

func (*DeleteDUT) Validate

func (d *DeleteDUT) Validate() error

Validate verfiy the input is valid.

type DeleteDUTResult

type DeleteDUTResult struct {
	// MachineLSEs show which machineLSE we want to delete
	MachineLSEs []*ufsModels.MachineLSE

	// DutResults contain the name which has passed or failed after
	// deleting DUT.
	DutResults *Result

	// AssetResults contain the name which has passed or failed after
	// deleting Asset
	AssetResults *Result

	// RackResults contain the name which has passed or failed after
	// deleting Rack
	RackResults *Result
}

type Flagmap

type Flagmap = map[string][]string

type GetDUT

type GetDUT struct {
	// SatlabID will be prepended to DUT names if not already prefixing them.
	SatlabID      string
	Namespace     string
	HostInfoStore bool

	// Zone value Name(s) of a zone to filter by.
	Zones []string
	// Rack Name(s) of a rack to filter by.
	Racks []string
	// Machines Name(s) of a machine/asset to filter by.
	Machines []string
	// Prototypes Name(s) of a host prototype to filter by.
	Prototypes []string
	// Tags Name(s) of a tag to filter by.
	Tags []string
	// States Name(s) of a state to filter by.
	States []string
	// Servos Name(s) of a servo:port to filter by.
	Servos []string
	// Servotypes Name(s) of a servo type to filter by.
	Servotypes []string
	// Switches Name(s) of a switch to filter by.
	Switches []string
	// Rpms Name(s) of a rpm to filter by.
	Rpms []string
	// Pools Name(s) of a pool to filter by.
	Pools []string
}

GetDUT contains fields used to control behavior when fetching DUTs

func (*GetDUT) TriggerRun

func (g *GetDUT) TriggerRun(
	ctx context.Context,
	executor executor.IExecCommander,
	names []string,
) ([]*ufsModels.MachineLSE, error)

TriggerRun trigger `shivas get dut` CLI to get the machines information.

type InitiateSupportRun

type InitiateSupportRun struct {
	ProjectID string
	Zone      string
	Network   string
	Timeout   string
	Port      int
	// contains filtered or unexported fields
}

func (*InitiateSupportRun) TriggerRun

func (c *InitiateSupportRun) TriggerRun(
	ctx context.Context,
	executor executor.IExecCommander,
) error

TriggerRun triggers the Run with the given information

type Result

type Result struct {
	Pass []string
	Fail []string
}

type UpdateDUT

type UpdateDUT struct {
	// DUT specification inputs.
	NewSpecsFile             string
	Hostname                 string
	Machine                  string
	Servo                    string
	ServoSerial              string
	ServoSetupType           string
	ServoFwChannel           string
	ServoDockerContainerName string
	Pools                    []string
	LicenseTypes             []string
	LicenseIds               []string
	Rpm                      string
	RpmOutlet                string
	DeploymentTicket         string
	Tags                     []string
	Description              string

	// Deploy task inputs.
	ForceDeploy bool
	DeployTags  []string

	// ACS DUT fields
	Chameleons        []string
	Cameras           []string
	AntennaConnection string
	Router            string
	Cables            []string
	Facing            string
	Light             string
	Carrier           string
	AudioBoard        bool
	AudioBox          bool
	Atrus             bool
	WifiCell          bool
	TouchMimo         bool
	CameraBox         bool
	Chaos             bool
	AudioCable        bool
	SmartUSBHub       bool

	// For use in determining if a flag is set
	FlagInputs map[string]bool

	// SatlabID the Satlab ID from the Command Line
	// if it is empty it will get the ID from the enviornment
	SatlabID string

	// Namespace for executing the `shivas`
	Namespace string
}

func (*UpdateDUT) TriggerRun

func (c *UpdateDUT) TriggerRun(ctx context.Context, executor executor.IExecCommander) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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