xds_end2end_test_lib.cc
Go to the documentation of this file.
1 // Copyright 2017 gRPC authors.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 //
15 
17 
18 #include <functional>
19 #include <map>
20 #include <memory>
21 #include <set>
22 #include <string>
23 #include <thread>
24 #include <vector>
25 
26 #include <gmock/gmock.h>
27 #include <gtest/gtest.h>
28 
29 #include "absl/memory/memory.h"
30 #include "absl/strings/str_cat.h"
31 #include "absl/strings/str_format.h"
32 #include "absl/strings/str_join.h"
33 #include "absl/strings/str_replace.h"
34 #include "absl/strings/string_view.h"
35 #include "absl/types/optional.h"
36 
38 
42 #include "src/core/lib/gpr/env.h"
47 #include "src/proto/grpc/testing/xds/v3/router.grpc.pb.h"
50 
51 namespace grpc {
52 namespace testing {
53 
54 using ::envoy::config::endpoint::v3::ClusterLoadAssignment;
55 using ::envoy::config::endpoint::v3::HealthStatus;
57 using ::envoy::extensions::filters::network::http_connection_manager::v3::
58  HttpConnectionManager;
59 
60 using ::grpc::experimental::ExternalCertificateVerifier;
61 using ::grpc::experimental::IdentityKeyCertPair;
62 using ::grpc::experimental::StaticDataCertificateProvider;
63 
64 //
65 // XdsEnd2endTest::ServerThread::XdsServingStatusNotifier
66 //
67 
69  OnServingStatusUpdate(std::string uri, ServingStatusUpdate update) {
71  status_map[uri] = update.status;
72  cond_.Signal();
73 }
74 
77  grpc::StatusCode expected_status) {
80  while ((it = status_map.find(uri)) == status_map.end() ||
81  it->second.error_code() != expected_status) {
82  cond_.Wait(&mu_);
83  }
84 }
85 
86 //
87 // XdsEnd2endTest::ServerThread::XdsChannelArgsServerBuilderOption
88 //
89 
90 namespace {
91 
92 // Channel arg pointer vtable for storing xDS channel args in the parent
93 // channel's channel args.
94 void* ChannelArgsArgCopy(void* p) {
95  auto* args = static_cast<grpc_channel_args*>(p);
97 }
98 void ChannelArgsArgDestroy(void* p) {
99  auto* args = static_cast<grpc_channel_args*>(p);
101 }
102 int ChannelArgsArgCmp(void* a, void* b) {
103  auto* args_a = static_cast<grpc_channel_args*>(a);
104  auto* args_b = static_cast<grpc_channel_args*>(b);
105  return grpc_channel_args_compare(args_a, args_b);
106 }
107 const grpc_arg_pointer_vtable kChannelArgsArgVtable = {
108  ChannelArgsArgCopy, ChannelArgsArgDestroy, ChannelArgsArgCmp};
109 
110 } // namespace
111 
113  : public grpc::ServerBuilderOption {
114  public:
116  : test_obj_(test_obj) {}
117 
121  args->SetPointerWithVtable(
123  &test_obj_->xds_channel_args_, &kChannelArgsArgVtable);
124  }
125 
127  std::vector<std::unique_ptr<grpc::ServerBuilderPlugin>>* /*plugins*/)
128  override {}
129 
130  private:
132 };
133 
134 //
135 // XdsEnd2endTest::ServerThread
136 //
137 
139  gpr_log(GPR_INFO, "starting %s server on port %d", Type(), port_);
141  running_ = true;
144  // We need to acquire the lock here in order to prevent the notify_one
145  // by ServerThread::Serve from firing before the wait below is hit.
146  grpc_core::MutexLock lock(&mu);
148  thread_ = absl::make_unique<std::thread>(
149  std::bind(&ServerThread::Serve, this, &mu, &cond));
150  cond.Wait(&mu);
151  gpr_log(GPR_INFO, "%s server startup complete", Type());
152 }
153 
155  if (!running_) return;
156  gpr_log(GPR_INFO, "%s about to shutdown", Type());
159  thread_->join();
160  gpr_log(GPR_INFO, "%s shutdown completed", Type());
161  running_ = false;
162 }
163 
165  gpr_log(GPR_INFO, "%s sending GOAWAYs", Type());
166  {
168  auto* server = grpc_core::Server::FromC(server_->c_server());
169  server->StopListening();
170  server->SendGoaways();
171  }
172  gpr_log(GPR_INFO, "%s done sending GOAWAYs", Type());
173 }
174 
177  // We need to acquire the lock here in order to prevent the notify_one
178  // below from firing before its corresponding wait is executed.
179  grpc_core::MutexLock lock(mu);
180  std::string server_address = absl::StrCat("localhost:", port_);
183  if (GetParam().bootstrap_source() ==
185  builder.SetOption(
186  absl::make_unique<XdsChannelArgsServerBuilderOption>(test_obj_));
187  }
188  builder.set_status_notifier(&notifier_);
189  builder.experimental().set_drain_grace_time(
191  builder.AddListeningPort(server_address, Credentials());
192  // Allow gRPC Core's HTTP server to accept PUT requests for testing
193  // purposes.
194  if (allow_put_requests_) {
195  builder.AddChannelArgument(
197  true);
198  }
200  server_ = builder.BuildAndStart();
201  } else {
203  builder.AddListeningPort(server_address, Credentials());
205  server_ = builder.BuildAndStart();
206  }
207  cond->Signal();
208 }
209 
210 //
211 // XdsEnd2endTest::BackendServerThread
212 //
213 
215  XdsEnd2endTest* test_obj, bool use_xds_enabled_server)
216  : ServerThread(test_obj, use_xds_enabled_server) {
219  test_obj->balancer_.get(), test_obj->default_server_listener_, port(),
220  test_obj->default_server_route_config_);
221  }
222 }
223 
224 std::shared_ptr<ServerCredentials>
226  if (GetParam().use_xds_credentials()) {
227  if (use_xds_enabled_server()) {
228  // We are testing server's use of XdsServerCredentials
230  } else {
231  // We are testing client's use of XdsCredentials
232  std::string root_cert = ReadFile(kCaCertPath);
233  std::string identity_cert = ReadFile(kServerCertPath);
235  std::vector<experimental::IdentityKeyCertPair> identity_key_cert_pairs = {
236  {private_key, identity_cert}};
237  auto certificate_provider =
238  std::make_shared<grpc::experimental::StaticDataCertificateProvider>(
239  root_cert, identity_key_cert_pairs);
241  certificate_provider);
242  options.watch_root_certs();
243  options.watch_identity_key_cert_pairs();
244  options.set_cert_request_type(
247  }
248  }
249  return ServerThread::Credentials();
250 }
251 
254  builder->RegisterService(&backend_service_);
255  builder->RegisterService(&backend_service1_);
256  builder->RegisterService(&backend_service2_);
257 }
258 
260  backend_service_.Start();
261  backend_service1_.Start();
262  backend_service2_.Start();
263 }
264 
266  backend_service_.Shutdown();
267  backend_service1_.Shutdown();
268  backend_service2_.Shutdown();
269 }
270 
271 //
272 // XdsEnd2endTest::BalancerServerThread
273 //
274 
276  XdsEnd2endTest* test_obj)
277  : ServerThread(test_obj, /*use_xds_enabled_server=*/false),
278  ads_service_(new AdsServiceImpl()),
279  lrs_service_(new LrsServiceImpl(
280  (GetParam().enable_load_reporting() ? 20 * grpc_test_slowdown_factor()
281  : 0),
282  {kDefaultClusterName})) {}
283 
286  builder->RegisterService(ads_service_->v2_rpc_service());
287  builder->RegisterService(ads_service_->v3_rpc_service());
288  builder->RegisterService(lrs_service_->v2_rpc_service());
289  builder->RegisterService(lrs_service_->v3_rpc_service());
290 }
291 
293  ads_service_->Start();
294  lrs_service_->Start();
295 }
296 
298  ads_service_->Shutdown();
299  lrs_service_->Shutdown();
300 }
301 
302 //
303 // XdsEnd2endTest::BootstrapBuilder
304 //
305 
307  std::vector<std::string> fields;
308  fields.push_back(MakeXdsServersText(top_server_));
309  if (!client_default_listener_resource_name_template_.empty()) {
310  fields.push_back(
311  absl::StrCat(" \"client_default_listener_resource_name_template\": \"",
312  client_default_listener_resource_name_template_, "\""));
313  }
314  fields.push_back(MakeNodeText());
315  if (!server_listener_resource_name_template_.empty()) {
316  fields.push_back(
317  absl::StrCat(" \"server_listener_resource_name_template\": \"",
318  server_listener_resource_name_template_, "\""));
319  }
320  fields.push_back(MakeCertificateProviderText());
321  fields.push_back(MakeAuthorityText());
322  return absl::StrCat("{", absl::StrJoin(fields, ",\n"), "}");
323 }
324 
327  constexpr char kXdsServerTemplate[] =
328  " \"xds_servers\": [\n"
329  " {\n"
330  " \"server_uri\": \"<SERVER_URI>\",\n"
331  " \"channel_creds\": [\n"
332  " {\n"
333  " \"type\": \"fake\"\n"
334  " }\n"
335  " ],\n"
336  " \"server_features\": [<SERVER_FEATURES>]\n"
337  " }\n"
338  " ]";
339  std::vector<std::string> server_features;
340  if (!v2_) server_features.push_back("\"xds_v3\"");
341  if (ignore_resource_deletion_) {
342  server_features.push_back("\"ignore_resource_deletion\"");
343  }
344  return absl::StrReplaceAll(
345  kXdsServerTemplate,
346  {{"<SERVER_URI>", server_uri},
347  {"<SERVER_FEATURES>", absl::StrJoin(server_features, ", ")}});
348 }
349 
351  constexpr char kXdsNode[] =
352  " \"node\": {\n"
353  " \"id\": \"xds_end2end_test\",\n"
354  " \"cluster\": \"test\",\n"
355  " \"metadata\": {\n"
356  " \"foo\": \"bar\"\n"
357  " },\n"
358  " \"locality\": {\n"
359  " \"region\": \"corp\",\n"
360  " \"zone\": \"svl\",\n"
361  " \"sub_zone\": \"mp3\"\n"
362  " }\n"
363  " }";
364  return kXdsNode;
365 }
366 
368  std::vector<std::string> entries;
369  for (const auto& p : plugins_) {
370  const std::string& key = p.first;
371  const PluginInfo& plugin_info = p.second;
372  std::vector<std::string> fields;
373  fields.push_back(absl::StrFormat(" \"%s\": {", key));
374  if (!plugin_info.plugin_config.empty()) {
375  fields.push_back(
376  absl::StrFormat(" \"plugin_name\": \"%s\",", plugin_info.name));
377  fields.push_back(absl::StrCat(" \"config\": {\n",
378  plugin_info.plugin_config, "\n }"));
379  } else {
380  fields.push_back(
381  absl::StrFormat(" \"plugin_name\": \"%s\"", plugin_info.name));
382  }
383  fields.push_back(" }");
384  entries.push_back(absl::StrJoin(fields, "\n"));
385  }
386  return absl::StrCat(" \"certificate_providers\": {\n",
387  absl::StrJoin(entries, ",\n"), " \n}");
388 }
389 
391  std::vector<std::string> entries;
392  for (const auto& p : authorities_) {
393  const std::string& name = p.first;
394  const AuthorityInfo& authority_info = p.second;
395  std::vector<std::string> fields = {
396  MakeXdsServersText(authority_info.server)};
397  if (!authority_info.client_listener_resource_name_template.empty()) {
398  fields.push_back(absl::StrCat(
399  "\"client_listener_resource_name_template\": \"",
400  authority_info.client_listener_resource_name_template, "\""));
401  }
402  entries.push_back(absl::StrCat(absl::StrFormat("\"%s\": {\n ", name),
403  absl::StrJoin(fields, ",\n"), "\n}"));
404  }
405  return absl::StrCat("\"authorities\": {\n", absl::StrJoin(entries, ",\n"),
406  "\n}");
407 }
408 
409 //
410 // XdsEnd2endTest::RpcOptions
411 //
412 
414  EchoRequest* request) const {
415  for (const auto& item : metadata) {
416  context->AddMetadata(item.first, item.second);
417  }
418  if (timeout_ms != 0) {
420  }
422  request->set_message(kRequestMessage);
423  if (server_fail) {
424  request->mutable_param()->mutable_expected_error()->set_code(
426  }
427  if (server_sleep_us != 0) {
428  request->mutable_param()->set_server_sleep_us(server_sleep_us);
429  }
430  if (client_cancel_after_us != 0) {
431  request->mutable_param()->set_client_cancel_after_us(
432  client_cancel_after_us);
433  }
434  if (skip_cancelled_check) {
435  request->mutable_param()->set_skip_cancelled_check(true);
436  }
437 }
438 
439 //
440 // XdsEnd2endTest
441 //
442 
444  "xds_default_locality_region";
445 const char XdsEnd2endTest::kDefaultLocalityZone[] = "xds_default_locality_zone";
446 
447 const char XdsEnd2endTest::kServerName[] = "server.example.com";
449  "route_config_name";
450 const char XdsEnd2endTest::kDefaultClusterName[] = "cluster_name";
451 const char XdsEnd2endTest::kDefaultEdsServiceName[] = "eds_service_name";
453  "default_server_route_config_name";
454 
455 const char XdsEnd2endTest::kCaCertPath[] = "src/core/tsi/test_creds/ca.pem";
456 const char XdsEnd2endTest::kServerCertPath[] =
457  "src/core/tsi/test_creds/server1.pem";
458 const char XdsEnd2endTest::kServerKeyPath[] =
459  "src/core/tsi/test_creds/server1.key";
460 
461 const char XdsEnd2endTest::kRequestMessage[] = "Live long and prosper.";
462 
464  bool localhost_resolves_to_ipv4 = false;
465  bool localhost_resolves_to_ipv6 = false;
466  grpc_core::LocalhostResolves(&localhost_resolves_to_ipv4,
467  &localhost_resolves_to_ipv6);
468  ipv6_only_ = !localhost_resolves_to_ipv4 && localhost_resolves_to_ipv6;
469  // Initialize default xDS resources.
470  // Construct LDS resource.
471  default_listener_.set_name(kServerName);
472  HttpConnectionManager http_connection_manager;
473  if (!GetParam().use_v2()) {
474  auto* filter = http_connection_manager.add_http_filters();
475  filter->set_name("router");
476  filter->mutable_typed_config()->PackFrom(
477  envoy::extensions::filters::http::router::v3::Router());
478  }
479  default_listener_.mutable_api_listener()->mutable_api_listener()->PackFrom(
480  http_connection_manager);
481  // Construct RDS resource.
483  auto* virtual_host = default_route_config_.add_virtual_hosts();
484  virtual_host->add_domains("*");
485  auto* route = virtual_host->add_routes();
486  route->mutable_match()->set_prefix("");
487  route->mutable_route()->set_cluster(kDefaultClusterName);
488  // Construct CDS resource.
490  default_cluster_.set_type(Cluster::EDS);
491  auto* eds_config = default_cluster_.mutable_eds_cluster_config();
492  eds_config->mutable_eds_config()->mutable_self();
493  eds_config->set_service_name(kDefaultEdsServiceName);
494  default_cluster_.set_lb_policy(Cluster::ROUND_ROBIN);
495  if (GetParam().enable_load_reporting()) {
496  default_cluster_.mutable_lrs_server()->mutable_self();
497  }
498  // Initialize client-side resources on balancer.
501  balancer_->ads_service()->SetCdsResource(default_cluster_);
502  // Construct a default server-side RDS resource for tests to use.
504  virtual_host = default_server_route_config_.add_virtual_hosts();
505  virtual_host->add_domains("*");
506  route = virtual_host->add_routes();
507  route->mutable_match()->set_prefix("");
508  route->mutable_non_forwarding_action();
509  // Construct a default server-side Listener resource
510  default_server_listener_.mutable_address()
511  ->mutable_socket_address()
512  ->set_address(ipv6_only_ ? "::1" : "127.0.0.1");
513  default_server_listener_.mutable_default_filter_chain()
514  ->add_filters()
515  ->mutable_typed_config()
516  ->PackFrom(http_connection_manager);
517 }
518 
521  balancer_->Shutdown();
522  // Clear global xDS channel args, since they will go out of scope
523  // when this test object is destroyed.
525  gpr_unsetenv("GRPC_XDS_BOOTSTRAP");
526  gpr_unsetenv("GRPC_XDS_BOOTSTRAP_CONFIG");
527  if (bootstrap_file_ != nullptr) {
528  remove(bootstrap_file_);
530  }
531 }
532 
533 std::unique_ptr<XdsEnd2endTest::BalancerServerThread>
535  std::unique_ptr<BalancerServerThread> balancer =
536  absl::make_unique<BalancerServerThread>(this);
537  balancer->Start();
538  return balancer;
539 }
540 
542  return absl::StrCat("grpc/server?xds.resource.listening_address=",
543  ipv6_only_ ? "[::1]:" : "127.0.0.1:", port);
544 }
545 
547  const Listener& listener_template, int port) {
548  Listener listener = listener_template;
549  listener.set_name(GetServerListenerName(port));
550  listener.mutable_address()->mutable_socket_address()->set_port_value(port);
551  return listener;
552 }
553 
555  const Listener& listener) const {
556  HttpConnectionManager http_connection_manager;
557  listener.api_listener().api_listener().UnpackTo(&http_connection_manager);
558  return http_connection_manager;
559 }
560 
562  Listener* listener) const {
563  auto* api_listener = listener->mutable_api_listener()->mutable_api_listener();
564  api_listener->PackFrom(hcm);
565 }
566 
568  const Listener& listener) const {
569  HttpConnectionManager http_connection_manager;
570  listener.default_filter_chain().filters().at(0).typed_config().UnpackTo(
571  &http_connection_manager);
572  return http_connection_manager;
573 }
574 
576  Listener* listener) const {
577  listener->mutable_default_filter_chain()
578  ->mutable_filters()
579  ->at(0)
580  .mutable_typed_config()
581  ->PackFrom(hcm);
582 }
583 
585  BalancerServerThread* balancer, Listener listener,
586  const RouteConfiguration& route_config, const HcmAccessor& hcm_accessor) {
587  HttpConnectionManager http_connection_manager = hcm_accessor.Unpack(listener);
588  if (GetParam().enable_rds_testing()) {
589  auto* rds = http_connection_manager.mutable_rds();
590  rds->set_route_config_name(route_config.name());
591  rds->mutable_config_source()->mutable_self();
592  balancer->ads_service()->SetRdsResource(route_config);
593  } else {
594  *http_connection_manager.mutable_route_config() = route_config;
595  }
596  hcm_accessor.Pack(http_connection_manager, &listener);
597  balancer->ads_service()->SetLdsResource(listener);
598 }
599 
601  BalancerServerThread* balancer, const RouteConfiguration& route_config,
602  const Listener* listener_to_copy) {
603  if (GetParam().enable_rds_testing()) {
604  balancer->ads_service()->SetRdsResource(route_config);
605  } else {
606  Listener listener(listener_to_copy == nullptr ? default_listener_
607  : *listener_to_copy);
608  HttpConnectionManager http_connection_manager;
609  listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
610  &http_connection_manager);
611  *(http_connection_manager.mutable_route_config()) = route_config;
612  listener.mutable_api_listener()->mutable_api_listener()->PackFrom(
613  http_connection_manager);
614  balancer->ads_service()->SetLdsResource(listener);
615  }
616 }
617 
618 std::vector<XdsEnd2endTest::EdsResourceArgs::Endpoint>
620  size_t stop_index,
621  HealthStatus health_status,
622  int lb_weight) {
623  if (stop_index == 0) stop_index = backends_.size();
624  std::vector<EdsResourceArgs::Endpoint> endpoints;
625  for (size_t i = start_index; i < stop_index; ++i) {
626  endpoints.emplace_back(CreateEndpoint(i, health_status, lb_weight));
627  }
628  return endpoints;
629 }
630 
632  const EdsResourceArgs& args, const char* eds_service_name) {
633  ClusterLoadAssignment assignment;
634  assignment.set_cluster_name(eds_service_name);
635  for (const auto& locality : args.locality_list) {
636  auto* endpoints = assignment.add_endpoints();
637  endpoints->mutable_load_balancing_weight()->set_value(locality.lb_weight);
638  endpoints->set_priority(locality.priority);
639  endpoints->mutable_locality()->set_region(kDefaultLocalityRegion);
640  endpoints->mutable_locality()->set_zone(kDefaultLocalityZone);
641  endpoints->mutable_locality()->set_sub_zone(locality.sub_zone);
642  for (size_t i = 0; i < locality.endpoints.size(); ++i) {
643  const int& port = locality.endpoints[i].port;
644  auto* lb_endpoints = endpoints->add_lb_endpoints();
645  if (locality.endpoints.size() > i &&
646  locality.endpoints[i].health_status != HealthStatus::UNKNOWN) {
647  lb_endpoints->set_health_status(locality.endpoints[i].health_status);
648  }
649  if (locality.endpoints.size() > i &&
650  locality.endpoints[i].lb_weight >= 1) {
651  lb_endpoints->mutable_load_balancing_weight()->set_value(
652  locality.endpoints[i].lb_weight);
653  }
654  auto* endpoint = lb_endpoints->mutable_endpoint();
655  auto* address = endpoint->mutable_address();
656  auto* socket_address = address->mutable_socket_address();
657  socket_address->set_address(ipv6_only_ ? "::1" : "127.0.0.1");
658  socket_address->set_port_value(port);
659  }
660  }
661  if (!args.drop_categories.empty()) {
662  auto* policy = assignment.mutable_policy();
663  for (const auto& p : args.drop_categories) {
664  const std::string& name = p.first;
665  const uint32_t parts_per_million = p.second;
666  auto* drop_overload = policy->add_drop_overloads();
667  drop_overload->set_category(name);
668  auto* drop_percentage = drop_overload->mutable_drop_percentage();
669  drop_percentage->set_numerator(parts_per_million);
670  drop_percentage->set_denominator(args.drop_denominator);
671  }
672  }
673  return assignment;
674 }
675 
676 void XdsEnd2endTest::ResetBackendCounters(size_t start_index,
677  size_t stop_index) {
678  if (stop_index == 0) stop_index = backends_.size();
679  for (size_t i = start_index; i < stop_index; ++i) {
680  backends_[i]->backend_service()->ResetCounters();
681  backends_[i]->backend_service1()->ResetCounters();
682  backends_[i]->backend_service2()->ResetCounters();
683  }
684 }
685 
686 bool XdsEnd2endTest::SeenBackend(size_t backend_idx,
687  const RpcService rpc_service) {
688  switch (rpc_service) {
689  case SERVICE_ECHO:
690  if (backends_[backend_idx]->backend_service()->request_count() == 0) {
691  return false;
692  }
693  break;
694  case SERVICE_ECHO1:
695  if (backends_[backend_idx]->backend_service1()->request_count() == 0) {
696  return false;
697  }
698  break;
699  case SERVICE_ECHO2:
700  if (backends_[backend_idx]->backend_service2()->request_count() == 0) {
701  return false;
702  }
703  break;
704  }
705  return true;
706 }
707 
708 bool XdsEnd2endTest::SeenAllBackends(size_t start_index, size_t stop_index,
709  const RpcService rpc_service) {
710  if (stop_index == 0) stop_index = backends_.size();
711  for (size_t i = start_index; i < stop_index; ++i) {
712  if (!SeenBackend(i, rpc_service)) {
713  return false;
714  }
715  }
716  return true;
717 }
718 
719 std::vector<int> XdsEnd2endTest::GetBackendPorts(size_t start_index,
720  size_t stop_index) const {
721  if (stop_index == 0) stop_index = backends_.size();
722  std::vector<int> backend_ports;
723  for (size_t i = start_index; i < stop_index; ++i) {
724  backend_ports.push_back(backends_[i]->port());
725  }
726  return backend_ports;
727 }
728 
730  std::string lb_expected_authority,
731  int xds_resource_does_not_exist_timeout_ms) {
732  if (xds_resource_does_not_exist_timeout_ms > 0) {
735  xds_resource_does_not_exist_timeout_ms));
736  }
737  if (!lb_expected_authority.empty()) {
738  constexpr char authority_const[] = "localhost:%d";
739  if (lb_expected_authority == authority_const) {
740  lb_expected_authority =
741  absl::StrFormat(authority_const, balancer_->port());
742  }
744  const_cast<char*>(GRPC_ARG_FAKE_SECURITY_EXPECTED_TARGETS),
745  const_cast<char*>(lb_expected_authority.c_str())));
746  }
749  // Initialize XdsClient state.
750  builder.SetDefaultServer(absl::StrCat("localhost:", balancer_->port()));
751  if (GetParam().use_v2()) builder.SetV2();
752  bootstrap_ = builder.Build();
753  if (GetParam().bootstrap_source() == XdsTestType::kBootstrapFromEnvVar) {
754  gpr_setenv("GRPC_XDS_BOOTSTRAP_CONFIG", bootstrap_.c_str());
755  } else if (GetParam().bootstrap_source() == XdsTestType::kBootstrapFromFile) {
756  FILE* out = gpr_tmpfile("xds_bootstrap_v3", &bootstrap_file_);
757  fputs(bootstrap_.c_str(), out);
758  fclose(out);
759  gpr_setenv("GRPC_XDS_BOOTSTRAP", bootstrap_file_);
760  }
761  if (GetParam().bootstrap_source() != XdsTestType::kBootstrapFromChannelArg) {
762  // If getting bootstrap from channel arg, we'll pass these args in
763  // via the parent channel args in CreateChannel() instead.
765  // Make sure each test creates a new XdsClient instance rather than
766  // reusing the one from the previous test. This avoids spurious failures
767  // caused when a load reporting test runs after a non-load reporting test
768  // and the XdsClient is still talking to the old LRS server, which fails
769  // because it's not expecting the client to connect. It also
770  // ensures that each test can independently set the global channel
771  // args for the xDS channel.
773  }
774  // Create channel and stub.
775  ResetStub();
776 }
777 
778 void XdsEnd2endTest::ResetStub(int failover_timeout_ms,
780  channel_ = CreateChannel(failover_timeout_ms, kServerName, "", args);
781  stub_ = grpc::testing::EchoTestService::NewStub(channel_);
782  stub1_ = grpc::testing::EchoTest1Service::NewStub(channel_);
783  stub2_ = grpc::testing::EchoTest2Service::NewStub(channel_);
784 }
785 
786 std::shared_ptr<Channel> XdsEnd2endTest::CreateChannel(
787  int failover_timeout_ms, const char* server_name, const char* xds_authority,
789  ChannelArguments local_args;
790  if (args == nullptr) args = &local_args;
791  // TODO(roth): Remove this once we enable retries by default internally.
792  args->SetInt(GRPC_ARG_ENABLE_RETRIES, 1);
793  if (failover_timeout_ms > 0) {
794  args->SetInt(GRPC_ARG_PRIORITY_FAILOVER_TIMEOUT_MS, failover_timeout_ms);
795  }
796  if (GetParam().bootstrap_source() == XdsTestType::kBootstrapFromChannelArg) {
797  // We're getting the bootstrap from a channel arg, so we do the
798  // same thing for the response generator to use for the xDS
799  // channel and the xDS resource-does-not-exist timeout value.
801  bootstrap_.c_str());
802  args->SetPointerWithVtable(
804  &xds_channel_args_, &kChannelArgsArgVtable);
805  }
806  std::string uri = absl::StrCat("xds://", xds_authority, "/", server_name);
807  std::shared_ptr<ChannelCredentials> channel_creds =
808  GetParam().use_xds_credentials()
810  : std::make_shared<SecureChannelCredentials>(
812  return grpc::CreateCustomChannel(uri, channel_creds, *args);
813 }
814 
816  EchoResponse* response) {
817  EchoResponse local_response;
818  if (response == nullptr) response = &local_response;
820  EchoRequest request;
821  if (rpc_options.server_expected_error != StatusCode::OK) {
822  auto* error = request.mutable_param()->mutable_expected_error();
823  error->set_code(rpc_options.server_expected_error);
824  }
825  rpc_options.SetupRpc(&context, &request);
826  Status status;
827  switch (rpc_options.service) {
828  case SERVICE_ECHO:
829  status =
830  SendRpcMethod(stub_.get(), rpc_options, &context, request, response);
831  break;
832  case SERVICE_ECHO1:
833  status =
834  SendRpcMethod(stub1_.get(), rpc_options, &context, request, response);
835  break;
836  case SERVICE_ECHO2:
837  status =
838  SendRpcMethod(stub2_.get(), rpc_options, &context, request, response);
839  break;
840  }
841  return status;
842 }
843 
845  const grpc_core::DebugLocation& debug_location,
846  std::function<bool(const RpcResult&)> continue_predicate, int timeout_ms,
847  const RpcOptions& rpc_options) {
848  absl::Time deadline = absl::InfiniteFuture();
849  if (timeout_ms != 0) {
850  deadline = absl::Now() +
852  }
853  while (true) {
855  result.status = SendRpc(rpc_options, &result.response);
856  if (!continue_predicate(result)) return;
857  EXPECT_LE(absl::Now(), deadline)
858  << debug_location.file() << ":" << debug_location.line();
859  if (absl::Now() >= deadline) break;
860  }
861 }
862 
864  const grpc_core::DebugLocation& debug_location, const size_t times,
865  const RpcOptions& rpc_options) {
867  debug_location,
868  [debug_location, times, n = size_t(0)](const RpcResult& result) mutable {
869  EXPECT_TRUE(result.status.ok())
870  << "code=" << result.status.error_code()
871  << " message=" << result.status.error_message() << " at "
872  << debug_location.file() << ":" << debug_location.line();
873  EXPECT_EQ(result.response.message(), kRequestMessage);
874  return ++n < times;
875  },
876  /*timeout_ms=*/0, rpc_options);
877 }
878 
880  const grpc_core::DebugLocation& debug_location, StatusCode expected_status,
881  absl::string_view expected_message_regex, const RpcOptions& rpc_options) {
882  const Status status = SendRpc(rpc_options);
883  EXPECT_FALSE(status.ok())
884  << debug_location.file() << ":" << debug_location.line();
885  EXPECT_EQ(expected_status, status.error_code())
886  << debug_location.file() << ":" << debug_location.line();
887  EXPECT_THAT(status.error_message(),
888  ::testing::MatchesRegex(expected_message_regex))
889  << debug_location.file() << ":" << debug_location.line();
890 }
891 
893  const grpc_core::DebugLocation& debug_location, size_t num_rpcs,
894  StatusCode expected_status, absl::string_view expected_message_prefix,
895  const RpcOptions& rpc_options) {
896  size_t num_failed = 0;
898  debug_location,
899  [&, n = size_t(0)](const RpcResult& result) mutable {
900  if (!result.status.ok()) {
901  EXPECT_EQ(result.status.error_code(), expected_status)
902  << debug_location.file() << ":" << debug_location.line();
903  EXPECT_THAT(result.status.error_message(),
904  ::testing::StartsWith(expected_message_prefix))
905  << debug_location.file() << ":" << debug_location.line();
906  ++num_failed;
907  }
908  return ++n < num_rpcs;
909  },
910  /*timeout_ms=*/0, rpc_options);
911  return num_failed;
912 }
913 
915  grpc::testing::EchoTestService::Stub* stub, const RpcOptions& rpc_options) {
916  sender_thread_ = std::thread([this, stub, rpc_options]() {
917  EchoRequest request;
918  EchoResponse response;
919  rpc_options.SetupRpc(&context_, &request);
920  status_ = stub->Echo(&context_, request, &response);
921  });
922 }
923 
925  context_.TryCancel();
926  if (sender_thread_.joinable()) sender_thread_.join();
927 }
928 
930  if (sender_thread_.joinable()) sender_thread_.join();
931  return status_;
932 }
933 
934 std::vector<XdsEnd2endTest::ConcurrentRpc> XdsEnd2endTest::SendConcurrentRpcs(
935  const grpc_core::DebugLocation& debug_location,
936  grpc::testing::EchoTestService::Stub* stub, size_t num_rpcs,
937  const RpcOptions& rpc_options) {
938  // Variables for RPCs.
939  std::vector<ConcurrentRpc> rpcs(num_rpcs);
940  EchoRequest request;
941  // Variables for synchronization
944  size_t completed = 0;
945  // Set-off callback RPCs
946  for (size_t i = 0; i < num_rpcs; i++) {
947  ConcurrentRpc* rpc = &rpcs[i];
948  rpc_options.SetupRpc(&rpc->context, &request);
950  stub->async()->Echo(&rpc->context, &request, &rpc->response,
951  [rpc, &mu, &completed, &cv, num_rpcs, t0](Status s) {
952  rpc->status = s;
953  rpc->elapsed_time = NowFromCycleCounter() - t0;
954  bool done;
955  {
956  grpc_core::MutexLock lock(&mu);
957  done = (++completed) == num_rpcs;
958  }
959  if (done) cv.Signal();
960  });
961  }
962  {
963  grpc_core::MutexLock lock(&mu);
964  cv.Wait(&mu);
965  }
966  EXPECT_EQ(completed, num_rpcs)
967  << " at " << debug_location.file() << ":" << debug_location.line();
968  return rpcs;
969 }
970 
972  const grpc_core::DebugLocation& debug_location, size_t start_index,
973  size_t stop_index, std::function<void(const RpcResult&)> check_status,
974  const WaitForBackendOptions& wait_options, const RpcOptions& rpc_options) {
975  if (check_status == nullptr) {
976  check_status = [&](const RpcResult& result) {
977  EXPECT_TRUE(result.status.ok())
978  << "code=" << result.status.error_code()
979  << " message=" << result.status.error_message() << " at "
980  << debug_location.file() << ":" << debug_location.line();
981  };
982  }
984  "========= WAITING FOR BACKENDS [%" PRIuPTR ", %" PRIuPTR
985  ") ==========",
986  start_index, stop_index);
987  size_t num_rpcs = 0;
989  debug_location,
990  [&](const RpcResult& result) {
991  ++num_rpcs;
992  check_status(result);
993  return !SeenAllBackends(start_index, stop_index, rpc_options.service);
994  },
995  wait_options.timeout_ms, rpc_options);
996  if (wait_options.reset_counters) ResetBackendCounters();
997  gpr_log(GPR_INFO, "Backends up; sent %" PRIuPTR " warm up requests",
998  num_rpcs);
999  return num_rpcs;
1000 }
1001 
1003  const grpc_core::DebugLocation& debug_location,
1005  StatusCode expected_status) {
1007  auto deadline = absl::Now() + absl::Seconds(30);
1008  auto continue_predicate = [&]() {
1009  if (absl::Now() >= deadline) {
1010  return false;
1011  }
1012  response_state = get_state();
1013  return !response_state.has_value() ||
1014  response_state->state != AdsServiceImpl::ResponseState::NACKED;
1015  };
1016  do {
1017  const Status status = SendRpc();
1018  EXPECT_EQ(expected_status, status.error_code())
1019  << "code=" << status.error_code()
1020  << " message=" << status.error_message() << " at "
1021  << debug_location.file() << ":" << debug_location.line();
1022  } while (continue_predicate());
1023  return response_state;
1024 }
1025 
1026 std::string XdsEnd2endTest::ReadFile(const char* file_path) {
1027  grpc_slice slice;
1028  GPR_ASSERT(
1029  GRPC_LOG_IF_ERROR("load_file", grpc_load_file(file_path, 0, &slice)));
1032  return file_contents;
1033 }
1034 
1036  const char* key_path, const char* cert_path) {
1038  grpc_core::PemKeyCertPair(ReadFile(key_path), ReadFile(cert_path))};
1039 }
1040 
1041 std::shared_ptr<ChannelCredentials>
1043  IdentityKeyCertPair key_cert_pair;
1044  key_cert_pair.private_key = ReadFile(kServerKeyPath);
1045  key_cert_pair.certificate_chain = ReadFile(kServerCertPath);
1046  std::vector<IdentityKeyCertPair> identity_key_cert_pairs;
1047  identity_key_cert_pairs.emplace_back(key_cert_pair);
1048  auto certificate_provider = std::make_shared<StaticDataCertificateProvider>(
1051  options.set_certificate_provider(std::move(certificate_provider));
1052  options.watch_root_certs();
1053  options.watch_identity_key_cert_pairs();
1054  auto verifier =
1055  ExternalCertificateVerifier::Create<SyncCertificateVerifier>(true);
1056  options.set_certificate_verifier(std::move(verifier));
1057  options.set_verify_server_certs(true);
1058  options.set_check_call_host(false);
1059  auto channel_creds = grpc::experimental::TlsCredentials(options);
1060  GPR_ASSERT(channel_creds.get() != nullptr);
1061  return channel_creds;
1062 }
1063 
1064 } // namespace testing
1065 } // namespace grpc
grpc::EXPECT_THAT
EXPECT_THAT(status.error_message(), ::testing::HasSubstr("subject_token_type"))
EXPECT_FALSE
#define EXPECT_FALSE(condition)
Definition: bloaty/third_party/googletest/googletest/include/gtest/gtest.h:1970
grpc::testing::XdsEnd2endTest::TearDown
void TearDown() override
Definition: xds_end2end_test_lib.cc:519
GRPC_ARG_TEST_ONLY_DO_NOT_USE_IN_PROD_XDS_BOOTSTRAP_CONFIG
#define GRPC_ARG_TEST_ONLY_DO_NOT_USE_IN_PROD_XDS_BOOTSTRAP_CONFIG
Definition: grpc_types.h:365
grpc::testing::XdsEnd2endTest::BootstrapBuilder::PluginInfo
Definition: xds_end2end_test_lib.h:442
grpc::testing::XdsEnd2endTest::ServerThread::port
int port() const
Definition: xds_end2end_test_lib.h:250
grpc_slice_unref
GPRAPI void grpc_slice_unref(grpc_slice s)
Definition: slice_api.cc:32
grpc::gpr_setenv
gpr_setenv("STS_CREDENTIALS", creds_file_name)
grpc::testing::XdsEnd2endTest::kServerName
static const char kServerName[]
Definition: xds_end2end_test_lib.h:200
_gevent_test_main.result
result
Definition: _gevent_test_main.py:96
GPR_INFO
#define GPR_INFO
Definition: include/grpc/impl/codegen/log.h:56
grpc::testing::XdsEnd2endTest::ShutdownAllBackends
void ShutdownAllBackends()
Definition: xds_end2end_test_lib.h:666
testing
Definition: aws_request_signer_test.cc:25
cond_
grpc::internal::CondVar cond_
Definition: client_lb_end2end_test.cc:373
grpc::testing::XdsEnd2endTest::BalancerServerThread::StartAllServices
void StartAllServices() override
Definition: xds_end2end_test_lib.cc:292
grpc::testing::XdsEnd2endTest::SetServerListenerNameAndRouteConfiguration
void SetServerListenerNameAndRouteConfiguration(BalancerServerThread *balancer, Listener listener, int port, const RouteConfiguration &route_config)
Definition: xds_end2end_test_lib.h:550
grpc::status
auto status
Definition: cpp/client/credentials_test.cc:200
grpc::testing::XdsEnd2endTest::BootstrapBuilder::AuthorityInfo
Definition: xds_end2end_test_lib.h:446
grpc::testing::XdsEnd2endTest::HcmAccessor::Pack
virtual void Pack(const HttpConnectionManager &hcm, Listener *listener) const =0
gen_build_yaml.out
dictionary out
Definition: src/benchmark/gen_build_yaml.py:24
grpc::testing::XdsTestType::kBootstrapFromEnvVar
@ kBootstrapFromEnvVar
Definition: xds_end2end_test_lib.h:64
grpc::testing::XdsEnd2endTest::BackendServerThread::RegisterAllServices
void RegisterAllServices(ServerBuilder *builder) override
Definition: xds_end2end_test_lib.cc:252
grpc_core::LocalhostResolves
void LocalhostResolves(bool *ipv4, bool *ipv6)
Definition: resolve_localhost_ip46.cc:50
grpc_core::CondVar
Definition: src/core/lib/gprpp/sync.h:126
grpc::testing::XdsEnd2endTest::SendRpcMethod
static Status SendRpcMethod(Stub *stub, const RpcOptions &rpc_options, ClientContext *context, EchoRequest &request, EchoResponse *response)
Definition: xds_end2end_test_lib.h:795
regen-readme.it
it
Definition: regen-readme.py:15
grpc::testing::XdsEnd2endTest::kDefaultServerRouteConfigurationName
static const char kDefaultServerRouteConfigurationName[]
Definition: xds_end2end_test_lib.h:204
grpc_core::DebugLocation
Definition: debug_location.h:31
grpc_load_file
grpc_error_handle grpc_load_file(const char *filename, int add_null_terminator, grpc_slice *output)
Definition: load_file.cc:33
resolve_localhost_ip46.h
grpc::testing::XdsEnd2endTest::BuildEdsResource
ClusterLoadAssignment BuildEdsResource(const EdsResourceArgs &args, const char *eds_service_name=kDefaultEdsServiceName)
Definition: xds_end2end_test_lib.cc:631
absl::StrCat
std::string StrCat(const AlphaNum &a, const AlphaNum &b)
Definition: abseil-cpp/absl/strings/str_cat.cc:98
grpc::testing::XdsEnd2endTest::WaitForBackendOptions::reset_counters
bool reset_counters
Definition: xds_end2end_test_lib.h:882
metadata
Definition: cq_verifier.cc:48
grpc::gpr_free
gpr_free(creds_file_name)
absl::InlinedVector::emplace_back
reference emplace_back(Args &&... args)
Definition: abseil-cpp/absl/container/inlined_vector.h:675
grpc::testing::XdsEnd2endTest::ServerThread::notifier_
XdsServingStatusNotifier notifier_
Definition: xds_end2end_test_lib.h:275
load_file.h
absl::StrFormat
ABSL_MUST_USE_RESULT std::string StrFormat(const FormatSpec< Args... > &format, const Args &... args)
Definition: abseil-cpp/absl/strings/str_format.h:338
absl::Time
Definition: third_party/abseil-cpp/absl/time/time.h:642
grpc
Definition: grpcpp/alarm.h:33
grpc::testing::XdsEnd2endTest::ServerHcmAccessor::Pack
void Pack(const HttpConnectionManager &hcm, Listener *listener) const override
Definition: xds_end2end_test_lib.cc:575
route
XdsRouteConfigResource::Route route
Definition: xds_resolver.cc:337
grpc::testing::XdsEnd2endTest::WaitForBackendOptions
Definition: xds_end2end_test_lib.h:880
grpc::testing::XdsTestType::kBootstrapFromChannelArg
@ kBootstrapFromChannelArg
Definition: xds_end2end_test_lib.h:62
false
#define false
Definition: setup_once.h:323
grpc::testing::XdsEnd2endTest::ServerThread::XdsServingStatusNotifier::cond_
grpc_core::CondVar cond_
Definition: xds_end2end_test_lib.h:229
Listener
::grpc_event_engine::experimental::EventEngine::Listener Listener
Definition: event_engine_test_utils.cc:42
grpc::testing::XdsEnd2endTest::BalancerServerThread::BalancerServerThread
BalancerServerThread(XdsEnd2endTest *test_obj)
Definition: xds_end2end_test_lib.cc:275
grpc::testing::XdsEnd2endTest::stub2_
std::unique_ptr< grpc::testing::EchoTest2Service::Stub > stub2_
Definition: xds_end2end_test_lib.h:1050
grpc::testing::XdsEnd2endTest::SendRpc
Status SendRpc(const RpcOptions &rpc_options=RpcOptions(), EchoResponse *response=nullptr)
Definition: xds_end2end_test_lib.cc:815
grpc::testing::XdsEnd2endTest::ServerThread::XdsServingStatusNotifier::WaitOnServingStatusChange
void WaitOnServingStatusChange(std::string uri, grpc::StatusCode expected_status)
Definition: xds_end2end_test_lib.cc:76
grpc_core::MutexLock
Definition: src/core/lib/gprpp/sync.h:88
grpc::testing::LrsServiceImpl
Definition: xds_server.h:699
grpc::testing::XdsEnd2endTest::ServerThread::use_xds_enabled_server
bool use_xds_enabled_server() const
Definition: xds_end2end_test_lib.h:252
grpc::ClientContext::set_wait_for_ready
void set_wait_for_ready(bool wait_for_ready)
Definition: grpcpp/impl/codegen/client_context.h:285
grpc::testing::XdsEnd2endTest::SERVICE_ECHO1
@ SERVICE_ECHO1
Definition: xds_end2end_test_lib.h:481
grpc::testing::XdsEnd2endTest::ConcurrentRpc
Definition: xds_end2end_test_lib.h:865
options
double_dict options[]
Definition: capstone_test.c:55
grpc::testing::XdsEnd2endTest::SendRpcsAndCountFailuresWithMessage
size_t SendRpcsAndCountFailuresWithMessage(const grpc_core::DebugLocation &debug_location, size_t num_rpcs, StatusCode expected_status, absl::string_view expected_message_prefix, const RpcOptions &rpc_options=RpcOptions())
Definition: xds_end2end_test_lib.cc:892
Listener
Definition: transport_common.h:31
grpc::testing::XdsEnd2endTest::EdsResourceArgs
Definition: xds_end2end_test_lib.h:567
benchmark.request
request
Definition: benchmark.py:77
grpc::testing::XdsEnd2endTest::ServerThread::Credentials
virtual std::shared_ptr< ServerCredentials > Credentials()
Definition: xds_end2end_test_lib.h:245
absl::string_view
Definition: abseil-cpp/absl/strings/string_view.h:167
grpc_core::Timestamp
Definition: src/core/lib/gprpp/time.h:62
grpc_core::StringViewFromSlice
absl::string_view StringViewFromSlice(const grpc_slice &slice)
Definition: slice_internal.h:93
grpc::testing::XdsEnd2endTest::BootstrapBuilder::PluginInfo::name
std::string name
Definition: xds_end2end_test_lib.h:443
grpc::testing::XdsEnd2endTest::stub1_
std::unique_ptr< grpc::testing::EchoTest1Service::Stub > stub1_
Definition: xds_end2end_test_lib.h:1049
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
error
grpc_error_handle error
Definition: retry_filter.cc:499
grpc::testing::XdsEnd2endTest::ServerThread::XdsServingStatusNotifier::OnServingStatusUpdate
void OnServingStatusUpdate(std::string uri, ServingStatusUpdate update) override
Definition: xds_end2end_test_lib.cc:69
grpc::testing::XdsEnd2endTest::CheckRpcSendOk
void CheckRpcSendOk(const grpc_core::DebugLocation &debug_location, const size_t times=1, const RpcOptions &rpc_options=RpcOptions())
Definition: xds_end2end_test_lib.cc:863
secure_credentials.h
grpc::testing::XdsEnd2endTest::kDefaultLocalityZone
static const char kDefaultLocalityZone[]
Definition: xds_end2end_test_lib.h:195
grpc::ClientContext::set_deadline
void set_deadline(const T &deadline)
Definition: grpcpp/impl/codegen/client_context.h:274
GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY
@ GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY
Definition: grpc_security_constants.h:105
gpr_tmpfile
FILE * gpr_tmpfile(const char *prefix, char **tmp_filename)
grpc::testing::XdsEnd2endTest::default_listener_
Listener default_listener_
Definition: xds_end2end_test_lib.h:1055
setup.name
name
Definition: setup.py:542
env.h
grpc::testing::XdsEnd2endTest::GetBackendPorts
std::vector< int > GetBackendPorts(size_t start_index=0, size_t stop_index=0) const
Definition: xds_end2end_test_lib.cc:719
grpc::testing::XdsEnd2endTest::WaitForBackendOptions::timeout_ms
int timeout_ms
Definition: xds_end2end_test_lib.h:884
grpc::testing::XdsEnd2endTest::LongRunningRpc::StartRpc
void StartRpc(grpc::testing::EchoTestService::Stub *stub, const RpcOptions &rpc_options=RpcOptions().set_timeout_ms(0).set_client_cancel_after_us(1 *1000 *1000))
Definition: xds_end2end_test_lib.cc:914
grpc::testing::XdsEnd2endTest::ServerThread::XdsChannelArgsServerBuilderOption::test_obj_
XdsEnd2endTest * test_obj_
Definition: xds_end2end_test_lib.cc:131
GRPC_LOG_IF_ERROR
#define GRPC_LOG_IF_ERROR(what, error)
Definition: error.h:398
grpc::XdsServerCredentials
std::shared_ptr< ServerCredentials > XdsServerCredentials(const std::shared_ptr< ServerCredentials > &fallback_credentials)
Builds Xds ServerCredentials given fallback credentials.
Definition: xds_server_credentials.cc:30
grpc_channel_arg_string_create
grpc_arg grpc_channel_arg_string_create(char *name, char *value)
Definition: channel_args.cc:476
a
int a
Definition: abseil-cpp/absl/container/internal/hash_policy_traits_test.cc:88
grpc::testing::XdsEnd2endTest::RouteConfiguration
::envoy::config::route::v3::RouteConfiguration RouteConfiguration
Definition: xds_end2end_test_lib.h:189
run_xds_tests.server_uri
string server_uri
Definition: run_xds_tests.py:3320
EXPECT_LE
#define EXPECT_LE(val1, val2)
Definition: bloaty/third_party/googletest/googletest/include/gtest/gtest.h:2030
grpc::experimental::TlsServerCredentialsOptions
Definition: tls_credentials_options.h:136
grpc::testing::XdsEnd2endTest::ServerThread
Definition: xds_end2end_test_lib.h:215
async_greeter_client.stub
stub
Definition: hellostreamingworld/async_greeter_client.py:26
env.new
def new
Definition: env.py:51
grpc_core::DebugLocation::file
const char * file() const
Definition: debug_location.h:34
grpc::testing::XdsEnd2endTest::HcmAccessor::Unpack
virtual HttpConnectionManager Unpack(const Listener &listener) const =0
grpc::testing::XdsEnd2endTest::ServerThread::XdsChannelArgsServerBuilderOption::XdsChannelArgsServerBuilderOption
XdsChannelArgsServerBuilderOption(XdsEnd2endTest *test_obj)
Definition: xds_end2end_test_lib.cc:115
tls_test_utils.h
iterator
const typedef MCPhysReg * iterator
Definition: MCRegisterInfo.h:27
grpc::testing::XdsEnd2endTest::ServerThread::use_xds_enabled_server_
const bool use_xds_enabled_server_
Definition: xds_end2end_test_lib.h:278
grpc::testing::XdsEnd2endTest::InitClient
void InitClient(BootstrapBuilder builder=BootstrapBuilder(), std::string lb_expected_authority="", int xds_resource_does_not_exist_timeout_ms=0)
Definition: xds_end2end_test_lib.cc:729
grpc::testing::XdsEnd2endTest::ReadFile
static std::string ReadFile(const char *file_path)
Definition: xds_end2end_test_lib.cc:1026
verifier
static void verifier(grpc_server *server, grpc_completion_queue *cq, void *)
Definition: badreq.cc:31
grpc::testing::XdsEnd2endTest::ServerHcmAccessor::Unpack
HttpConnectionManager Unpack(const Listener &listener) const override
Definition: xds_end2end_test_lib.cc:567
grpc::ClientContext::AddMetadata
void AddMetadata(const std::string &meta_key, const std::string &meta_value)
Definition: client_context.cc:121
grpc_arg_pointer_vtable
Definition: grpc_types.h:85
grpc_channel_args
Definition: grpc_types.h:132
grpc::testing::XdsEnd2endTest::RpcResult
Definition: xds_end2end_test_lib.h:811
server_address
std::string server_address("0.0.0.0:10000")
grpc::testing::AdsServiceImpl::ResponseState::NACKED
@ NACKED
Definition: xds_server.h:74
testing::MatchesRegex
PolymorphicMatcher< internal::MatchesRegexMatcher > MatchesRegex(const internal::RE *regex)
Definition: cares/cares/test/gmock-1.8.0/gmock/gmock.h:8824
mu_
Mutex mu_
Definition: oob_backend_metric.cc:115
grpc::testing::XdsEnd2endTest::HcmAccessor
Definition: xds_end2end_test_lib.h:516
grpc::XdsServerBuilder
Definition: xds_server_builder.h:47
grpc::testing::XdsEnd2endTest::ServerThread::XdsServingStatusNotifier::mu_
grpc_core::Mutex mu_
Definition: xds_end2end_test_lib.h:228
grpc::testing::XdsEnd2endTest::RpcOptions::server_expected_error
StatusCode server_expected_error
Definition: xds_end2end_test_lib.h:728
uint32_t
unsigned int uint32_t
Definition: stdint-msvc2008.h:80
grpc::testing::XdsEnd2endTest::ConcurrentRpc::response
EchoResponse response
Definition: xds_end2end_test_lib.h:869
grpc::testing::XdsEnd2endTest::BalancerServerThread::ShutdownAllServices
void ShutdownAllServices() override
Definition: xds_end2end_test_lib.cc:297
GRPC_ARG_ENABLE_RETRIES
#define GRPC_ARG_ENABLE_RETRIES
Definition: grpc_types.h:396
grpc::testing::XdsEnd2endTest::BackendServerThread::BackendServerThread
BackendServerThread(XdsEnd2endTest *test_obj, bool use_xds_enabled_server)
Definition: xds_end2end_test_lib.cc:214
absl::Milliseconds
constexpr Duration Milliseconds(T n)
Definition: third_party/abseil-cpp/absl/time/time.h:415
grpc::testing::XdsEnd2endTest::RpcService
RpcService
Definition: xds_end2end_test_lib.h:479
profile_analyzer.builder
builder
Definition: profile_analyzer.py:159
grpc::testing::XdsEnd2endTest::ResetStub
void ResetStub(int failover_timeout_ms=0, ChannelArguments *args=nullptr)
Definition: xds_end2end_test_lib.cc:778
asyncio_get_stats.args
args
Definition: asyncio_get_stats.py:40
grpc::testing::XdsEnd2endTest::ServerThread::XdsChannelArgsServerBuilderOption::UpdatePlugins
void UpdatePlugins(std::vector< std::unique_ptr< grpc::ServerBuilderPlugin >> *) override
Alter the ServerBuilderPlugin map that will be added into ServerBuilder.
Definition: xds_end2end_test_lib.cc:126
grpc::testing::XdsEnd2endTest::default_cluster_
Cluster default_cluster_
Definition: xds_end2end_test_lib.h:1059
xds_channel_args.h
absl::move
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
Definition: abseil-cpp/absl/utility/utility.h:221
GPR_ASSERT
#define GPR_ASSERT(x)
Definition: include/grpc/impl/codegen/log.h:94
grpc.StatusCode.OK
tuple OK
Definition: src/python/grpcio/grpc/__init__.py:260
absl::StrJoin
std::string StrJoin(Iterator start, Iterator end, absl::string_view sep, Formatter &&fmt)
Definition: abseil-cpp/absl/strings/str_join.h:239
absl::optional::has_value
constexpr bool has_value() const noexcept
Definition: abseil-cpp/absl/types/optional.h:461
context_
ScopedContext * context_
Definition: filter_fuzzer.cc:559
grpc_core::DebugLocation::line
int line() const
Definition: debug_location.h:35
t0
static int64_t t0
Definition: bloaty/third_party/re2/util/benchmark.cc:44
grpc.StatusCode
Definition: src/python/grpcio/grpc/__init__.py:232
grpc::testing::XdsEnd2endTest::LongRunningRpc::GetStatus
Status GetStatus()
Definition: xds_end2end_test_lib.cc:929
grpc::internal::CondVar::Wait
void Wait(Mutex *mu)
Definition: include/grpcpp/impl/codegen/sync.h:135
grpc::ServerBuilder
A builder class for the creation and startup of grpc::Server instances.
Definition: grpcpp/server_builder.h:86
grpc::testing::XdsEnd2endTest::ServerThread::Type
virtual const char * Type()=0
grpc_channel_args_compare
int grpc_channel_args_compare(const grpc_channel_args *a, const grpc_channel_args *b)
Definition: channel_args.cc:380
grpc_timeout_milliseconds_to_deadline
gpr_timespec grpc_timeout_milliseconds_to_deadline(int64_t time_ms)
Definition: test/core/util/test_config.cc:89
slice
grpc_slice slice
Definition: src/core/lib/surface/server.cc:467
xds_client.h
gpr_log
GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, const char *format,...) GPR_PRINT_FORMAT_CHECK(4
grpc::experimental::TlsServerCredentials
std::shared_ptr< ServerCredentials > TlsServerCredentials(const experimental::TlsServerCredentialsOptions &options)
Builds TLS ServerCredentials given TLS options.
Definition: secure_server_credentials.cc:153
grpc::testing::XdsEnd2endTest::PopulateServerListenerNameAndPort
Listener PopulateServerListenerNameAndPort(const Listener &listener_template, int port)
Definition: xds_end2end_test_lib.cc:546
grpc::testing::XdsEnd2endTest
Definition: xds_end2end_test_lib.h:183
grpc_core::CondVar::Signal
void Signal()
Definition: src/core/lib/gprpp/sync.h:134
grpc::testing::XdsEnd2endTest::CreateAndStartBalancer
std::unique_ptr< BalancerServerThread > CreateAndStartBalancer()
Definition: xds_end2end_test_lib.cc:534
cond
static uv_cond_t cond
Definition: threadpool.c:33
grpc_fake_transport_security_credentials_create
grpc_channel_credentials * grpc_fake_transport_security_credentials_create()
Definition: fake_credentials.cc:79
grpc::testing::XdsEnd2endTest::ServerThread::Start
void Start()
Definition: xds_end2end_test_lib.cc:138
tmpfile.h
absl::optional
Definition: abseil-cpp/absl/types/internal/optional.h:61
grpc::testing::XdsEnd2endTest::LongRunningRpc::CancelRpc
void CancelRpc()
Definition: xds_end2end_test_lib.cc:924
grpc::testing::XdsEnd2endTest::ClusterLoadAssignment
::envoy::config::endpoint::v3::ClusterLoadAssignment ClusterLoadAssignment
Definition: xds_end2end_test_lib.h:187
grpc::testing::XdsEnd2endTest::channel_
std::shared_ptr< Channel > channel_
Definition: xds_end2end_test_lib.h:1047
done
struct tab * done
Definition: bloaty/third_party/zlib/examples/enough.c:176
grpc_test_slowdown_factor
int64_t grpc_test_slowdown_factor()
Definition: test/core/util/test_config.cc:76
grpc_channel_args_destroy
void grpc_channel_args_destroy(grpc_channel_args *a)
Definition: channel_args.cc:360
grpc_channel_args::num_args
size_t num_args
Definition: grpc_types.h:133
grpc::gpr_unsetenv
gpr_unsetenv("STS_CREDENTIALS")
grpc::testing::XdsEnd2endTest::ServerThread::Serve
void Serve(grpc_core::Mutex *mu, grpc_core::CondVar *cond)
Definition: xds_end2end_test_lib.cc:175
xds_end2end_test_lib.h
grpc_slice
Definition: include/grpc/impl/codegen/slice.h:65
grpc_channel_args_copy
grpc_channel_args * grpc_channel_args_copy(const grpc_channel_args *src)
Definition: channel_args.cc:285
grpc::testing::XdsEnd2endTest::SERVICE_ECHO2
@ SERVICE_ECHO2
Definition: xds_end2end_test_lib.h:482
grpc::testing::XdsEnd2endTest::BootstrapBuilder::MakeAuthorityText
std::string MakeAuthorityText()
Definition: xds_end2end_test_lib.cc:390
grpc::testing::XdsEnd2endTest::kDefaultRouteConfigurationName
static const char kDefaultRouteConfigurationName[]
Definition: xds_end2end_test_lib.h:201
absl::InlinedVector::data
pointer data() noexcept
Definition: abseil-cpp/absl/container/inlined_vector.h:302
grpc::testing::AdsServiceImpl
Definition: xds_server.h:68
status_
absl::Status status_
Definition: outlier_detection.cc:404
GRPC_ARG_TEST_ONLY_DO_NOT_USE_IN_PROD_XDS_CLIENT_CHANNEL_ARGS
#define GRPC_ARG_TEST_ONLY_DO_NOT_USE_IN_PROD_XDS_CLIENT_CHANNEL_ARGS
Definition: xds/xds_channel_args.h:23
grpc::testing::XdsEnd2endTest::BalancerServerThread::RegisterAllServices
void RegisterAllServices(ServerBuilder *builder) override
Definition: xds_end2end_test_lib.cc:284
grpc::testing::XdsEnd2endTest::CreateChannel
std::shared_ptr< Channel > CreateChannel(int failover_timeout_ms=0, const char *server_name=kServerName, const char *xds_authority="", ChannelArguments *args=nullptr)
Definition: xds_end2end_test_lib.cc:786
grpc::testing::XdsEnd2endTest::kCaCertPath
static const char kCaCertPath[]
Definition: xds_end2end_test_lib.h:207
grpc_core::PemKeyCertPair
Definition: ssl_utils.h:145
absl::InlinedVector::size
size_type size() const noexcept
Definition: abseil-cpp/absl/container/inlined_vector.h:270
grpc::ServerBuilderOption
Interface to pass an option to a ServerBuilder.
Definition: grpcpp/impl/server_builder_option.h:31
b
uint64_t b
Definition: abseil-cpp/absl/container/internal/layout_test.cc:53
grpc_core::internal::UnsetGlobalXdsClientForTest
void UnsetGlobalXdsClientForTest()
Definition: xds_client.cc:2518
grpc::testing::XdsEnd2endTest::BootstrapBuilder::MakeXdsServersText
std::string MakeXdsServersText(absl::string_view server_uri)
Definition: xds_end2end_test_lib.cc:325
tls_certificate_provider.h
grpc_core::ExecCtx
Definition: exec_ctx.h:97
n
int n
Definition: abseil-cpp/absl/container/btree_test.cc:1080
grpc::experimental::TlsChannelCredentialsOptions
Definition: tls_credentials_options.h:125
grpc::testing::XdsEnd2endTest::ResetBackendCounters
void ResetBackendCounters(size_t start_index=0, size_t stop_index=0)
Definition: xds_end2end_test_lib.cc:676
grpc::testing::XdsEnd2endTest::ConcurrentRpc::context
ClientContext context
Definition: xds_end2end_test_lib.h:866
grpc::testing::XdsEnd2endTest::SeenBackend
bool SeenBackend(size_t backend_idx, const RpcService rpc_service=SERVICE_ECHO)
Definition: xds_end2end_test_lib.cc:686
grpc::testing::XdsEnd2endTest::BalancerServerThread::ads_service
AdsServiceImpl * ads_service()
Definition: xds_end2end_test_lib.h:384
grpc::testing::XdsEnd2endTest::SERVICE_ECHO
@ SERVICE_ECHO
Definition: xds_end2end_test_lib.h:480
grpc::testing::XdsEnd2endTest::backends_
std::vector< std::unique_ptr< BackendServerThread > > backends_
Definition: xds_end2end_test_lib.h:1052
grpc::ClientContext
Definition: grpcpp/impl/codegen/client_context.h:195
tests.unit._exit_scenarios.port
port
Definition: _exit_scenarios.py:179
grpc::testing::XdsEnd2endTest::ServerThread::allow_put_requests_
bool allow_put_requests_
Definition: xds_end2end_test_lib.h:279
grpc::testing::XdsEnd2endTest::HttpConnectionManager
::envoy::extensions::filters::network::http_connection_manager::v3::HttpConnectionManager HttpConnectionManager
Definition: xds_end2end_test_lib.h:191
grpc::testing::XdsEnd2endTest::bootstrap_file_
char * bootstrap_file_
Definition: xds_end2end_test_lib.h:1065
grpc::testing::XdsEnd2endTest::ServerThread::RegisterAllServices
virtual void RegisterAllServices(ServerBuilder *builder)=0
absl::Seconds
constexpr Duration Seconds(T n)
Definition: third_party/abseil-cpp/absl/time/time.h:419
grpc::testing::XdsEnd2endTest::BootstrapBuilder::AuthorityInfo::client_listener_resource_name_template
std::string client_listener_resource_name_template
Definition: xds_end2end_test_lib.h:448
identity_key_cert_pairs
grpc_core::PemKeyCertPairList identity_key_cert_pairs
Definition: xds_end2end_test.cc:143
grpc::testing::XdsTestType::kBootstrapFromFile
@ kBootstrapFromFile
Definition: xds_end2end_test_lib.h:63
wait_for_ready
bool wait_for_ready
Definition: rls_end2end_test.cc:240
absl::Now
ABSL_NAMESPACE_BEGIN Time Now()
Definition: abseil-cpp/absl/time/clock.cc:39
grpc::testing::XdsEnd2endTest::kServerCertPath
static const char kServerCertPath[]
Definition: xds_end2end_test_lib.h:208
grpc::ChannelArguments
Definition: grpcpp/support/channel_arguments.h:39
grpc_core::Mutex
Definition: src/core/lib/gprpp/sync.h:61
grpc::testing::XdsEnd2endTest::ServerThread::Shutdown
void Shutdown()
Definition: xds_end2end_test_lib.cc:154
grpc::testing::XdsEnd2endTest::CreateEndpointsForBackends
std::vector< EdsResourceArgs::Endpoint > CreateEndpointsForBackends(size_t start_index=0, size_t stop_index=0, ::envoy::config::endpoint::v3::HealthStatus health_status=::envoy::config::endpoint::v3::HealthStatus::UNKNOWN, int lb_weight=1)
Definition: xds_end2end_test_lib.cc:619
grpc::experimental::TlsCredentials
std::shared_ptr< ChannelCredentials > TlsCredentials(const TlsChannelCredentialsOptions &options)
Builds TLS Credentials given TLS options.
Definition: secure_credentials.cc:316
key
const char * key
Definition: hpack_parser_table.cc:164
grpc::testing::XdsEnd2endTest::ServerThread::port_
const int port_
Definition: xds_end2end_test_lib.h:273
benchmark.FILE
FILE
Definition: benchmark.py:21
grpc::testing::cv
static gpr_cv cv
Definition: bm_cq.cc:163
grpc_channel_arg_integer_create
grpc_arg grpc_channel_arg_integer_create(char *name, int value)
Definition: channel_args.cc:484
eds_service_name
std::string eds_service_name
Definition: xds_cluster_resolver.cc:99
grpc::testing::XdsEnd2endTest::ServerThread::server_
std::unique_ptr< Server > server_
Definition: xds_end2end_test_lib.h:274
grpc::testing::XdsEnd2endTest::SendConcurrentRpcs
std::vector< ConcurrentRpc > SendConcurrentRpcs(const grpc_core::DebugLocation &debug_location, grpc::testing::EchoTestService::Stub *stub, size_t num_rpcs, const RpcOptions &rpc_options)
Definition: xds_end2end_test_lib.cc:934
server
Definition: examples/python/async_streaming/server.py:1
http_server_filter.h
grpc::testing::XdsEnd2endTest::CreateEndpoint
EdsResourceArgs::Endpoint CreateEndpoint(size_t backend_idx, ::envoy::config::endpoint::v3::HealthStatus health_status=::envoy::config::endpoint::v3::HealthStatus::UNKNOWN, int lb_weight=1)
Definition: xds_end2end_test_lib.h:610
grpc::testing::XdsEnd2endTest::BootstrapBuilder::MakeCertificateProviderText
std::string MakeCertificateProviderText()
Definition: xds_end2end_test_lib.cc:367
exec_ctx
grpc_core::ExecCtx exec_ctx
Definition: end2end_binder_transport_test.cc:75
grpc::testing::XdsEnd2endTest::BackendServerThread::ShutdownAllServices
void ShutdownAllServices() override
Definition: xds_end2end_test_lib.cc:265
grpc::fclose
fclose(creds_file)
grpc::testing::AdsServiceImpl::SetRdsResource
void SetRdsResource(const ::envoy::config::route::v3::RouteConfiguration &route)
Definition: xds_server.h:115
grpc_core::PemKeyCertPairList
std::vector< PemKeyCertPair > PemKeyCertPairList
Definition: ssl_utils.h:183
grpc::testing::XdsEnd2endTest::RpcOptions::service
RpcService service
Definition: xds_end2end_test_lib.h:718
grpc::testing::XdsEnd2endTest::ServerThread::thread_
std::unique_ptr< std::thread > thread_
Definition: xds_end2end_test_lib.h:276
grpc::testing::XdsEnd2endTest::BootstrapBuilder::AuthorityInfo::server
std::string server
Definition: xds_end2end_test_lib.h:447
private_key
Definition: hrss.c:1885
profile_analyzer.fields
list fields
Definition: profile_analyzer.py:266
asyncio_get_stats.response
response
Definition: asyncio_get_stats.py:28
grpc::testing::XdsEnd2endTest::ClientHcmAccessor::Pack
void Pack(const HttpConnectionManager &hcm, Listener *listener) const override
Definition: xds_end2end_test_lib.cc:561
grpc::testing::XdsEnd2endTest::ServerThread::XdsChannelArgsServerBuilderOption
Definition: xds_end2end_test_lib.cc:112
grpc::testing::XdsEnd2endTest::BalancerServerThread
Definition: xds_end2end_test_lib.h:380
grpc::CreateCustomChannel
std::shared_ptr< Channel > CreateCustomChannel(const grpc::string &target, const std::shared_ptr< ChannelCredentials > &creds, const ChannelArguments &args)
timeout_ms
int timeout_ms
Definition: rls_end2end_test.cc:239
absl::StrReplaceAll
std::string StrReplaceAll(absl::string_view s, strings_internal::FixedMapping replacements)
Definition: abseil-cpp/absl/strings/str_replace.cc:71
grpc::testing::XdsEnd2endTest::kDefaultLocalityRegion
static const char kDefaultLocalityRegion[]
Definition: xds_end2end_test_lib.h:194
grpc::testing::XdsEnd2endTest::kDefaultClusterName
static const char kDefaultClusterName[]
Definition: xds_end2end_test_lib.h:202
grpc::XdsCredentials
std::shared_ptr< ChannelCredentials > XdsCredentials(const std::shared_ptr< ChannelCredentials > &fallback_creds)
Builds XDS Credentials.
Definition: cpp/client/xds_credentials.cc:30
GRPC_ARG_PRIORITY_FAILOVER_TIMEOUT_MS
#define GRPC_ARG_PRIORITY_FAILOVER_TIMEOUT_MS
Definition: grpc_types.h:374
testing::WithParamInterface< XdsTestType >::GetParam
static const ParamType & GetParam()
Definition: bloaty/third_party/googletest/googletest/include/gtest/gtest.h:1855
grpc::Status
Definition: include/grpcpp/impl/codegen/status.h:35
GRPC_ARG_XDS_RESOURCE_DOES_NOT_EXIST_TIMEOUT_MS
#define GRPC_ARG_XDS_RESOURCE_DOES_NOT_EXIST_TIMEOUT_MS
Definition: xds/xds_channel_args.h:29
grpc::testing::XdsEnd2endTest::ServerThread::StopListeningAndSendGoaways
void StopListeningAndSendGoaways()
Definition: xds_end2end_test_lib.cc:164
grpc::testing::XdsEnd2endTest::stub_
std::unique_ptr< grpc::testing::EchoTestService::Stub > stub_
Definition: xds_end2end_test_lib.h:1048
server.h
grpc::testing::XdsEnd2endTest::NowFromCycleCounter
static grpc_core::Timestamp NowFromCycleCounter()
Definition: xds_end2end_test_lib.h:1000
grpc::testing::EXPECT_EQ
EXPECT_EQ(options.token_exchange_service_uri, "https://foo/exchange")
GRPC_ARG_DO_NOT_USE_UNLESS_YOU_HAVE_PERMISSION_FROM_GRPC_TEAM_ALLOW_BROKEN_PUT_REQUESTS
#define GRPC_ARG_DO_NOT_USE_UNLESS_YOU_HAVE_PERMISSION_FROM_GRPC_TEAM_ALLOW_BROKEN_PUT_REQUESTS
Definition: http_server_filter.h:59
grpc::testing::XdsEnd2endTest::ReadTlsIdentityPair
static grpc_core::PemKeyCertPairList ReadTlsIdentityPair(const char *key_path, const char *cert_path)
Definition: xds_end2end_test_lib.cc:1035
grpc::testing::XdsEnd2endTest::BootstrapBuilder::PluginInfo::plugin_config
std::string plugin_config
Definition: xds_end2end_test_lib.h:444
grpc::testing::XdsEnd2endTest::BootstrapBuilder
Definition: xds_end2end_test_lib.h:398
grpc::testing::XdsEnd2endTest::RpcOptions::SetupRpc
void SetupRpc(ClientContext *context, EchoRequest *request) const
Definition: xds_end2end_test_lib.cc:413
grpc::InsecureServerCredentials
std::shared_ptr< ServerCredentials > InsecureServerCredentials()
Definition: insecure_server_credentials.cc:52
GRPC_STATUS_FAILED_PRECONDITION
@ GRPC_STATUS_FAILED_PRECONDITION
Definition: include/grpc/impl/codegen/status.h:97
GRPC_ARG_FAKE_SECURITY_EXPECTED_TARGETS
#define GRPC_ARG_FAKE_SECURITY_EXPECTED_TARGETS
Definition: fake_credentials.h:40
grpc::testing::XdsEnd2endTest::balancer_
std::unique_ptr< BalancerServerThread > balancer_
Definition: xds_end2end_test_lib.h:1045
grpc::testing::XdsEnd2endTest::XdsEnd2endTest
XdsEnd2endTest()
Definition: xds_end2end_test_lib.cc:463
grpc::testing::XdsEnd2endTest::BootstrapBuilder::MakeNodeText
std::string MakeNodeText()
Definition: xds_end2end_test_lib.cc:350
grpc::testing::XdsEnd2endTest::CheckRpcSendFailure
void CheckRpcSendFailure(const grpc_core::DebugLocation &debug_location, StatusCode expected_status, absl::string_view expected_message_regex, const RpcOptions &rpc_options=RpcOptions())
Definition: xds_end2end_test_lib.cc:879
grpc::testing::XdsEnd2endTest::BackendServerThread::Credentials
std::shared_ptr< ServerCredentials > Credentials() override
Definition: xds_end2end_test_lib.cc:225
grpc::testing::XdsEnd2endTest::bootstrap_
std::string bootstrap_
Definition: xds_end2end_test_lib.h:1064
grpc::testing::XdsEnd2endTest::SeenAllBackends
bool SeenAllBackends(size_t start_index=0, size_t stop_index=0, const RpcService rpc_service=SERVICE_ECHO)
Definition: xds_end2end_test_lib.cc:708
grpc::testing::XdsEnd2endTest::default_server_listener_
Listener default_server_listener_
Definition: xds_end2end_test_lib.h:1057
context
grpc::ClientContext context
Definition: istio_echo_server_lib.cc:61
grpc::testing::XdsEnd2endTest::kDefaultEdsServiceName
static const char kDefaultEdsServiceName[]
Definition: xds_end2end_test_lib.h:203
grpc::testing::XdsEnd2endTest::ServerThread::test_obj_
XdsEnd2endTest * test_obj_
Definition: xds_end2end_test_lib.h:272
grpc::testing::XdsEnd2endTest::WaitForAllBackends
size_t WaitForAllBackends(const grpc_core::DebugLocation &debug_location, size_t start_index=0, size_t stop_index=0, std::function< void(const RpcResult &)> check_status=nullptr, const WaitForBackendOptions &wait_options=WaitForBackendOptions(), const RpcOptions &rpc_options=RpcOptions())
Definition: xds_end2end_test_lib.cc:971
grpc::testing::XdsEnd2endTest::BackendServerThread::StartAllServices
void StartAllServices() override
Definition: xds_end2end_test_lib.cc:259
grpc::testing::EXPECT_TRUE
EXPECT_TRUE(grpc::experimental::StsCredentialsOptionsFromJson(minimum_valid_json, &options) .ok())
grpc::testing::XdsEnd2endTest::kRequestMessage
static const char kRequestMessage[]
Definition: xds_end2end_test_lib.h:212
grpc::testing::XdsEnd2endTest::default_route_config_
RouteConfiguration default_route_config_
Definition: xds_end2end_test_lib.h:1056
run_xds_tests.backend_service
def backend_service
Definition: run_xds_tests.py:3255
grpc::testing::XdsEnd2endTest::ServerThread::StartAllServices
virtual void StartAllServices()=0
grpc::testing::XdsEnd2endTest::CreateTlsFallbackCredentials
static std::shared_ptr< ChannelCredentials > CreateTlsFallbackCredentials()
Definition: xds_end2end_test_lib.cc:1042
grpc::testing::XdsEnd2endTest::xds_channel_args_
grpc_channel_args xds_channel_args_
Definition: xds_end2end_test_lib.h:1067
function
std::function< bool(GrpcTool *, int, const char **, const CliCredentials &, GrpcToolOutputCallback)> function
Definition: grpc_tool.cc:250
grpc::testing::XdsEnd2endTest::BootstrapBuilder::Build
std::string Build()
Definition: xds_end2end_test_lib.cc:306
grpc::testing::XdsEnd2endTest::SetRouteConfiguration
void SetRouteConfiguration(BalancerServerThread *balancer, const RouteConfiguration &route_config, const Listener *listener_to_copy=nullptr)
Definition: xds_end2end_test_lib.cc:600
grpc::testing::XdsEnd2endTest::WaitForNack
absl::optional< AdsServiceImpl::ResponseState > WaitForNack(const grpc_core::DebugLocation &debug_location, std::function< absl::optional< AdsServiceImpl::ResponseState >()> get_state, StatusCode expected_status=StatusCode::UNAVAILABLE)
Definition: xds_end2end_test_lib.cc:1002
tests.interop.resources.private_key
def private_key()
Definition: interop/resources.py:29
grpc_core::CppImplOf< Server, grpc_server >::FromC
static Server * FromC(grpc_server *c_type)
Definition: cpp_impl_of.h:30
grpc::testing::XdsEnd2endTest::xds_channel_args_to_add_
absl::InlinedVector< grpc_arg, 3 > xds_channel_args_to_add_
Definition: xds_end2end_test_lib.h:1066
grpc::testing::XdsEnd2endTest::RpcOptions
Definition: xds_end2end_test_lib.h:717
grpc_channel_args::args
grpc_arg * args
Definition: grpc_types.h:134
grpc::testing::XdsEnd2endTest::GetServerListenerName
std::string GetServerListenerName(int port)
Definition: xds_end2end_test_lib.cc:541
update
absl::optional< XdsClusterResource > update
Definition: cds.cc:150
grpc::testing::XdsEnd2endTest::xds_drain_grace_time_ms_
int xds_drain_grace_time_ms_
Definition: xds_end2end_test_lib.h:1061
grpc_core::internal::SetXdsChannelArgsForTest
void SetXdsChannelArgsForTest(grpc_channel_args *args)
Definition: xds_client.cc:2513
grpc::testing::XdsEnd2endTest::ipv6_only_
bool ipv6_only_
Definition: xds_end2end_test_lib.h:1043
thread
static uv_thread_t thread
Definition: test-async-null-cb.c:29
grpc::testing::AdsServiceImpl::SetLdsResource
void SetLdsResource(const ::envoy::config::listener::v3::Listener &listener)
Definition: xds_server.h:109
if
if(p->owned &&p->wrapped !=NULL)
Definition: call.c:42
grpc::testing::XdsEnd2endTest::ServerThread::XdsChannelArgsServerBuilderOption::UpdateArguments
void UpdateArguments(grpc::ChannelArguments *args) override
Alter the ChannelArguments used to create the gRPC server.
Definition: xds_end2end_test_lib.cc:118
grpc::testing::XdsEnd2endTest::kServerKeyPath
static const char kServerKeyPath[]
Definition: xds_end2end_test_lib.h:209
absl::InfiniteFuture
constexpr Time InfiniteFuture()
Definition: third_party/abseil-cpp/absl/time/time.h:760
grpc::testing::XdsEnd2endTest::SendRpcsUntil
void SendRpcsUntil(const grpc_core::DebugLocation &debug_location, std::function< bool(const RpcResult &)> continue_predicate, int timeout_ms=5000, const RpcOptions &rpc_options=RpcOptions())
Definition: xds_end2end_test_lib.cc:844
grpc::testing::XdsEnd2endTest::default_server_route_config_
RouteConfiguration default_server_route_config_
Definition: xds_end2end_test_lib.h:1058
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
grpc::testing::mu
static gpr_mu mu
Definition: bm_cq.cc:162
grpc::testing::XdsEnd2endTest::ServerThread::running_
bool running_
Definition: xds_end2end_test_lib.h:277
grpc::testing::XdsEnd2endTest::ClientHcmAccessor::Unpack
HttpConnectionManager Unpack(const Listener &listener) const override
Definition: xds_end2end_test_lib.cc:554
grpc::testing::XdsEnd2endTest::ServerThread::ShutdownAllServices
virtual void ShutdownAllServices()=0
run_interop_tests.server_name
server_name
Definition: run_interop_tests.py:1510
grpc::testing::XdsEnd2endTest::SetListenerAndRouteConfiguration
void SetListenerAndRouteConfiguration(BalancerServerThread *balancer, Listener listener, const RouteConfiguration &route_config, const HcmAccessor &hcm_accessor=ClientHcmAccessor())
Definition: xds_end2end_test_lib.cc:584


grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:58