diff options
author | yang-g <yangg@google.com> | 2015-11-18 11:41:30 -0800 |
---|---|---|
committer | yang-g <yangg@google.com> | 2015-11-18 11:41:30 -0800 |
commit | 71b962634eceacae336b1c706829e4ad9621b397 (patch) | |
tree | 35378c669bf04c24097a403af65a5adb8c82e812 /test/cpp/interop | |
parent | 42630b010f398ca072a0ba89648855c3052c6594 (diff) | |
parent | 75b53d6a5d891fa33a9173318b1446faeaf154e4 (diff) |
merge with head
Diffstat (limited to 'test/cpp/interop')
-rw-r--r-- | test/cpp/interop/client_helper.cc | 14 | ||||
-rw-r--r-- | test/cpp/interop/interop_client.cc | 4 | ||||
-rw-r--r-- | test/cpp/interop/stress_interop_client.cc | 4 | ||||
-rw-r--r-- | test/cpp/interop/stress_test.cc | 6 |
4 files changed, 14 insertions, 14 deletions
diff --git a/test/cpp/interop/client_helper.cc b/test/cpp/interop/client_helper.cc index 61b46d25aa..5caf0f2d1d 100644 --- a/test/cpp/interop/client_helper.cc +++ b/test/cpp/interop/client_helper.cc @@ -76,11 +76,11 @@ grpc::string GetServiceAccountJsonKey() { } grpc::string GetOauth2AccessToken() { - std::shared_ptr<Credentials> creds = GoogleComputeEngineCredentials(); - SecureCredentials* secure_creds = - dynamic_cast<SecureCredentials*>(creds.get()); + std::shared_ptr<CallCredentials> creds = GoogleComputeEngineCredentials(); + SecureCallCredentials* secure_creds = + dynamic_cast<SecureCallCredentials*>(creds.get()); GPR_ASSERT(secure_creds != nullptr); - grpc_credentials* c_creds = secure_creds->GetRawCreds(); + grpc_call_credentials* c_creds = secure_creds->GetRawCreds(); char* token = grpc_test_fetch_oauth2_token_with_credentials(c_creds); GPR_ASSERT(token != nullptr); gpr_log(GPR_INFO, "Get raw oauth2 access token: %s", token); @@ -98,13 +98,13 @@ std::shared_ptr<Channel> CreateChannelForTestCase( FLAGS_server_port); if (test_case == "compute_engine_creds") { - std::shared_ptr<Credentials> 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); } else if (test_case == "jwt_token_creds") { - std::shared_ptr<Credentials> 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); @@ -114,7 +114,7 @@ std::shared_ptr<Channel> CreateChannelForTestCase( FLAGS_use_tls, !FLAGS_use_test_ca, creds); } else if (test_case == "oauth2_auth_token") { grpc::string raw_token = GetOauth2AccessToken(); - std::shared_ptr<Credentials> creds = AccessTokenCredentials(raw_token); + 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 { diff --git a/test/cpp/interop/interop_client.cc b/test/cpp/interop/interop_client.cc index 96502e5879..6340007fa4 100644 --- a/test/cpp/interop/interop_client.cc +++ b/test/cpp/interop/interop_client.cc @@ -46,7 +46,7 @@ #include <grpc++/client_context.h> #include <grpc++/security/credentials.h> -#include "src/core/transport/stream_op.h" +#include "src/core/transport/byte_stream.h" #include "test/cpp/interop/client_helper.h" #include "test/proto/test.grpc.pb.h" #include "test/proto/empty.grpc.pb.h" @@ -244,7 +244,7 @@ void InteropClient::DoPerRpcCreds(const grpc::string& json_key) { ClientContext context; std::chrono::seconds token_lifetime = std::chrono::hours(1); - std::shared_ptr<Credentials> creds = + std::shared_ptr<CallCredentials> creds = ServiceAccountJWTAccessCredentials(json_key, token_lifetime.count()); context.set_credentials(creds); diff --git a/test/cpp/interop/stress_interop_client.cc b/test/cpp/interop/stress_interop_client.cc index f8c55cf795..3be2571493 100644 --- a/test/cpp/interop/stress_interop_client.cc +++ b/test/cpp/interop/stress_interop_client.cc @@ -89,9 +89,9 @@ StressTestInteropClient::StressTestInteropClient( test_duration_secs_(test_duration_secs), sleep_duration_ms_(sleep_duration_ms) { // TODO(sreek): This will change once we add support for other tests - // that won't work with InsecureCredentials() + // that won't work with InsecureChannelCredentials() std::shared_ptr<Channel> channel( - CreateChannel(server_address, InsecureCredentials())); + CreateChannel(server_address, InsecureChannelCredentials())); interop_client_.reset(new InteropClient(channel, false)); } diff --git a/test/cpp/interop/stress_test.cc b/test/cpp/interop/stress_test.cc index 5d1419728e..018f4ab4f7 100644 --- a/test/cpp/interop/stress_test.cc +++ b/test/cpp/interop/stress_test.cc @@ -41,6 +41,7 @@ #include <grpc/support/time.h> #include <grpc++/create_channel.h> #include <grpc++/grpc++.h> +#include <grpc++/impl/thd.h> #include "test/cpp/interop/interop_client.h" #include "test/cpp/interop/stress_interop_client.h" @@ -80,7 +81,6 @@ DEFINE_string(test_cases, "", using std::make_pair; using std::pair; -using std::thread; using std::vector; using grpc::testing::kTestCaseList; @@ -202,7 +202,7 @@ int main(int argc, char** argv) { gpr_log(GPR_INFO, "Starting test(s).."); - vector<thread> test_threads; + vector<grpc::thread> test_threads; int thread_idx = 0; for (auto it = server_addresses.begin(); it != server_addresses.end(); it++) { StressTestInteropClient* client = new StressTestInteropClient( @@ -210,7 +210,7 @@ int main(int argc, char** argv) { FLAGS_sleep_duration_ms); test_threads.emplace_back( - thread(&StressTestInteropClient::MainLoop, client)); + grpc::thread(&StressTestInteropClient::MainLoop, client)); } for (auto it = test_threads.begin(); it != test_threads.end(); it++) { |