fakedutserver

package
v0.0.0-...-15a9a0c Latest Latest
Warning

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

Go to latest
Published: May 19, 2023 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Overview

Package fakedutserver provides a fake implementation of the DUT service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(t *testing.T, opts ...Option) (stopFunc func(), addr string)

Start is a convenient method for unit tests which starts a gRPC server serving DutServiceServer in the background. It also starts an HTTP server for serving cached files by Cache. Callers are responsible for stopping the server by stopFunc().

Types

type DutServiceServer

type DutServiceServer struct {
	api.UnimplementedDutServiceServer
	longrunning.UnimplementedOperationsServer
	// contains filtered or unexported fields
}

DutServiceServer is a fake implementation of api.DutService and longrunning.UnimplementedOperationsServer for Cache.

func New

func New(opts ...Option) *DutServiceServer

New constructs a new DutServiceServer from given options. The caller is responsible for calling Shutdown() of the returned object.

func (*DutServiceServer) Cache

Cache implements api.DutServiceServer.Cache

func (*DutServiceServer) CancelOperation

CancelOperation implements longrunning.CancelOperation.

func (*DutServiceServer) DeleteOperation

DeleteOperation implements longrunning.CancelOperation.

func (*DutServiceServer) DetectDeviceConfigId

DetectDeviceConfigId implements api.DutServiceServer.DetectDeviceConfigId.

func (*DutServiceServer) ExecCommand

ExecCommand implements api.DutServiceServer.ExecCommand.

func (*DutServiceServer) FetchCrashes

FetchCrashes implements api.DutServiceServer.FetchCrashes.

func (*DutServiceServer) ForceReconnect

ForceReconnect implements api.ForceReconnect.

func (*DutServiceServer) GetOperation

GetOperation implements longrunning.GetOperation.

func (*DutServiceServer) ListOperations

ListOperations implements longrunning.ListOperations.

func (*DutServiceServer) Restart

Restart implements api.DutServiceServer.FetchCrashes.

func (*DutServiceServer) WaitOperation

WaitOperation implements longrunning.WaitOperation.

type Option

type Option func(cfg *config)

Option is an option passed to New to customize DutServiceServer.

func WithCacheFileMap

func WithCacheFileMap(m map[string][]byte) Option

WithCacheFileMap returns an option that sets the files to be fetched by Cache requests.

Jump to

Keyboard shortcuts

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