dutstate

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 dutstate provides representation of states of DUT in Swarming and reading and updating a state in UFS service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Update

func Update(ctx context.Context, c UFSClient, host string, state State) error

Update push new DUT/Labstation state to UFS.

Types

type Info

type Info struct {
	// State represents the state of the DUT from Swarming.
	State State
	// Time represents in Unix time of the last updated DUT state recorded.
	Time int64
}

Info represent information of the state and last updated time.

func Read

func Read(ctx context.Context, c UFSClient, host string) Info

Read read state from UFS.

If state not exist in the UFS the state will be default and time is 0.

type State

type State string

State is an enum for host state.

const (
	// Device ready to run tests.
	Ready State = "ready"
	// Provisioning failed on the device and required verified and repair.
	NeedsRepair State = "needs_repair"
	// Test failed on the device and required reset the state.
	NeedsReset State = "needs_reset"
	// Device did not recovered after running repair task on it.
	RepairFailed State = "repair_failed"
	// Device prepared to be deployed to the lab.
	NeedsDeploy State = "needs_deploy"
	// Device reserved for analysis or hold by lab
	Reserved State = "reserved"
	// Device under manual repair interaction by lab
	ManualRepair State = "manual_repair"
	// Device required manual attention to be fixed
	NeedsManualRepair State = "needs_manual_repair"
	// Device is not fixable due issues with hardware and has to be replaced
	NeedsReplacement State = "needs_replacement"
	// Device state when state is not present or cannot be read from UFS.
	Unknown State = "unknown"
)

All DUT states.

func (State) String

func (s State) String() string

String provides string representation of the DUT state.

type UFSClient

type UFSClient interface {
	GetMachineLSE(ctx context.Context, req *ufsAPI.GetMachineLSERequest, opts ...grpc.CallOption) (*ufsProto.MachineLSE, error)
	UpdateMachineLSE(ctx context.Context, req *ufsAPI.UpdateMachineLSERequest, opts ...grpc.CallOption) (*ufsProto.MachineLSE, error)
}

UFSClient represents short set of method of ufsAPI.FleetClient.

Jump to

Keyboard shortcuts

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