diff options
author | David Garcia Quintas <dgq@google.com> | 2016-05-31 13:59:37 -0700 |
---|---|---|
committer | David Garcia Quintas <dgq@google.com> | 2016-05-31 13:59:37 -0700 |
commit | 8bec6f6a55afaa1e321f29bf816d2a010f510b3c (patch) | |
tree | 525e06b564b9d23d8340e25e7ddb9915fec0b1e5 /test/cpp/interop/client_helper.cc | |
parent | 582f4350ed755aac0b07f12b499ad18f86f2a1b7 (diff) | |
parent | 0d6196025e62aea5aabc6341459f2c370e264230 (diff) |
Merge branch 'master' of github.com:grpc/grpc into lb_pollset_propagation
Diffstat (limited to 'test/cpp/interop/client_helper.cc')
-rw-r--r-- | test/cpp/interop/client_helper.cc | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/test/cpp/interop/client_helper.cc b/test/cpp/interop/client_helper.cc index c8b1e505c1..c171969e14 100644 --- a/test/cpp/interop/client_helper.cc +++ b/test/cpp/interop/client_helper.cc @@ -97,30 +97,25 @@ std::shared_ptr<Channel> CreateChannelForTestCase( snprintf(host_port, host_port_buf_size, "%s:%d", FLAGS_server_host.c_str(), FLAGS_server_port); + std::shared_ptr<CallCredentials> creds; if (test_case == "compute_engine_creds") { - std::shared_ptr<CallCredentials> creds; GPR_ASSERT(FLAGS_use_tls); creds = GoogleComputeEngineCredentials(); - return CreateTestChannel(host_port, FLAGS_server_host_override, - FLAGS_use_tls, !FLAGS_use_test_ca, creds); + GPR_ASSERT(creds); } else if (test_case == "jwt_token_creds") { - std::shared_ptr<CallCredentials> creds; GPR_ASSERT(FLAGS_use_tls); grpc::string json_key = GetServiceAccountJsonKey(); std::chrono::seconds token_lifetime = std::chrono::hours(1); creds = ServiceAccountJWTAccessCredentials(json_key, token_lifetime.count()); - return CreateTestChannel(host_port, FLAGS_server_host_override, - FLAGS_use_tls, !FLAGS_use_test_ca, creds); + GPR_ASSERT(creds); } else if (test_case == "oauth2_auth_token") { grpc::string raw_token = GetOauth2AccessToken(); - std::shared_ptr<CallCredentials> creds = AccessTokenCredentials(raw_token); - return CreateTestChannel(host_port, FLAGS_server_host_override, - FLAGS_use_tls, !FLAGS_use_test_ca, creds); - } else { - return CreateTestChannel(host_port, FLAGS_server_host_override, - FLAGS_use_tls, !FLAGS_use_test_ca); + creds = AccessTokenCredentials(raw_token); + GPR_ASSERT(creds); } + return CreateTestChannel(host_port, FLAGS_server_host_override, FLAGS_use_tls, + !FLAGS_use_test_ca, creds); } } // namespace testing |