Documentation
¶
Overview ¶
Package rpc provides gRPC utilities for Tast tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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 ¶
Dial establishes a gRPC connection to the test bundle executable using d and h.
The context passed in must remain valid for as long as the gRPC connection. I.e. Don't use the context from within a testing.Poll function.
Example:
cl, err := rpc.Dial(ctx, d, s.RPCHint())
if err != nil {
return err
}
defer cl.Close(ctx)
fs := base.NewFileSystemClient(cl.Conn)
res, err := fs.ReadDir(ctx, &base.ReadDirRequest{Dir: "/mnt/stateful_partition"})
if err != nil {
return err
}
Click to show internal directories.
Click to hide internal directories.