aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/qps/client.h
diff options
context:
space:
mode:
Diffstat (limited to 'test/cpp/qps/client.h')
-rw-r--r--test/cpp/qps/client.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/test/cpp/qps/client.h b/test/cpp/qps/client.h
index e759446c1a..6c4d92e859 100644
--- a/test/cpp/qps/client.h
+++ b/test/cpp/qps/client.h
@@ -39,6 +39,7 @@
#include "test/cpp/qps/interarrival.h"
#include "test/cpp/qps/usage_timer.h"
#include "test/cpp/util/create_test_channel.h"
+#include "test/cpp/util/test_credentials_provider.h"
namespace grpc {
namespace testing {
@@ -88,9 +89,7 @@ class ClientRequestCreator<ByteBuffer> {
if (payload_config.has_bytebuf_params()) {
std::unique_ptr<char[]> buf(
new char[payload_config.bytebuf_params().req_size()]);
- grpc_slice s = grpc_slice_from_copied_buffer(
- buf.get(), payload_config.bytebuf_params().req_size());
- Slice slice(s, Slice::STEAL_REF);
+ Slice slice(buf.get(), payload_config.bytebuf_params().req_size());
*req = ByteBuffer(&slice, 1);
} else {
GPR_ASSERT(false); // not appropriate for this specialization
@@ -407,9 +406,18 @@ class ClientImpl : public Client {
ChannelArguments args;
args.SetInt("shard_to_ensure_no_subchannel_merges", shard);
set_channel_args(config, &args);
+
+ grpc::string type;
+ if (config.has_security_params() &&
+ config.security_params().cred_type().empty()) {
+ type = kTlsCredentialsType;
+ } else {
+ type = config.security_params().cred_type();
+ }
+
channel_ = CreateTestChannel(
- target, config.security_params().server_host_override(),
- config.has_security_params(), !config.security_params().use_test_ca(),
+ target, type, config.security_params().server_host_override(),
+ !config.security_params().use_test_ca(),
std::shared_ptr<CallCredentials>(), args);
gpr_log(GPR_INFO, "Connecting to %s", target.c_str());
GPR_ASSERT(channel_->WaitForConnected(