...

Package interop

import "google.golang.org/grpc/interop"
Overview
Index
Subdirectories

Overview ▾

Package interop contains functions used by interop client/server.

See interop test case descriptions here.

Index ▾

func ClientNewPayload(t testpb.PayloadType, size int) *testpb.Payload
func DoCancelAfterBegin(ctx context.Context, tc testgrpc.TestServiceClient, args ...grpc.CallOption)
func DoCancelAfterFirstResponse(ctx context.Context, tc testgrpc.TestServiceClient, args ...grpc.CallOption)
func DoClientStreaming(ctx context.Context, tc testgrpc.TestServiceClient, args ...grpc.CallOption)
func DoComputeEngineChannelCredentials(ctx context.Context, tc testgrpc.TestServiceClient, defaultServiceAccount string)
func DoComputeEngineCreds(ctx context.Context, tc testgrpc.TestServiceClient, serviceAccount, oauthScope string)
func DoCustomMetadata(ctx context.Context, tc testgrpc.TestServiceClient, args ...grpc.CallOption)
func DoEmptyStream(ctx context.Context, tc testgrpc.TestServiceClient, args ...grpc.CallOption)
func DoEmptyUnaryCall(ctx context.Context, tc testgrpc.TestServiceClient, args ...grpc.CallOption)
func DoGoogleDefaultCredentials(ctx context.Context, tc testgrpc.TestServiceClient, defaultServiceAccount string)
func DoJWTTokenCreds(ctx context.Context, tc testgrpc.TestServiceClient, serviceAccountKeyFile string)
func DoLargeUnaryCall(ctx context.Context, tc testgrpc.TestServiceClient, args ...grpc.CallOption)
func DoORCAOOBTest(ctx context.Context, tc testgrpc.TestServiceClient)
func DoORCAPerRPCTest(ctx context.Context, tc testgrpc.TestServiceClient)
func DoOauth2TokenCreds(ctx context.Context, tc testgrpc.TestServiceClient, serviceAccountKeyFile, oauthScope string)
func DoPerRPCCreds(ctx context.Context, tc testgrpc.TestServiceClient, serviceAccountKeyFile, oauthScope string)
func DoPickFirstUnary(ctx context.Context, tc testgrpc.TestServiceClient)
func DoPingPong(ctx context.Context, tc testgrpc.TestServiceClient, args ...grpc.CallOption)
func DoServerStreaming(ctx context.Context, tc testgrpc.TestServiceClient, args ...grpc.CallOption)
func DoServiceAccountCreds(ctx context.Context, tc testgrpc.TestServiceClient, serviceAccountKeyFile, oauthScope string)
func DoSoakTest(ctx context.Context, tc testgrpc.TestServiceClient, serverAddr string, dopts []grpc.DialOption, resetChannel bool, soakIterations int, maxFailures int, soakRequestSize int, soakResponseSize int, perIterationMaxAcceptableLatency time.Duration, minTimeBetweenRPCs time.Duration)
func DoSpecialStatusMessage(ctx context.Context, tc testgrpc.TestServiceClient, args ...grpc.CallOption)
func DoStatusCodeAndMessage(ctx context.Context, tc testgrpc.TestServiceClient, args ...grpc.CallOption)
func DoTimeoutOnSleepingServer(ctx context.Context, tc testgrpc.TestServiceClient, args ...grpc.CallOption)
func DoUnimplementedMethod(ctx context.Context, cc *grpc.ClientConn)
func DoUnimplementedService(ctx context.Context, tc testgrpc.UnimplementedServiceClient)
func GetToken(ctx context.Context, serviceAccountKeyFile string, oauthScope string) *oauth2.Token
func NewTestServer(opts ...NewTestServerOptions) testgrpc.TestServiceServer
type NewTestServerOptions

Package files

orcalb.go test_utils.go

func ClientNewPayload

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

ClientNewPayload returns a payload of the given type and size.

func DoCancelAfterBegin

func DoCancelAfterBegin(ctx context.Context, tc testgrpc.TestServiceClient, args ...grpc.CallOption)

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

func DoCancelAfterFirstResponse

func DoCancelAfterFirstResponse(ctx context.Context, tc testgrpc.TestServiceClient, args ...grpc.CallOption)

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

func DoClientStreaming

func DoClientStreaming(ctx context.Context, tc testgrpc.TestServiceClient, args ...grpc.CallOption)

DoClientStreaming performs a client streaming RPC.

func DoComputeEngineChannelCredentials

func DoComputeEngineChannelCredentials(ctx context.Context, tc testgrpc.TestServiceClient, defaultServiceAccount string)

DoComputeEngineChannelCredentials performs an unary RPC with compute engine channel credentials

func DoComputeEngineCreds

func DoComputeEngineCreds(ctx context.Context, tc testgrpc.TestServiceClient, serviceAccount, oauthScope string)

DoComputeEngineCreds performs a unary RPC with compute engine auth.

func DoCustomMetadata

func DoCustomMetadata(ctx context.Context, tc testgrpc.TestServiceClient, args ...grpc.CallOption)

DoCustomMetadata checks that metadata is echoed back to the client.

func DoEmptyStream

func DoEmptyStream(ctx context.Context, tc testgrpc.TestServiceClient, args ...grpc.CallOption)

DoEmptyStream sets up a bi-directional streaming with zero message.

func DoEmptyUnaryCall

func DoEmptyUnaryCall(ctx context.Context, tc testgrpc.TestServiceClient, args ...grpc.CallOption)

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

func DoGoogleDefaultCredentials

func DoGoogleDefaultCredentials(ctx context.Context, tc testgrpc.TestServiceClient, defaultServiceAccount string)

DoGoogleDefaultCredentials performs an unary RPC with google default credentials

func DoJWTTokenCreds

func DoJWTTokenCreds(ctx context.Context, tc testgrpc.TestServiceClient, serviceAccountKeyFile string)

DoJWTTokenCreds performs a unary RPC with JWT token auth.

func DoLargeUnaryCall

func DoLargeUnaryCall(ctx context.Context, tc testgrpc.TestServiceClient, args ...grpc.CallOption)

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

func DoORCAOOBTest

func DoORCAOOBTest(ctx context.Context, tc testgrpc.TestServiceClient)

DoORCAOOBTest performs a streaming RPC that enables ORCA OOB reporting and verifies the load report sent to the LB policy's OOB listener.

func DoORCAPerRPCTest

func DoORCAPerRPCTest(ctx context.Context, tc testgrpc.TestServiceClient)

DoORCAPerRPCTest performs a unary RPC that enables ORCA per-call reporting and verifies the load report sent back to the LB policy's Done callback.

func DoOauth2TokenCreds

func DoOauth2TokenCreds(ctx context.Context, tc testgrpc.TestServiceClient, serviceAccountKeyFile, oauthScope string)

DoOauth2TokenCreds performs a unary RPC with OAUTH2 token auth.

func DoPerRPCCreds

func DoPerRPCCreds(ctx context.Context, tc testgrpc.TestServiceClient, serviceAccountKeyFile, oauthScope string)

DoPerRPCCreds performs a unary RPC with per RPC OAUTH2 token.

func DoPickFirstUnary

func DoPickFirstUnary(ctx context.Context, tc testgrpc.TestServiceClient)

DoPickFirstUnary runs multiple RPCs (rpcCount) and checks that all requests are sent to the same backend.

func DoPingPong

func DoPingPong(ctx context.Context, tc testgrpc.TestServiceClient, args ...grpc.CallOption)

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

func DoServerStreaming

func DoServerStreaming(ctx context.Context, tc testgrpc.TestServiceClient, args ...grpc.CallOption)

DoServerStreaming performs a server streaming RPC.

func DoServiceAccountCreds

func DoServiceAccountCreds(ctx context.Context, tc testgrpc.TestServiceClient, serviceAccountKeyFile, oauthScope string)

DoServiceAccountCreds performs a unary RPC with service account auth.

func DoSoakTest

func DoSoakTest(ctx context.Context, tc testgrpc.TestServiceClient, serverAddr string, dopts []grpc.DialOption, resetChannel bool, soakIterations int, maxFailures int, soakRequestSize int, soakResponseSize int, perIterationMaxAcceptableLatency time.Duration, minTimeBetweenRPCs time.Duration)

DoSoakTest runs large unary RPCs in a loop for a configurable number of times, with configurable failure thresholds. If resetChannel is false, then each RPC will be performed on tc. Otherwise, each RPC will be performed on a new stub that is created with the provided server address and dial options. TODO(mohanli-ml): Create SoakTestOptions as a parameter for this method.

func DoSpecialStatusMessage

func DoSpecialStatusMessage(ctx context.Context, tc testgrpc.TestServiceClient, args ...grpc.CallOption)

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

func DoStatusCodeAndMessage

func DoStatusCodeAndMessage(ctx context.Context, tc testgrpc.TestServiceClient, args ...grpc.CallOption)

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

func DoTimeoutOnSleepingServer

func DoTimeoutOnSleepingServer(ctx context.Context, tc testgrpc.TestServiceClient, args ...grpc.CallOption)

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

func DoUnimplementedMethod

func DoUnimplementedMethod(ctx context.Context, cc *grpc.ClientConn)

DoUnimplementedMethod attempts to call an unimplemented method.

func DoUnimplementedService

func DoUnimplementedService(ctx context.Context, tc testgrpc.UnimplementedServiceClient)

DoUnimplementedService attempts to call a method from an unimplemented service.

func GetToken

func GetToken(ctx context.Context, serviceAccountKeyFile string, oauthScope string) *oauth2.Token

GetToken obtains an OAUTH token from the input.

func NewTestServer

func NewTestServer(opts ...NewTestServerOptions) testgrpc.TestServiceServer

NewTestServer creates a test server for test service. opts carries optional settings and does not need to be provided. If multiple opts are provided, only the first one is used.

type NewTestServerOptions

NewTestServerOptions contains options that control the behavior of the test server returned by NewTestServer.

type NewTestServerOptions struct {
    MetricsRecorder orca.ServerMetricsRecorder
}

Subdirectories

Name Synopsis
..
alts
client This binary can only run on Google Cloud Platform (GCP).
server This binary can only run on Google Cloud Platform (GCP).
client Binary client is an interop client.
fake_grpclb This file is for testing only.
grpc_testing
core
grpclb_fallback Binary grpclb_fallback is an interop test client for grpclb fallback.
http2 Binary http2 is used to test http2 error edge cases like GOAWAYs and RST_STREAMs
server Binary server is an interop server.
stress
client client starts an interop client to do stress test and a metrics server to report qps.
grpc_testing
metrics_client Binary metrics_client is a client to retrieve metrics from the server.
xds Package xds contains various xds interop helpers for usage in interop tests.
client Binary client for xDS interop tests.
server Binary server is the server used for xDS interop tests.
xds_federation Binary client is an interop client.