Client and server use test.proto and the gRPC over HTTP/2 v2 protocol.
Clients implement test cases that test certain functionally. Each client is provided the test case it is expected to run as a command-line parameter. Names should be lowercase and without spaces.
Clients should accept these arguments:
Clients must support TLS with ALPN. Clients must not disable certificate checking.
This test verifies that implementations support zero-size messages. Ideally, client implementations would verify that the request and response were zero bytes serialized, but this is generally prohibitive to perform, so is not required.
Server features:
Procedure:
Asserts:
It may be possible to use UnaryCall instead of EmptyCall, but it is harder to ensure that the proto serialized to zero bytes.
This test verifies unary calls succeed in sending messages, and touches on flow control (even if compression is enabled on the channel).
Server features:
Procedure:
Client calls UnaryCall with:
{ response_type: COMPRESSABLE response_size: 314159 payload:{ body: 271828 bytes of zeros } }
Asserts:
This test verifies that client-only streaming succeeds.
Server features:
Procedure:
Client calls StreamingInputCall
Client sends:
{ payload:{ body: 27182 bytes of zeros } }
Client then sends:
{ payload:{ body: 8 bytes of zeros } }
Client then sends:
{ payload:{ body: 1828 bytes of zeros } }
Client then sends:
{ payload:{ body: 45904 bytes of zeros } }
Client halfCloses
Asserts:
This test verifies that server-only streaming succeeds.
Server features:
Procedure:
Client calls StreamingOutputCall with:
{ response_type:COMPRESSABLE response_parameters:{ size: 31415 } response_parameters:{ size: 9 } response_parameters:{ size: 2653 } response_parameters:{ size: 58979 } }
Asserts:
This test verifies that full duplex bidi is supported.
Server features:
Procedure:
Client calls FullDuplexCall with:
{ response_type: COMPRESSABLE response_parameters:{ size: 31415 } payload:{ body: 27182 bytes of zeros } }
After getting a reply, it sends:
{ response_type: COMPRESSABLE response_parameters:{ size: 9 } payload:{ body: 8 bytes of zeros } }
After getting a reply, it sends:
{ response_type: COMPRESSABLE response_parameters:{ size: 2653 } payload:{ body: 1828 bytes of zeros } }
After getting a reply, it sends:
{ response_type: COMPRESSABLE response_parameters:{ size: 58979 } payload:{ body: 45904 bytes of zeros } }
Asserts:
This test verifies that streams support having zero-messages in both directions.
Server features:
Procedure:
Asserts:
This test is only for cloud-to-prod path.
This test verifies unary calls succeed in sending messages while using Service Credentials from GCE metadata server. The client instance needs to be created with desired oauth scope.
The test uses --default_service_account
with GCE service account email and --oauth_scope
with the OAuth scope to use. For testing against grpc-test.sandbox.google.com, "https://www.googleapis.com/auth/xapi.zoo" should be passed in as --oauth_scope
.
Server features:
Procedure:
Client configures channel to use GCECredentials
Client calls UnaryCall on the channel with:
{ response_type: COMPRESSABLE response_size: 314159 payload:{ body: 271828 bytes of zeros } fill_username: true fill_oauth_scope: true }
Asserts:
--default_service_account
flag--oauth_scope
This test is only for cloud-to-prod path.
This test verifies unary calls succeed in sending messages while using JWT signing keys (redeemed for OAuth2 access tokens by the auth implementation)
The test uses --service_account_key_file
with the path to a json key file downloaded from https://console.developers.google.com, and --oauth_scope
to the oauth scope. For testing against grpc-test.sandbox.google.com, "https://www.googleapis.com/auth/xapi.zoo" should be passed in as --oauth_scope
.
Server features:
Procedure:
Client configures the channel to use ServiceAccountCredentials.
Client calls UnaryCall with:
{ response_type: COMPRESSABLE response_size: 314159 payload:{ body: 271828 bytes of zeros } fill_username: true fill_oauth_scope: true }
Asserts:
--service_account_key_file
--oauth_scope
This test is only for cloud-to-prod path.
This test verifies unary calls succeed in sending messages while using JWT token (created by the project's key file)
Test caller should set flag --service_account_key_file
with the path to json key file downloaded from https://console.developers.google.com.
Server features:
Procedure:
Client configures the channel to use JWTTokenCredentials.
Client calls UnaryCall with:
{ response_type: COMPRESSABLE response_size: 314159 payload:{ body: 271828 bytes of zeros } fill_username: true }
Asserts:
--service_account_key_file
Status: Not yet implementable
This test verifies that custom metadata in either binary or ascii format can be sent in header and trailer.
Server features:
Procedure:
While sending custom metadata (ascii + binary) in the header, client calls UnaryCall with:
{ response_type: COMPRESSABLE response_size: 314159 payload:{ body: 271828 bytes of zeros } }
Asserts:
Status: Not yet implementable
This test verifies unary calls succeed in sending messages, and propagates back status code and message sent along with the messages.
Server features:
Procedure:
Client calls UnaryCall with:
{ response_status:{ code: 2 message: "test status message" } }
Asserts:
Status: Not yet implementable
This test verifies calling unimplemented RPC method returns unimplemented status.
Procedure:
Client calls UnimplementedCall with:
{ response_type: COMPRESSABLE response_size: 314159 payload:{ body: 271828 bytes of zeros } }
Asserts:
This test verifies that a request can be cancelled after metadata has been sent but before payloads are sent.
Server features:
Procedure:
Asserts:
This test verifies that a request can be cancelled after receiving a message from the server.
Server features:
Procedure:
Client starts FullDuplexCall with
{ response_type: COMPRESSABLE response_parameters:{ size: 31415 } payload:{ body: 27182 bytes of zeros } }
After receiving a response, client cancels request
Asserts:
This test verifies that an RPC request whose lifetime exceeds its configured timeout value will end with the DeadlineExceeded status.
Server features:
Procedure:
Client calls FullDuplexCall with the following request and sets its timeout to 1ms.
{ response_type: COMPRESSABLE response_parameters:{ interval_us: 3000 } payload:{ body: 27182 bytes of zeros } }
Server will sleep for the configured interval_us and client waits for the status.
Asserts:
Status: TODO
Client performs 1000 large_unary tests in parallel on the same channel.
Status: TODO
This test verifies that a client sending faster than a server can drain sees pushback (i.e., attempts to send succeed only after appropriate delays).
Propagation of status code and message (yangg)
Cancel after sent headers (ctiller - done)
Cancel after received first message (ctiller - done)
Zero-message streams (ejona)
Multiple thousand simultaneous calls on same Channel (ctiller - done)
OAuth2 tokens + Service Credentials from GCE metadata server (GCE->prod only) (abhishek)
OAuth2 tokens + JWT signing key (GCE->prod only) (abhishek)
Metadata: client headers, server headers + trailers, binary+ascii (chenw)
Cancel before start (ctiller)
Cancel after sent first message (ctiller)
Cancel after received headers (ctiller)
Timeout but completed before expire (zhaoq)
Multiple thousand simultaneous calls timeout on same Channel (ctiller)
Flow control. Pushback at client for large messages (abhishek)
Flow control. Pushback at server for large messages (abhishek)
Going over max concurrent streams doesn't fail (client controls itself) (abhishek)
RPC method not implemented (yangg)
Multiple thousand simultaneous calls on different Channels (ctiller)
Failed TLS hostname verification (ejona?)
Start streaming RPC but don't send any requests, server responds
Resilience to buggy servers: These tests would verify that a client application isn't affected negatively by the responses put on the wire by a buggy server (e.g. the client library won't make the application crash).
Reconnect after transport failure
Reconnect backoff
Fuzz testing
Servers implement various named features for clients to test with. Server features are orthogonal. If a server implements a feature, it is always available for clients. Names are simple descriptions for developer communication and tracking.
Servers should accept these arguments:
--port=PORT
--use_tls=BOOLEAN
Servers must support TLS with ALPN. They should use server1.pem for their certificate.
Server implements EmptyCall which immediately returns the empty message.
Server implements UnaryCall which immediately returns a SimpleResponse with a payload body of size SimpleRequest.response_size bytes and type as appropriate for the SimpleRequest.response_type. If the server does not support the response_type, then it should fail the RPC with INVALID_ARGUMENT.
Server implements StreamingInputCall which upon half close immediately returns a StreamingInputCallResponse where aggregated_payload_size is the sum of all request payload bodies received.
Server implements StreamingOutputCall by replying, in order, with one StreamingOutputCallResponses for each ResponseParameters in StreamingOutputCallRequest. Each StreamingOutputCallResponses should have a payload body of size ResponseParameters.size bytes, as specified by its respective ResponseParameters. After sending all responses, it closes with OK.
Server implements FullDuplexCall by replying, in order, with one StreamingOutputCallResponses for each ResponseParameters in each StreamingOutputCallRequest. Each StreamingOutputCallResponses should have a payload body of size ResponseParameters.size bytes, as specified by its respective ResponseParameters. After receiving half close and sending all responses, it closes with OK.
When the client requests COMPRESSABLE payload, the response includes a payload of the size requested containing all zeros and the payload type is COMPRESSABLE.
In StreamingOutputCall and FullDuplexCall, server delays sending a StreamingOutputCallResponse by the ResponseParameters's interval_us for that particular response, relative to the last response sent. That is, interval_us acts like a sleep before sending the response and accumulates from one response to the next.
Interaction with flow control is unspecified.
Status: Pending
If a SimpleRequest has fill_username=true and that request was successfully authenticated, then the SimpleResponse should have username filled with the canonical form of the authenticated source. The canonical form is dependent on the authentication method, but is likely to be a base 10 integer identifier or an email address.
If a SimpleRequest has fill_oauth_scope=true and that request was successfully authenticated via OAuth, then the SimpleResponse should have oauth_scope filled with the scope of the method being invoked.
Although a general server-side feature, most test servers won't implement this feature. The TLS server grpc-test.sandbox.google.com:443 supports this feature. It requires at least the OAuth scope https://www.googleapis.com/auth/xapi.zoo
for authentication to succeed.
Discussion:
Ideally, this would be communicated via metadata and not in the request/response, but we want to use this test in code paths that don't yet fully communicate metadata.