|
|
@ -62,6 +62,8 @@ DEFINE_string(test_case, "large_unary", |
|
|
|
" streaming with slow client consumer; " |
|
|
|
" streaming with slow client consumer; " |
|
|
|
"half_duplex : half-duplex streaming; " |
|
|
|
"half_duplex : half-duplex streaming; " |
|
|
|
"ping_pong : full-duplex streaming; " |
|
|
|
"ping_pong : full-duplex streaming; " |
|
|
|
|
|
|
|
"cancel_after_begin : cancel stream after starting it; " |
|
|
|
|
|
|
|
"cancel_after_first_response: cancel on first response; " |
|
|
|
"service_account_creds : large_unary with service_account auth; " |
|
|
|
"service_account_creds : large_unary with service_account auth; " |
|
|
|
"compute_engine_creds: large_unary with compute engine auth; " |
|
|
|
"compute_engine_creds: large_unary with compute engine auth; " |
|
|
|
"jwt_token_creds: large_unary with JWT token auth; " |
|
|
|
"jwt_token_creds: large_unary with JWT token auth; " |
|
|
@ -95,6 +97,10 @@ int main(int argc, char** argv) { |
|
|
|
client.DoHalfDuplex(); |
|
|
|
client.DoHalfDuplex(); |
|
|
|
} else if (FLAGS_test_case == "ping_pong") { |
|
|
|
} else if (FLAGS_test_case == "ping_pong") { |
|
|
|
client.DoPingPong(); |
|
|
|
client.DoPingPong(); |
|
|
|
|
|
|
|
} else if (FLAGS_test_case == "cancel_after_begin") { |
|
|
|
|
|
|
|
client.DoCancelAfterBegin(); |
|
|
|
|
|
|
|
} else if (FLAGS_test_case == "cancel_after_first_response") { |
|
|
|
|
|
|
|
client.DoCancelAfterFirstResponse(); |
|
|
|
} else if (FLAGS_test_case == "service_account_creds") { |
|
|
|
} else if (FLAGS_test_case == "service_account_creds") { |
|
|
|
grpc::string json_key = GetServiceAccountJsonKey(); |
|
|
|
grpc::string json_key = GetServiceAccountJsonKey(); |
|
|
|
client.DoServiceAccountCreds(json_key, FLAGS_oauth_scope); |
|
|
|
client.DoServiceAccountCreds(json_key, FLAGS_oauth_scope); |
|
|
@ -111,6 +117,8 @@ int main(int argc, char** argv) { |
|
|
|
client.DoResponseStreaming(); |
|
|
|
client.DoResponseStreaming(); |
|
|
|
client.DoHalfDuplex(); |
|
|
|
client.DoHalfDuplex(); |
|
|
|
client.DoPingPong(); |
|
|
|
client.DoPingPong(); |
|
|
|
|
|
|
|
client.DoCancelAfterBegin(); |
|
|
|
|
|
|
|
client.DoCancelAfterFirstResponse(); |
|
|
|
// service_account_creds and jwt_token_creds can only run with ssl.
|
|
|
|
// service_account_creds and jwt_token_creds can only run with ssl.
|
|
|
|
if (FLAGS_enable_ssl) { |
|
|
|
if (FLAGS_enable_ssl) { |
|
|
|
grpc::string json_key = GetServiceAccountJsonKey(); |
|
|
|
grpc::string json_key = GetServiceAccountJsonKey(); |
|
|
@ -123,6 +131,7 @@ int main(int argc, char** argv) { |
|
|
|
GPR_ERROR, |
|
|
|
GPR_ERROR, |
|
|
|
"Unsupported test case %s. Valid options are all|empty_unary|" |
|
|
|
"Unsupported test case %s. Valid options are all|empty_unary|" |
|
|
|
"large_unary|client_streaming|server_streaming|half_duplex|ping_pong|" |
|
|
|
"large_unary|client_streaming|server_streaming|half_duplex|ping_pong|" |
|
|
|
|
|
|
|
"cancel_after_begin|cancel_after_first_response|" |
|
|
|
"service_account_creds|compute_engine_creds|jwt_token_creds", |
|
|
|
"service_account_creds|compute_engine_creds|jwt_token_creds", |
|
|
|
FLAGS_test_case.c_str()); |
|
|
|
FLAGS_test_case.c_str()); |
|
|
|
ret = 1; |
|
|
|
ret = 1; |
|
|
|