xDS Interop Client changes for PSM security tests (#25613)

pull/25618/head
Yash Tibrewal 4 years ago committed by GitHub
parent a2697e4592
commit 4b9ec936e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 28
      BUILD
  2. 12
      test/cpp/interop/xds_interop_client.cc

28
BUILD

@ -357,6 +357,22 @@ grpc_cc_library(
grpc_cc_library( grpc_cc_library(
name = "grpc++", name = "grpc++",
language = "c++",
select_deps = {
"grpc_no_xds": [],
"//conditions:default": [
"grpc++_xds_client",
"grpc++_xds_server",
],
},
standalone = True,
deps = [
"grpc++_internals",
],
)
grpc_cc_library(
name = "grpc++_internals",
srcs = [ srcs = [
"src/cpp/client/insecure_credentials.cc", "src/cpp/client/insecure_credentials.cc",
"src/cpp/client/secure_credentials.cc", "src/cpp/client/secure_credentials.cc",
@ -382,14 +398,6 @@ grpc_cc_library(
], ],
language = "c++", language = "c++",
public_hdrs = GRPCXX_PUBLIC_HDRS, public_hdrs = GRPCXX_PUBLIC_HDRS,
select_deps = {
"grpc_no_xds": [],
"//conditions:default": [
"grpc++_xds_client",
"grpc++_xds_server",
],
},
standalone = True,
deps = [ deps = [
"gpr", "gpr",
"grpc", "grpc",
@ -411,7 +419,7 @@ grpc_cc_library(
], ],
language = "c++", language = "c++",
deps = [ deps = [
"grpc++_base", "grpc++_internals",
], ],
) )
@ -428,7 +436,7 @@ grpc_cc_library(
"include/grpcpp/xds_server_builder.h", "include/grpcpp/xds_server_builder.h",
], ],
deps = [ deps = [
"grpc++_base", "grpc++_internals",
], ],
) )

@ -59,6 +59,8 @@ ABSL_FLAG(std::string, rpc, "UnaryCall",
ABSL_FLAG(std::string, metadata, "", "metadata to send with the RPC."); ABSL_FLAG(std::string, metadata, "", "metadata to send with the RPC.");
ABSL_FLAG(std::string, expect_status, "OK", ABSL_FLAG(std::string, expect_status, "OK",
"RPC status for the test RPC to be considered successful"); "RPC status for the test RPC to be considered successful");
ABSL_FLAG(std::string, security, "none",
"If set to \"secure\", XdsCredentials are used");
using grpc::Channel; using grpc::Channel;
using grpc::ClientAsyncResponseReader; using grpc::ClientAsyncResponseReader;
@ -460,9 +462,13 @@ class XdsUpdateClientConfigureServiceImpl
void RunTestLoop(std::chrono::duration<double> duration_per_query, void RunTestLoop(std::chrono::duration<double> duration_per_query,
StatsWatchers* stats_watchers, StatsWatchers* stats_watchers,
RpcConfigurationsQueue* rpc_configs_queue) { RpcConfigurationsQueue* rpc_configs_queue) {
TestClient client(grpc::CreateChannel(absl::GetFlag(FLAGS_server), TestClient client(
grpc::InsecureChannelCredentials()), grpc::CreateChannel(absl::GetFlag(FLAGS_server),
stats_watchers); absl::GetFlag(FLAGS_security) == "secure"
? grpc::experimental::XdsCredentials(
grpc::InsecureChannelCredentials())
: grpc::InsecureChannelCredentials()),
stats_watchers);
std::chrono::time_point<std::chrono::system_clock> start = std::chrono::time_point<std::chrono::system_clock> start =
std::chrono::system_clock::now(); std::chrono::system_clock::now();
std::chrono::duration<double> elapsed; std::chrono::duration<double> elapsed;

Loading…
Cancel
Save