fake

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: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MockDUT2 = &ufspb.MachineLSE{
	Name:     "test-dut-2",
	Hostname: "test-dut-2",
	Machines: []string{"test-machine-dut-2"},
	Lse: &ufspb.MachineLSE_ChromeosMachineLse{
		ChromeosMachineLse: &ufspb.ChromeOSMachineLSE{
			ChromeosLse: &ufspb.ChromeOSMachineLSE_DeviceLse{
				DeviceLse: &ufspb.ChromeOSDeviceLSE{
					Device: &ufspb.ChromeOSDeviceLSE_Dut{
						Dut: &lab.DeviceUnderTest{
							Hostname: "test-dut-2",
							Peripherals: &lab.Peripherals{
								Servo: &lab.Servo{
									ServoType: "invalid",
									ServoTopology: &lab.ServoTopology{
										Main: &lab.ServoTopologyItem{
											Type: "invalid",
										},
									},
								},
								SmartUsbhub: false,
							},
						},
					},
				},
			},
		},
	},
}

MockDUT2 for testing UpdateDutState

View Source
var MockDutStateForDUT2 = &lab.DutState{
	Id: &lab.ChromeOSDeviceID{
		Value: "test-machine-dut-2",
	},
	Servo:                  lab.PeripheralState_UNKNOWN,
	StorageState:           lab.HardwareState_HARDWARE_UNKNOWN,
	WorkingBluetoothBtpeer: 0,
	Cr50Phase:              lab.DutState_CR50_PHASE_INVALID,
	Hostname:               "test-dut-2",
}

MockDutStateForDUT2 for testing UpdateDutState

View Source
var MockMachineForDUT2 = &ufspb.Machine{
	Name:         "test-machine-dut-2",
	SerialNumber: "invalid",
	Device: &ufspb.Machine_ChromeosMachine{
		ChromeosMachine: &ufspb.ChromeOSMachine{
			Sku:  "invalid",
			Hwid: "invalid",
		},
	},
}

MockMachineForDUT2 for testing UpdateDutState

Functions

func GetMockDUT

func GetMockDUT() *ufspb.MachineLSE

GetMockDUT mocks dut machinelse

func GetMockDutStateForDUT

func GetMockDutStateForDUT() *lab.DutState

GetMockDutStateForDUT mocks DutState for dut

func GetMockDutStateForLabstation

func GetMockDutStateForLabstation() *lab.DutState

GetMockDutStateForLabstation mocks DutState for labstation

func GetMockLabstation

func GetMockLabstation() *ufspb.MachineLSE

GetMockLabstation mocks labstation machinelse

func GetMockMachineForDUT

func GetMockMachineForDUT() *ufspb.Machine

GetMockMachineForDUT mocks machine for dut

func GetMockMachineForLabstation

func GetMockMachineForLabstation() *ufspb.Machine

GetMockMachineForLabstation mocks machine for labstation

Types

type FleetClient

type FleetClient struct {
}

FleetClient mocks the UFS client

func (*FleetClient) CreateAsset

func (ic *FleetClient) CreateAsset(ctx context.Context, req *ufsapi.CreateAssetRequest, opts ...grpc.CallOption) (*ufspb.Asset, error)

CreateAsset mocks the create asset API. Fails if "CAIE" or "CANF" is found in the asset tag.

func (*FleetClient) CreateMachineLSE

func (ic *FleetClient) CreateMachineLSE(ctx context.Context, req *ufsapi.CreateMachineLSERequest, opts ...grpc.CallOption) (*ufspb.MachineLSE, error)

CreateMachineLSE mocks the create machine lse API. Fails if "CMLSEIE" or "CMLSENF" is in the asset tag.

func (*FleetClient) DeleteMachineLSE

func (ic *FleetClient) DeleteMachineLSE(ctx context.Context, req *ufsapi.DeleteMachineLSERequest, opts ...grpc.CallOption) (*emptypb.Empty, error)

DeleteMachineLSE mocks the MachineLSE delete API. Fails if the string "DMLSEE" is contained in the hostname.

func (*FleetClient) GetAsset

func (ic *FleetClient) GetAsset(ctx context.Context, req *ufsapi.GetAssetRequest, opts ...grpc.CallOption) (*ufspb.Asset, error)

GetAsset mocks the get asset API, Fails if "GAIE" or "GANF" is a substring in asset tag.

func (*FleetClient) GetDutState

func (ic *FleetClient) GetDutState(ctx context.Context, in *ufsapi.GetDutStateRequest, opts ...grpc.CallOption) (*lab.DutState, error)

GetDutState mocks the GetDutState api from UFS.

func (*FleetClient) GetMachine

func (ic *FleetClient) GetMachine(ctx context.Context, in *ufsapi.GetMachineRequest, opts ...grpc.CallOption) (*ufspb.Machine, error)

GetMachine mocks the GetMachine api from UFS.

func (*FleetClient) GetMachineLSE

func (ic *FleetClient) GetMachineLSE(ctx context.Context, in *ufsapi.GetMachineLSERequest, opts ...grpc.CallOption) (*ufspb.MachineLSE, error)

GetMachineLSE mocks the GetMachineLSE api from UFS.

func (*FleetClient) GetRack

func (ic *FleetClient) GetRack(ctx context.Context, req *ufsapi.GetRackRequest, opts ...grpc.CallOption) (*ufspb.Rack, error)

GetRack mocks the get rack API, Fails if rack is in chromeos4 or chromeos1.

func (*FleetClient) ListDutStates

ListDutStates mocks the ListDutStates api from UFS.

func (*FleetClient) ListMachineLSEs

ListMachineLSEs mocks the ListMachineLSEs api from UFS.

func (*FleetClient) ListMachines

ListMachines mocks the ListMachines api from UFS.

func (*FleetClient) RackRegistration

func (ic *FleetClient) RackRegistration(ctx context.Context, req *ufsapi.RackRegistrationRequest, opts ...grpc.CallOption) (*ufspb.Rack, error)

RackRegistration mocks the rack registration API. Fails if the rack is in row1 or row2.

func (*FleetClient) UpdateAsset

func (ic *FleetClient) UpdateAsset(ctx context.Context, req *ufsapi.UpdateAssetRequest, opts ...grpc.CallOption) (*ufspb.Asset, error)

UpdateAsset mocks the Asset update API, Fails if the asset name contains the string "UAE".

func (*FleetClient) UpdateDutState

func (ic *FleetClient) UpdateDutState(ctx context.Context, in *ufsapi.UpdateDutStateRequest, opts ...grpc.CallOption) (*lab.DutState, error)

UpdateDutState mocks the UpdateDutState api from UFS

func (*FleetClient) UpdateMachineLSE

func (ic *FleetClient) UpdateMachineLSE(ctx context.Context, req *ufsapi.UpdateMachineLSERequest, opts ...grpc.CallOption) (*ufspb.MachineLSE, error)

UpdateMachineLSE mocks the MachineLSE update API. Fails if the string `UMLSEE` is contained in machine name.

Jump to

Keyboard shortcuts

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