Documentation ¶
Overview ¶
Package crosserverutil contains utility functions to manage the cros server lifecycle
Index ¶
Constants ¶
View Source
const DefaultGRPCServerPort = 4445
DefaultGRPCServerPort is the default TCP based GRPC Server port for remote testing
Variables ¶
This section is empty.
Functions ¶
func StartCrosServer ¶
StartCrosServer initiates the cros server process and grpc server on DUT through SSH
Types ¶
type Client ¶
type Client struct { // Conn is the gRPC connection. Use this to create gRPC service stubs. Conn *grpc.ClientConn // contains filtered or unexported fields }
Client owns a gRPC connection to the DUT for remote tests to use.
func Dial ¶
func Dial(ctx context.Context, d *dut.DUT, hostname string, port int, useForwarder bool) (*Client, error)
Dial establishes a gRPC connection for a given hostname and port The grpc target will be in the form "[hostname]:[port]" When useForwarder is true, a local to remote port forwarding will be enabled for the desired port
Example without port forwarding:
cl, err := crosserverutil.Dial(ctx, s.DUT(), hostname, port, false) if err != nil { return err } defer cl.Close(ctx) cs := pb.NewChromeServiceClient(cl.Conn) res, err := cs.New(ctx, &pb.NewRequest{});
Example with port forwarding:
cl, err := crosserverutil.Dial(ctx, s.DUT(), "localhost", port, true)
Click to show internal directories.
Click to hide internal directories.