grpc_interop

package
v1.5.0-alpha.3....-7948e3f Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

README

This directory has tools to generate:

    .../testdata/router/grpc-interop.yaml.

The generated YAML contains copies of server.go and client.go from the
cluster directory. The gRPC interop tests require a client and server
that share a known protobuf implementation.

The files in the cluster directory are zipped up and added as a
configmap entry in the test setup. The source file are then unzipped
in an init container and compiled from source. Note: we use the go.mod
and go.sum files to ensure this is repeatable. Once compilation is
successful the server is started and listens for both h2 and h2c gRPC
client connections.

The client-shell container should be used to invoke gRPC calls against
either the internal service or via external routes.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientNewPayload

func ClientNewPayload(t testpb.PayloadType, size int) (*testpb.Payload, error)

ClientNewPayload returns a payload of the given type and size.

func Dial

func Dial(cfg DialParams) (*grpc.ClientConn, error)

func DoCancelAfterBegin

func DoCancelAfterBegin(tc testpb.TestServiceClient, args ...grpc.CallOption) error

DoCancelAfterBegin cancels the RPC after metadata has been sent but before payloads are sent.

func DoCancelAfterFirstResponse

func DoCancelAfterFirstResponse(tc testpb.TestServiceClient, args ...grpc.CallOption) error

DoCancelAfterFirstResponse cancels the RPC after receiving the first message from the server.

func DoClientStreaming

func DoClientStreaming(tc testpb.TestServiceClient, args ...grpc.CallOption) error

DoClientStreaming performs a client streaming RPC.

func DoCustomMetadata

func DoCustomMetadata(tc testpb.TestServiceClient, args ...grpc.CallOption) error

DoCustomMetadata checks that metadata is echoed back to the client.

func DoEmptyUnaryCall

func DoEmptyUnaryCall(tc testpb.TestServiceClient, args ...grpc.CallOption) error

DoEmptyUnaryCall performs a unary RPC with empty request and response messages.

func DoLargeUnaryCall

func DoLargeUnaryCall(tc testpb.TestServiceClient, args ...grpc.CallOption) error

DoLargeUnaryCall performs a unary RPC with large payload in the request and response.

func DoPingPong

func DoPingPong(tc testpb.TestServiceClient, args ...grpc.CallOption) error

DoPingPong performs ping-pong style bi-directional streaming RPC.

func DoServerStreaming

func DoServerStreaming(tc testpb.TestServiceClient, args ...grpc.CallOption) error

DoServerStreaming performs a server streaming RPC.

func DoSpecialStatusMessage

func DoSpecialStatusMessage(tc testpb.TestServiceClient, args ...grpc.CallOption) error

DoSpecialStatusMessage verifies Unicode and whitespace is correctly processed in status message.

func DoStatusCodeAndMessage

func DoStatusCodeAndMessage(tc testpb.TestServiceClient, args ...grpc.CallOption) error

DoStatusCodeAndMessage checks that the status code is propagated back to the client.

func DoTimeoutOnSleepingServer

func DoTimeoutOnSleepingServer(tc testpb.TestServiceClient, args ...grpc.CallOption) error

DoTimeoutOnSleepingServer performs an RPC on a sleep server which causes RPC timeout.

func DoUnimplementedMethod

func DoUnimplementedMethod(cc *grpc.ClientConn) error

DoUnimplementedMethod attempts to call an unimplemented method.

func DoUnimplementedService

func DoUnimplementedService(tc testpb.UnimplementedServiceClient) error

DoUnimplementedService attempts to call a method from an unimplemented service.

func ExecTestCase

func ExecTestCase(conn *grpc.ClientConn, testCase string) error

Types

type DialParams

type DialParams struct {
	UseTLS   bool
	CertData []byte
	Host     string
	Port     int
	Insecure bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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