xds_end2end_test_lib.h
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 
16 #include <memory>
17 #include <set>
18 #include <string>
19 #include <thread>
20 #include <vector>
21 
22 #include <gmock/gmock.h>
23 #include <gtest/gtest.h>
24 
25 #include "absl/status/statusor.h"
26 #include "absl/strings/str_cat.h"
27 #include "absl/strings/string_view.h"
28 #include "absl/types/optional.h"
29 
30 #include <grpc/grpc.h>
31 #include <grpc/grpc_security.h>
32 #include <grpcpp/channel.h>
33 #include <grpcpp/client_context.h>
35 
36 #include "src/core/lib/gpr/env.h"
40 #include "src/proto/grpc/testing/echo.grpc.pb.h"
41 #include "src/proto/grpc/testing/xds/v3/http_connection_manager.grpc.pb.h"
42 #include "src/proto/grpc/testing/xds/v3/http_filter_rbac.grpc.pb.h"
43 #include "test/core/util/port.h"
47 
48 namespace grpc {
49 namespace testing {
50 
51 // The parameter type for INSTANTIATE_TEST_SUITE_P().
52 class XdsTestType {
53  public:
55  // Set the HTTP filter config directly in LDS.
57  // Enable the HTTP filter in LDS, but override the filter config in route.
59  };
60 
65  };
66 
69  return *this;
70  }
71 
73  enable_rds_testing_ = true;
74  return *this;
75  }
76 
78  use_v2_ = true;
79  return *this;
80  }
81 
83  use_xds_credentials_ = true;
84  return *this;
85  }
86 
88  use_csds_streaming_ = true;
89  return *this;
90  }
91 
94  return *this;
95  }
96 
99  return *this;
100  }
101 
102  XdsTestType& set_rbac_action(::envoy::config::rbac::v3::RBAC_Action action) {
104  return *this;
105  }
106 
108  bool enable_rds_testing() const { return enable_rds_testing_; }
109  bool use_v2() const { return use_v2_; }
110  bool use_xds_credentials() const { return use_xds_credentials_; }
111  bool use_csds_streaming() const { return use_csds_streaming_; }
113  return filter_config_setup_;
114  }
116  ::envoy::config::rbac::v3::RBAC_Action rbac_action() const {
117  return rbac_action_;
118  }
119 
121  std::string retval = use_v2_ ? "V2" : "V3";
122  if (enable_load_reporting_) retval += "WithLoadReporting";
123  if (enable_rds_testing_) retval += "Rds";
124  if (use_xds_credentials_) retval += "XdsCreds";
125  if (use_csds_streaming_) retval += "CsdsStreaming";
127  retval += "FilterPerRouteOverride";
128  }
130  retval += "BootstrapFromFile";
131  } else if (bootstrap_source_ == kBootstrapFromEnvVar) {
132  retval += "BootstrapFromEnvVar";
133  }
134  if (rbac_action_ == ::envoy::config::rbac::v3::RBAC_Action_ALLOW) {
135  retval += "RbacAllow";
136  } else if (rbac_action_ == ::envoy::config::rbac::v3::RBAC_Action_DENY) {
137  retval += "RbacDeny";
138  }
139  return retval;
140  }
141 
142  // For use as the final parameter in INSTANTIATE_TEST_SUITE_P().
143  static std::string Name(const ::testing::TestParamInfo<XdsTestType>& info) {
144  return info.param.AsString();
145  }
146 
147  private:
149  bool enable_rds_testing_ = false;
150  bool use_v2_ = false;
151  bool use_xds_credentials_ = false;
152  bool use_csds_streaming_ = false;
155  ::envoy::config::rbac::v3::RBAC_Action rbac_action_ =
156  ::envoy::config::rbac::v3::RBAC_Action_LOG;
157 };
158 
159 // A base class for xDS end-to-end tests.
160 //
161 // An xDS server is provided in balancer_. It is automatically started
162 // for every test. Additional xDS servers can be started if needed by
163 // calling CreateAndStartBalancer().
164 //
165 // A default set of LDS, RDS, and CDS resources are created for gRPC
166 // clients, available in default_listener_, default_route_config_, and
167 // default_cluster_. These resources are automatically loaded into
168 // balancer_ but can be modified by individual tests. No EDS resource
169 // is provided by default. There are also default LDS and RDS resources
170 // for the gRPC server side in default_server_listener_ and
171 // default_server_route_config_. Methods are provided for constructing new
172 // resources that can be added to the xDS server as needed.
173 //
174 // This class provides a mechanism for running backend servers, which will
175 // be stored in backends_. No servers are created or started by default,
176 // but tests can call CreateAndStartBackends() to start however many
177 // backends they want. There are also a number of methods for accessing
178 // backends by index, which is the index into the backends_ vector.
179 // For methods that take a start_index and stop_index, this refers to
180 // the indexes in the range [start_index, stop_index). If stop_index
181 // is 0, backends_.size() is used. Backends may or may not be
182 // xDS-enabled, at the discretion of the test.
183 class XdsEnd2endTest : public ::testing::TestWithParam<XdsTestType> {
184  protected:
185  using Cluster = ::envoy::config::cluster::v3::Cluster;
186  using ClusterLoadAssignment =
187  ::envoy::config::endpoint::v3::ClusterLoadAssignment;
189  using RouteConfiguration = ::envoy::config::route::v3::RouteConfiguration;
190  using HttpConnectionManager = ::envoy::extensions::filters::network::
191  http_connection_manager::v3::HttpConnectionManager;
192 
193  // Default values for locality fields.
194  static const char kDefaultLocalityRegion[];
195  static const char kDefaultLocalityZone[];
196  static const int kDefaultLocalityWeight = 3;
197  static const int kDefaultLocalityPriority = 0;
198 
199  // Default resource names.
200  static const char kServerName[];
201  static const char kDefaultRouteConfigurationName[];
202  static const char kDefaultClusterName[];
203  static const char kDefaultEdsServiceName[];
205 
206  // TLS certificate paths.
207  static const char kCaCertPath[];
208  static const char kServerCertPath[];
209  static const char kServerKeyPath[];
210 
211  // Message used in EchoRequest to the backend.
212  static const char kRequestMessage[];
213 
214  // A base class for server threads.
215  class ServerThread {
216  public:
217  // A status notifier for xDS-enabled servers.
219  : public grpc::experimental::XdsServerServingStatusNotifierInterface {
220  public:
222  ServingStatusUpdate update) override;
223 
225  grpc::StatusCode expected_status);
226 
227  private:
230  std::map<std::string, grpc::Status> status_map ABSL_GUARDED_BY(mu_);
231  };
232 
233  // If use_xds_enabled_server is true, the server will use xDS.
234  explicit ServerThread(XdsEnd2endTest* test_obj,
235  bool use_xds_enabled_server = false)
236  : test_obj_(test_obj),
239 
240  virtual ~ServerThread() { Shutdown(); }
241 
242  void Start();
243  void Shutdown();
244 
245  virtual std::shared_ptr<ServerCredentials> Credentials() {
246  return std::make_shared<SecureServerCredentials>(
248  }
249 
250  int port() const { return port_; }
251 
253 
255 
256  void set_allow_put_requests(bool allow_put_requests) {
257  allow_put_requests_ = allow_put_requests;
258  }
259 
261 
262  private:
263  class XdsChannelArgsServerBuilderOption;
264 
265  virtual const char* Type() = 0;
266  virtual void RegisterAllServices(ServerBuilder* builder) = 0;
267  virtual void StartAllServices() = 0;
268  virtual void ShutdownAllServices() = 0;
269 
271 
273  const int port_;
274  std::unique_ptr<Server> server_;
276  std::unique_ptr<std::thread> thread_;
277  bool running_ = false;
279  bool allow_put_requests_ = false;
280  };
281 
282  // A server thread for a backend server.
284  public:
285  // A wrapper around the backend echo test service impl that counts
286  // requests and responses.
287  template <typename RpcService>
289  : public CountedService<TestMultipleServiceImpl<RpcService>> {
290  public:
292 
293  Status Echo(ServerContext* context, const EchoRequest* request,
294  EchoResponse* response) override {
295  auto peer_identity = context->auth_context()->GetPeerIdentity();
302  {
303  grpc_core::MutexLock lock(&mu_);
304  clients_.insert(context->peer());
305  last_peer_identity_.clear();
306  for (const auto& entry : peer_identity) {
307  last_peer_identity_.emplace_back(entry.data(), entry.size());
308  }
309  }
310  return status;
311  }
312 
313  Status Echo1(ServerContext* context, const EchoRequest* request,
314  EchoResponse* response) override {
315  return Echo(context, request, response);
316  }
317 
318  Status Echo2(ServerContext* context, const EchoRequest* request,
319  EchoResponse* response) override {
320  return Echo(context, request, response);
321  }
322 
323  void Start() {}
324  void Shutdown() {}
325 
326  std::set<std::string> clients() {
327  grpc_core::MutexLock lock(&mu_);
328  return clients_;
329  }
330 
331  const std::vector<std::string>& last_peer_identity() {
332  grpc_core::MutexLock lock(&mu_);
333  return last_peer_identity_;
334  }
335 
336  private:
338  std::set<std::string> clients_ ABSL_GUARDED_BY(mu_);
339  std::vector<std::string> last_peer_identity_ ABSL_GUARDED_BY(mu_);
340  };
341 
342  // If use_xds_enabled_server is true, the server will use xDS.
344 
347  return &backend_service_;
348  }
349  BackendServiceImpl<grpc::testing::EchoTest1Service::Service>*
351  return &backend_service1_;
352  }
353  BackendServiceImpl<grpc::testing::EchoTest2Service::Service>*
355  return &backend_service2_;
356  }
357 
358  // If XdsTestType::use_xds_credentials() and use_xds_enabled_server()
359  // are both true, returns XdsServerCredentials.
360  // Otherwise, if XdsTestType::use_xds_credentials() is true and
361  // use_xds_enabled_server() is false, returns TlsServerCredentials.
362  // Otherwise, returns fake credentials.
363  std::shared_ptr<ServerCredentials> Credentials() override;
364 
365  private:
366  const char* Type() override { return "Backend"; }
367  void RegisterAllServices(ServerBuilder* builder) override;
368  void StartAllServices() override;
369  void ShutdownAllServices() override;
370 
371  BackendServiceImpl<grpc::testing::EchoTestService::Service>
377  };
378 
379  // A server thread for the xDS server.
381  public:
382  explicit BalancerServerThread(XdsEnd2endTest* test_obj);
383 
386 
387  private:
388  const char* Type() override { return "Balancer"; }
389  void RegisterAllServices(ServerBuilder* builder) override;
390  void StartAllServices() override;
391  void ShutdownAllServices() override;
392 
393  std::shared_ptr<AdsServiceImpl> ads_service_;
394  std::shared_ptr<LrsServiceImpl> lrs_service_;
395  };
396 
397  // A builder for the xDS bootstrap config.
399  public:
402  v2_ = true;
403  return *this;
404  }
407  return *this;
408  }
411  return *this;
412  }
414  const std::string& client_default_listener_resource_name_template) {
416  client_default_listener_resource_name_template;
417  return *this;
418  }
420  const std::string& key, const std::string& name,
421  const std::string& plugin_config = "") {
422  plugins_[key] = {name, plugin_config};
423  return *this;
424  }
426  const std::string& authority, const std::string& servers = "",
427  const std::string& client_listener_resource_name_template = "") {
428  authorities_[authority] = {servers,
429  client_listener_resource_name_template};
430  return *this;
431  }
433  const std::string& server_listener_resource_name_template = "") {
435  server_listener_resource_name_template;
436  return *this;
437  }
438 
439  std::string Build();
440 
441  private:
442  struct PluginInfo {
445  };
446  struct AuthorityInfo {
449  };
450 
455 
456  bool v2_ = false;
463  "grpc/server?xds.resource.listening_address=%s";
464  };
465 
467  public:
469  gpr_setenv(env_var_, "true");
470  }
471 
473 
474  private:
475  const char* env_var_;
476  };
477 
478  // RPC services used to talk to the backends.
479  enum RpcService {
483  };
484 
485  // RPC methods used to talk to the backends.
486  enum RpcMethod {
490  };
491 
492  XdsEnd2endTest();
493 
494  void SetUp() override { InitClient(); }
495  void TearDown() override;
496 
497  //
498  // xDS server management
499  //
500 
501  // Creates and starts a new balancer, running in its own thread.
502  // Most tests will not need to call this; instead, they can use
503  // balancer_, which is already populated with default resources.
504  std::unique_ptr<BalancerServerThread> CreateAndStartBalancer();
505 
506  // Returns the name of the server-side xDS Listener resource for a
507  // backend on the specified port.
509 
510  // Returns a copy of listener_template with the server-side resource
511  // name and the port in the socket address populated.
512  Listener PopulateServerListenerNameAndPort(const Listener& listener_template,
513  int port);
514 
515  // Interface for accessing HttpConnectionManager config in Listener.
516  class HcmAccessor {
517  public:
518  virtual ~HcmAccessor() = default;
519  virtual HttpConnectionManager Unpack(const Listener& listener) const = 0;
520  virtual void Pack(const HttpConnectionManager& hcm,
521  Listener* listener) const = 0;
522  };
523 
524  // Client-side impl.
526  public:
527  HttpConnectionManager Unpack(const Listener& listener) const override;
528  void Pack(const HttpConnectionManager& hcm,
529  Listener* listener) const override;
530  };
531 
532  // Server-side impl.
534  public:
535  HttpConnectionManager Unpack(const Listener& listener) const override;
536  void Pack(const HttpConnectionManager& hcm,
537  Listener* listener) const override;
538  };
539 
540  // Sets the Listener and RouteConfiguration resource on the specified
541  // balancer. If RDS is in use, they will be set as separate resources;
542  // otherwise, the RouteConfig will be inlined into the Listener.
544  BalancerServerThread* balancer, Listener listener,
545  const RouteConfiguration& route_config,
546  const HcmAccessor& hcm_accessor = ClientHcmAccessor());
547 
548  // A convenient wrapper for setting the Listener and
549  // RouteConfiguration resources on the server side.
551  BalancerServerThread* balancer, Listener listener, int port,
552  const RouteConfiguration& route_config) {
554  balancer, PopulateServerListenerNameAndPort(listener, port),
555  route_config, ServerHcmAccessor());
556  }
557 
558  // Sets the RouteConfiguration resource on the specified balancer.
559  // If RDS is in use, it will be set directly as an independent
560  // resource; otherwise, it will be inlined into a Listener resource
561  // (either listener_to_copy, or if that is null, default_listener_).
562  void SetRouteConfiguration(BalancerServerThread* balancer,
563  const RouteConfiguration& route_config,
564  const Listener* listener_to_copy = nullptr);
565 
566  // Arguments for constructing an EDS resource.
568  // An individual endpoint for a backend running on a specified port.
569  struct Endpoint {
570  explicit Endpoint(
571  int port,
572  ::envoy::config::endpoint::v3::HealthStatus health_status =
573  ::envoy::config::endpoint::v3::HealthStatus::UNKNOWN,
574  int lb_weight = 1)
576 
577  int port;
578  ::envoy::config::endpoint::v3::HealthStatus health_status;
580  };
581 
582  // A locality.
583  struct Locality {
584  Locality(std::string sub_zone, std::vector<Endpoint> endpoints,
587  : sub_zone(std::move(sub_zone)),
590  priority(priority) {}
591 
593  std::vector<Endpoint> endpoints;
595  int priority;
596  };
597 
598  EdsResourceArgs() = default;
599  explicit EdsResourceArgs(std::vector<Locality> locality_list)
601 
602  std::vector<Locality> locality_list;
603  std::map<std::string, uint32_t> drop_categories;
604  ::envoy::type::v3::FractionalPercent::DenominatorType drop_denominator =
605  ::envoy::type::v3::FractionalPercent::MILLION;
606  };
607 
608  // Helper method for generating an endpoint for a backend, for use in
609  // constructing an EDS resource.
611  size_t backend_idx,
612  ::envoy::config::endpoint::v3::HealthStatus health_status =
613  ::envoy::config::endpoint::v3::HealthStatus::UNKNOWN,
614  int lb_weight = 1) {
615  return EdsResourceArgs::Endpoint(backends_[backend_idx]->port(),
616  health_status, lb_weight);
617  }
618 
619  // Creates a vector of endpoints for a specified range of backends,
620  // for use in constructing an EDS resource.
621  std::vector<EdsResourceArgs::Endpoint> CreateEndpointsForBackends(
622  size_t start_index = 0, size_t stop_index = 0,
623  ::envoy::config::endpoint::v3::HealthStatus health_status =
624  ::envoy::config::endpoint::v3::HealthStatus::UNKNOWN,
625  int lb_weight = 1);
626 
627  // Returns an endpoint for an unused port, for use in constructing an
628  // EDS resource.
631  }
632 
633  // Constructs an EDS resource.
635  const EdsResourceArgs& args,
637 
638  //
639  // Backend management
640  //
641 
642  // Creates num_backends backends and stores them in backends_, but
643  // does not actually start them. If xds_enabled is true, the backends
644  // are xDS-enabled.
645  void CreateBackends(size_t num_backends, bool xds_enabled = false) {
646  for (size_t i = 0; i < num_backends; ++i) {
647  backends_.emplace_back(new BackendServerThread(this, xds_enabled));
648  }
649  }
650 
651  // Starts all backends in backends_.
653  for (auto& backend : backends_) backend->Start();
654  }
655 
656  // Same as CreateBackends(), but also starts the backends.
657  void CreateAndStartBackends(size_t num_backends, bool xds_enabled = false) {
658  CreateBackends(num_backends, xds_enabled);
660  }
661 
662  // Starts the backend at backends_[index].
663  void StartBackend(size_t index) { backends_[index]->Start(); }
664 
665  // Shuts down all backends in backends_.
667  for (auto& backend : backends_) backend->Shutdown();
668  }
669 
670  // Shuts down the backend at backends_[index].
671  void ShutdownBackend(size_t index) { backends_[index]->Shutdown(); }
672 
673  // Resets the request counters for backends in the specified range.
674  void ResetBackendCounters(size_t start_index = 0, size_t stop_index = 0);
675 
676  // Returns true if the specified backend has received requests for the
677  // specified service.
678  bool SeenBackend(size_t backend_idx,
679  const RpcService rpc_service = SERVICE_ECHO);
680 
681  // Returns true if all backends in the specified range have received
682  // requests for the specified service.
683  bool SeenAllBackends(size_t start_index = 0, size_t stop_index = 0,
684  const RpcService rpc_service = SERVICE_ECHO);
685 
686  // Returns a vector containing the port for every backend in the
687  // specified range.
688  std::vector<int> GetBackendPorts(size_t start_index = 0,
689  size_t stop_index = 0) const;
690 
691  //
692  // Client management
693  //
694 
695  // Initializes global state for the client, such as the bootstrap file
696  // and channel args for the XdsClient. Then calls ResetStub().
697  // All tests must call this exactly once at the start of the test.
698  void InitClient(BootstrapBuilder builder = BootstrapBuilder(),
699  std::string lb_expected_authority = "",
700  int xds_resource_does_not_exist_timeout_ms = 0);
701 
702  // Sets channel_, stub_, stub1_, and stub2_.
703  void ResetStub(int failover_timeout_ms = 0, ChannelArguments* args = nullptr);
704 
705  // Creates a new client channel. Requires that InitClient() has
706  // already been called.
707  std::shared_ptr<Channel> CreateChannel(int failover_timeout_ms = 0,
708  const char* server_name = kServerName,
709  const char* xds_authority = "",
710  ChannelArguments* args = nullptr);
711 
712  //
713  // Sending RPCs
714  //
715 
716  // Options used for sending an RPC.
717  struct RpcOptions {
720  int timeout_ms = 1000;
721  bool wait_for_ready = false;
722  std::vector<std::pair<std::string, std::string>> metadata;
723  // These options are used by the backend service impl.
724  bool server_fail = false;
727  bool skip_cancelled_check = false;
729 
731 
733  service = rpc_service;
734  return *this;
735  }
736 
738  method = rpc_method;
739  return *this;
740  }
741 
742  RpcOptions& set_timeout_ms(int rpc_timeout_ms) {
743  timeout_ms = rpc_timeout_ms;
744  return *this;
745  }
746 
747  RpcOptions& set_wait_for_ready(bool rpc_wait_for_ready) {
748  wait_for_ready = rpc_wait_for_ready;
749  return *this;
750  }
751 
753  std::vector<std::pair<std::string, std::string>> rpc_metadata) {
754  metadata = std::move(rpc_metadata);
755  return *this;
756  }
757 
758  RpcOptions& set_server_fail(bool rpc_server_fail) {
759  server_fail = rpc_server_fail;
760  return *this;
761  }
762 
763  RpcOptions& set_server_sleep_us(int rpc_server_sleep_us) {
764  server_sleep_us = rpc_server_sleep_us;
765  return *this;
766  }
767 
768  RpcOptions& set_client_cancel_after_us(int rpc_client_cancel_after_us) {
769  client_cancel_after_us = rpc_client_cancel_after_us;
770  return *this;
771  }
772 
773  RpcOptions& set_skip_cancelled_check(bool rpc_skip_cancelled_check) {
774  skip_cancelled_check = rpc_skip_cancelled_check;
775  return *this;
776  }
777 
780  return *this;
781  }
782 
783  // Populates context and request.
784  void SetupRpc(ClientContext* context, EchoRequest* request) const;
785  };
786 
787  // Sends an RPC with the specified options.
788  // If response is non-null, it will be populated with the response.
789  // Returns the status of the RPC.
790  Status SendRpc(const RpcOptions& rpc_options = RpcOptions(),
791  EchoResponse* response = nullptr);
792 
793  // Internal helper function for SendRpc().
794  template <typename Stub>
795  static Status SendRpcMethod(Stub* stub, const RpcOptions& rpc_options,
796  ClientContext* context, EchoRequest& request,
797  EchoResponse* response) {
798  switch (rpc_options.method) {
799  case METHOD_ECHO:
800  return stub->Echo(context, request, response);
801  case METHOD_ECHO1:
802  return stub->Echo1(context, request, response);
803  case METHOD_ECHO2:
804  return stub->Echo2(context, request, response);
805  }
807  }
808 
809  // Send RPCs in a loop until either continue_predicate() returns false
810  // or timeout_ms elapses.
811  struct RpcResult {
813  EchoResponse response;
814  };
815  void SendRpcsUntil(const grpc_core::DebugLocation& debug_location,
816  std::function<bool(const RpcResult&)> continue_predicate,
817  int timeout_ms = 5000,
818  const RpcOptions& rpc_options = RpcOptions());
819 
820  // Sends the specified number of RPCs and fails if the RPC fails.
821  void CheckRpcSendOk(const grpc_core::DebugLocation& debug_location,
822  const size_t times = 1,
823  const RpcOptions& rpc_options = RpcOptions());
824 
825  // Sends one RPC, which must fail with the specified status code and
826  // a message matching the specified regex.
827  void CheckRpcSendFailure(const grpc_core::DebugLocation& debug_location,
828  StatusCode expected_status,
829  absl::string_view expected_message_regex,
830  const RpcOptions& rpc_options = RpcOptions());
831 
832  // Sends num_rpcs RPCs, counting how many of them fail with a message
833  // matching the specfied expected_message_prefix.
834  // Any failure with a non-matching status or message is a test failure.
836  const grpc_core::DebugLocation& debug_location, size_t num_rpcs,
837  StatusCode expected_status, absl::string_view expected_message_prefix,
838  const RpcOptions& rpc_options = RpcOptions());
839 
840  // A class for running a long-running RPC in its own thread.
841  // TODO(roth): Maybe consolidate this and SendConcurrentRpcs()
842  // somehow? LongRunningRpc has a cleaner API, but SendConcurrentRpcs()
843  // uses the callback API, which is probably better.
845  public:
846  // Starts the RPC.
847  void StartRpc(grpc::testing::EchoTestService::Stub* stub,
848  const RpcOptions& rpc_options =
849  RpcOptions().set_timeout_ms(0).set_client_cancel_after_us(
850  1 * 1000 * 1000));
851 
852  // Cancels the RPC.
853  void CancelRpc();
854 
855  // Gets the RPC's status. Blocks if the RPC is not yet complete.
856  Status GetStatus();
857 
858  private:
862  };
863 
864  // Starts a set of concurrent RPCs.
865  struct ConcurrentRpc {
869  EchoResponse response;
870  };
871  std::vector<ConcurrentRpc> SendConcurrentRpcs(
872  const grpc_core::DebugLocation& debug_location,
873  grpc::testing::EchoTestService::Stub* stub, size_t num_rpcs,
874  const RpcOptions& rpc_options);
875 
876  //
877  // Waiting for individual backends to be seen by the client
878  //
879 
881  // If true, resets the backend counters before returning.
882  bool reset_counters = true;
883  // How long to wait for the backend(s) to see requests.
884  int timeout_ms = 5000;
885 
887 
889  reset_counters = enable;
890  return *this;
891  }
892 
894  timeout_ms = ms;
895  return *this;
896  }
897  };
898 
899  // Sends RPCs until all of the backends in the specified range see requests.
900  // The check_status callback will be invoked to check the status of
901  // every RPC; if null, the default is to check that the RPC succeeded.
902  // Returns the total number of RPCs sent.
903  size_t WaitForAllBackends(
904  const grpc_core::DebugLocation& debug_location, size_t start_index = 0,
905  size_t stop_index = 0,
906  std::function<void(const RpcResult&)> check_status = nullptr,
907  const WaitForBackendOptions& wait_options = WaitForBackendOptions(),
908  const RpcOptions& rpc_options = RpcOptions());
909 
910  // Sends RPCs until the backend at index backend_idx sees requests.
912  const grpc_core::DebugLocation& debug_location, size_t backend_idx,
913  std::function<void(const RpcResult&)> check_status = nullptr,
914  const WaitForBackendOptions& wait_options = WaitForBackendOptions(),
915  const RpcOptions& rpc_options = RpcOptions()) {
916  WaitForAllBackends(debug_location, backend_idx, backend_idx + 1,
917  check_status, wait_options, rpc_options);
918  }
919 
920  //
921  // Waiting for xDS NACKs
922  //
923  // These methods send RPCs in a loop until they see a NACK from the
924  // xDS server, or until a timeout expires.
925 
926  // Sends RPCs until get_state() returns a response.
928  const grpc_core::DebugLocation& debug_location,
930  StatusCode expected_status = StatusCode::UNAVAILABLE);
931 
932  // Sends RPCs until an LDS NACK is seen.
934  const grpc_core::DebugLocation& debug_location,
935  StatusCode expected_status = StatusCode::UNAVAILABLE) {
936  return WaitForNack(
937  debug_location,
938  [&]() { return balancer_->ads_service()->lds_response_state(); },
939  expected_status);
940  }
941 
942  // Sends RPCs until an RDS NACK is seen.
944  const grpc_core::DebugLocation& debug_location,
945  StatusCode expected_status = StatusCode::UNAVAILABLE) {
946  return WaitForNack(
947  debug_location,
948  [&]() { return RouteConfigurationResponseState(balancer_.get()); },
949  expected_status);
950  }
951 
952  // Sends RPCs until a CDS NACK is seen.
954  const grpc_core::DebugLocation& debug_location,
955  StatusCode expected_status = StatusCode::UNAVAILABLE) {
956  return WaitForNack(
957  debug_location,
958  [&]() { return balancer_->ads_service()->cds_response_state(); },
959  expected_status);
960  }
961 
962  // Sends RPCs until an EDS NACK is seen.
964  const grpc_core::DebugLocation& debug_location) {
965  return WaitForNack(debug_location, [&]() {
966  return balancer_->ads_service()->eds_response_state();
967  });
968  }
969 
970  // Convenient front-end to wait for RouteConfiguration to be NACKed,
971  // regardless of whether it's sent in LDS or RDS.
973  const grpc_core::DebugLocation& debug_location,
974  StatusCode expected_status = StatusCode::UNAVAILABLE) {
975  if (GetParam().enable_rds_testing()) {
976  return WaitForRdsNack(debug_location, expected_status);
977  }
978  return WaitForLdsNack(debug_location, expected_status);
979  }
980 
981  // Convenient front-end for accessing xDS response state for a
982  // RouteConfiguration, regardless of whether it's sent in LDS or RDS.
984  BalancerServerThread* balancer) const {
985  AdsServiceImpl* ads_service = balancer->ads_service();
986  if (GetParam().enable_rds_testing()) {
987  return ads_service->rds_response_state();
988  }
989  return ads_service->lds_response_state();
990  }
991 
992  //
993  // Miscellaneous helper methods
994  //
995 
996  // There is slight difference between time fetched by GPR and by C++ system
997  // clock API. It's unclear if they are using the same syscall, but we do know
998  // GPR round the number at millisecond-level. This creates a 1ms difference,
999  // which could cause flake.
1003  }
1004 
1005  // Returns the number of RPCs needed to pass error_tolerance at 99.99994%
1006  // chance. Rolling dices in drop/fault-injection generates a binomial
1007  // distribution (if our code is not horribly wrong). Let's make "n" the number
1008  // of samples, "p" the probability. If we have np>5 & n(1-p)>5, we can
1009  // approximately treat the binomial distribution as a normal distribution.
1010  //
1011  // For normal distribution, we can easily look up how many standard deviation
1012  // we need to reach 99.995%. Based on Wiki's table
1013  // https://en.wikipedia.org/wiki/68%E2%80%9395%E2%80%9399.7_rule, we need 5.00
1014  // sigma (standard deviation) to cover the probability area of 99.99994%. In
1015  // another word, for a sample with size "n" probability "p" error-tolerance
1016  // "k", we want the error always land within 5.00 sigma. The sigma of
1017  // binominal distribution and be computed as sqrt(np(1-p)). Hence, we have
1018  // the equation:
1019  //
1020  // kn <= 5.00 * sqrt(np(1-p))
1021  static size_t ComputeIdealNumRpcs(double p, double error_tolerance) {
1022  GPR_ASSERT(p >= 0 && p <= 1);
1023  size_t num_rpcs =
1024  ceil(p * (1 - p) * 5.00 * 5.00 / error_tolerance / error_tolerance);
1025  gpr_log(GPR_INFO,
1026  "Sending %" PRIuPTR
1027  " RPCs for percentage=%.3f error_tolerance=%.3f",
1028  num_rpcs, p, error_tolerance);
1029  return num_rpcs;
1030  }
1031 
1032  // Returns the contents of the specified file.
1033  static std::string ReadFile(const char* file_path);
1034 
1035  // Returns a private key pair, read from local files.
1037  const char* key_path, const char* cert_path);
1038 
1039  // Returns client credentials suitable for using as fallback
1040  // credentials for XdsCredentials.
1041  static std::shared_ptr<ChannelCredentials> CreateTlsFallbackCredentials();
1042 
1043  bool ipv6_only_ = false;
1044 
1045  std::unique_ptr<BalancerServerThread> balancer_;
1046 
1047  std::shared_ptr<Channel> channel_;
1048  std::unique_ptr<grpc::testing::EchoTestService::Stub> stub_;
1049  std::unique_ptr<grpc::testing::EchoTest1Service::Stub> stub1_;
1050  std::unique_ptr<grpc::testing::EchoTest2Service::Stub> stub2_;
1051 
1052  std::vector<std::unique_ptr<BackendServerThread>> backends_;
1053 
1054  // Default xDS resources.
1060 
1061  int xds_drain_grace_time_ms_ = 10 * 60 * 1000; // 10 mins
1062 
1065  char* bootstrap_file_ = nullptr;
1068 };
1069 
1070 } // namespace testing
1071 } // namespace grpc
grpc::testing::XdsEnd2endTest::EdsResourceArgs::Locality::lb_weight
int lb_weight
Definition: xds_end2end_test_lib.h:594
grpc::testing::XdsTestType::kHttpFilterConfigInRoute
@ kHttpFilterConfigInRoute
Definition: xds_end2end_test_lib.h:58
grpc::testing::XdsTestType::rbac_action
::envoy::config::rbac::v3::RBAC_Action rbac_action() const
Definition: xds_end2end_test_lib.h:116
grpc::testing::XdsEnd2endTest::EdsResourceArgs::drop_denominator
::envoy::type::v3::FractionalPercent::DenominatorType drop_denominator
Definition: xds_end2end_test_lib.h:604
grpc::testing::XdsEnd2endTest::TearDown
void TearDown() override
Definition: xds_end2end_test_lib.cc:519
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
xds_server_builder.h
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
grpc::testing::XdsEnd2endTest::RpcOptions::set_client_cancel_after_us
RpcOptions & set_client_cancel_after_us(int rpc_client_cancel_after_us)
Definition: xds_end2end_test_lib.h:768
setup
Definition: setup.py:1
grpc::ClientContext::peer
std::string peer() const
Definition: client_context.cc:174
grpc::testing::XdsEnd2endTest::StartAllBackends
void StartAllBackends()
Definition: xds_end2end_test_lib.h:652
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
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::SetUp
void SetUp() override
Definition: xds_end2end_test_lib.h:494
grpc::testing::XdsEnd2endTest::BootstrapBuilder::top_server_
std::string top_server_
Definition: xds_end2end_test_lib.h:458
grpc::testing::XdsTestType::use_v2_
bool use_v2_
Definition: xds_end2end_test_lib.h:150
grpc::testing::XdsEnd2endTest::BackendServerThread::BackendServiceImpl::Start
void Start()
Definition: xds_end2end_test_lib.h:323
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
grpc::testing::XdsEnd2endTest::BackendServerThread::backend_service_
BackendServiceImpl< grpc::testing::EchoTestService::Service > backend_service_
Definition: xds_end2end_test_lib.h:372
grpc::testing::XdsEnd2endTest::RpcOptions::set_timeout_ms
RpcOptions & set_timeout_ms(int rpc_timeout_ms)
Definition: xds_end2end_test_lib.h:742
grpc::testing::XdsEnd2endTest::LongRunningRpc::sender_thread_
std::thread sender_thread_
Definition: xds_end2end_test_lib.h:859
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::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
grpc::testing::XdsEnd2endTest::RpcResult::response
EchoResponse response
Definition: xds_end2end_test_lib.h:813
fake_credentials.h
grpc::testing::XdsEnd2endTest::kDefaultServerRouteConfigurationName
static const char kDefaultServerRouteConfigurationName[]
Definition: xds_end2end_test_lib.h:204
grpc::ServerContext
Definition: grpcpp/impl/codegen/server_context.h:566
port.h
env_var
Definition: win/process.c:40
grpc::testing::XdsEnd2endTest::BootstrapBuilder::SetIgnoreResourceDeletion
BootstrapBuilder & SetIgnoreResourceDeletion()
Definition: xds_end2end_test_lib.h:405
grpc::testing::XdsEnd2endTest::METHOD_ECHO2
@ METHOD_ECHO2
Definition: xds_end2end_test_lib.h:489
grpc::testing::XdsEnd2endTest::RpcOptions::timeout_ms
int timeout_ms
Definition: xds_end2end_test_lib.h:720
grpc_core::DebugLocation
Definition: debug_location.h:31
grpc::testing::XdsEnd2endTest::EdsResourceArgs::Endpoint::lb_weight
int lb_weight
Definition: xds_end2end_test_lib.h:579
grpc::testing::XdsEnd2endTest::BuildEdsResource
ClusterLoadAssignment BuildEdsResource(const EdsResourceArgs &args, const char *eds_service_name=kDefaultEdsServiceName)
Definition: xds_end2end_test_lib.cc:631
grpc::testing::XdsEnd2endTest::WaitForBackendOptions::reset_counters
bool reset_counters
Definition: xds_end2end_test_lib.h:882
metadata
Definition: cq_verifier.cc:48
grpc::testing::XdsEnd2endTest::ServerThread::notifier_
XdsServingStatusNotifier notifier_
Definition: xds_end2end_test_lib.h:275
grpc::testing::TestMultipleServiceImpl
Definition: test_service_impl.h:118
grpc
Definition: grpcpp/alarm.h:33
clients_
std::set< std::string > clients_
Definition: client_lb_end2end_test.cc:137
grpc::testing::XdsEnd2endTest::ServerHcmAccessor::Pack
void Pack(const HttpConnectionManager &hcm, Listener *listener) const override
Definition: xds_end2end_test_lib.cc:575
grpc::testing::XdsEnd2endTest::BootstrapBuilder::AddAuthority
BootstrapBuilder & AddAuthority(const std::string &authority, const std::string &servers="", const std::string &client_listener_resource_name_template="")
Definition: xds_end2end_test_lib.h:425
grpc::testing::XdsEnd2endTest::WaitForBackendOptions::set_timeout_ms
WaitForBackendOptions & set_timeout_ms(int ms)
Definition: xds_end2end_test_lib.h:893
grpc::testing::XdsEnd2endTest::WaitForBackendOptions
Definition: xds_end2end_test_lib.h:880
grpc::testing::XdsTestType::kBootstrapFromChannelArg
@ kBootstrapFromChannelArg
Definition: xds_end2end_test_lib.h:62
grpc::testing::XdsEnd2endTest::ScopedExperimentalEnvVar::~ScopedExperimentalEnvVar
~ScopedExperimentalEnvVar()
Definition: xds_end2end_test_lib.h:472
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::EdsResourceArgs::locality_list
std::vector< Locality > locality_list
Definition: xds_end2end_test_lib.h:602
grpc::testing::XdsEnd2endTest::EdsResourceArgs::Endpoint
Definition: xds_end2end_test_lib.h:569
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::testing::XdsEnd2endTest::SERVICE_ECHO1
@ SERVICE_ECHO1
Definition: xds_end2end_test_lib.h:481
grpc::testing::XdsTestType::use_csds_streaming_
bool use_csds_streaming_
Definition: xds_end2end_test_lib.h:152
grpc::testing::XdsEnd2endTest::ConcurrentRpc
Definition: xds_end2end_test_lib.h:865
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
grpc::testing::XdsEnd2endTest::CreateBackends
void CreateBackends(size_t num_backends, bool xds_enabled=false)
Definition: xds_end2end_test_lib.h:645
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::BackendServerThread::backend_service2_
BackendServiceImpl< grpc::testing::EchoTest2Service::Service > backend_service2_
Definition: xds_end2end_test_lib.h:376
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::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
grpc::testing::XdsTestType::bootstrap_source_
BootstrapSource bootstrap_source_
Definition: xds_end2end_test_lib.h:154
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
grpc::testing::XdsEnd2endTest::ServerThread::XdsServingStatusNotifier::OnServingStatusUpdate
void OnServingStatusUpdate(std::string uri, ServingStatusUpdate update) override
Definition: xds_end2end_test_lib.cc:69
grpc::testing::XdsEnd2endTest::ConcurrentRpc::status
Status status
Definition: xds_end2end_test_lib.h:867
grpc::testing::XdsEnd2endTest::METHOD_ECHO
@ METHOD_ECHO
Definition: xds_end2end_test_lib.h:487
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
grpc::testing::XdsEnd2endTest::RpcResult::status
Status status
Definition: xds_end2end_test_lib.h:812
grpc::testing::XdsEnd2endTest::WaitForLdsNack
absl::optional< AdsServiceImpl::ResponseState > WaitForLdsNack(const grpc_core::DebugLocation &debug_location, StatusCode expected_status=StatusCode::UNAVAILABLE)
Definition: xds_end2end_test_lib.h:933
grpc::testing::XdsEnd2endTest::WaitForBackendOptions::WaitForBackendOptions
WaitForBackendOptions()
Definition: xds_end2end_test_lib.h:886
grpc::testing::XdsEnd2endTest::kDefaultLocalityZone
static const char kDefaultLocalityZone[]
Definition: xds_end2end_test_lib.h:195
grpc::testing::XdsEnd2endTest::ServerHcmAccessor
Definition: xds_end2end_test_lib.h:533
grpc::testing::XdsEnd2endTest::BackendServerThread::BackendServiceImpl::mu_
grpc_core::Mutex mu_
Definition: xds_end2end_test_lib.h:337
grpc::testing::XdsEnd2endTest::WaitForRdsNack
absl::optional< AdsServiceImpl::ResponseState > WaitForRdsNack(const grpc_core::DebugLocation &debug_location, StatusCode expected_status=StatusCode::UNAVAILABLE)
Definition: xds_end2end_test_lib.h:943
grpc::testing::XdsEnd2endTest::BootstrapBuilder::authorities_
std::map< std::string, AuthorityInfo > authorities_
Definition: xds_end2end_test_lib.h:461
grpc::testing::XdsEnd2endTest::default_listener_
Listener default_listener_
Definition: xds_end2end_test_lib.h:1055
setup.name
name
Definition: setup.py:542
grpc::testing::XdsEnd2endTest::HcmAccessor::~HcmAccessor
virtual ~HcmAccessor()=default
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::~ServerThread
virtual ~ServerThread()
Definition: xds_end2end_test_lib.h:240
grpc::testing::XdsEnd2endTest::RouteConfiguration
::envoy::config::route::v3::RouteConfiguration RouteConfiguration
Definition: xds_end2end_test_lib.h:189
grpc::testing::XdsEnd2endTest::ServerThread::set_allow_put_requests
void set_allow_put_requests(bool allow_put_requests)
Definition: xds_end2end_test_lib.h:256
run_xds_tests.server_uri
string server_uri
Definition: run_xds_tests.py:3320
grpc::testing::XdsEnd2endTest::BackendServerThread::BackendServiceImpl::clients
std::set< std::string > clients()
Definition: xds_end2end_test_lib.h:326
grpc_security.h
grpc::testing::XdsEnd2endTest::ServerThread
Definition: xds_end2end_test_lib.h:215
async_greeter_client.stub
stub
Definition: hellostreamingworld/async_greeter_client.py:26
grpc::testing::XdsTestType::HttpFilterConfigLocation
HttpFilterConfigLocation
Definition: xds_end2end_test_lib.h:54
grpc::testing::XdsEnd2endTest::HcmAccessor::Unpack
virtual HttpConnectionManager Unpack(const Listener &listener) const =0
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
grpc::testing::XdsEnd2endTest::ServerHcmAccessor::Unpack
HttpConnectionManager Unpack(const Listener &listener) const override
Definition: xds_end2end_test_lib.cc:567
map
zval * map
Definition: php/ext/google/protobuf/encode_decode.c:480
grpc::testing::CountedService< TestMultipleServiceImpl< RpcService > >::IncreaseResponseCount
void IncreaseResponseCount()
Definition: counted_service.h:40
grpc_channel_args
Definition: grpc_types.h:132
grpc::testing::XdsEnd2endTest::RpcResult
Definition: xds_end2end_test_lib.h:811
grpc::testing::XdsEnd2endTest::BackendServerThread::BackendServiceImpl::last_peer_identity
const std::vector< std::string > & last_peer_identity()
Definition: xds_end2end_test_lib.h:331
grpc::testing::XdsEnd2endTest::ScopedExperimentalEnvVar
Definition: xds_end2end_test_lib.h:466
grpc::testing::XdsEnd2endTest::RpcOptions::method
RpcMethod method
Definition: xds_end2end_test_lib.h:719
grpc_status._async.code
code
Definition: grpcio_status/grpc_status/_async.py:34
grpc::testing::XdsEnd2endTest::HcmAccessor
Definition: xds_end2end_test_lib.h:516
test_service_impl.h
testing::TestWithParam
Definition: bloaty/third_party/googletest/googletest/include/gtest/gtest.h:1883
grpc::testing::XdsEnd2endTest::BootstrapBuilder::client_default_listener_resource_name_template_
std::string client_default_listener_resource_name_template_
Definition: xds_end2end_test_lib.h:459
grpc::testing::XdsEnd2endTest::RpcOptions::client_cancel_after_us
int client_cancel_after_us
Definition: xds_end2end_test_lib.h:726
grpc::testing::XdsEnd2endTest::RpcOptions::set_server_sleep_us
RpcOptions & set_server_sleep_us(int rpc_server_sleep_us)
Definition: xds_end2end_test_lib.h:763
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
grpc::testing::XdsTestType::enable_load_reporting
bool enable_load_reporting() const
Definition: xds_end2end_test_lib.h:107
grpc::testing::XdsEnd2endTest::ConcurrentRpc::response
EchoResponse response
Definition: xds_end2end_test_lib.h:869
grpc::testing::XdsEnd2endTest::RpcOptions::server_sleep_us
int server_sleep_us
Definition: xds_end2end_test_lib.h:725
grpc::testing::XdsEnd2endTest::BalancerServerThread::ShutdownAllServices
void ShutdownAllServices() override
Definition: xds_end2end_test_lib.cc:297
grpc::testing::XdsEnd2endTest::BackendServerThread::BackendServerThread
BackendServerThread(XdsEnd2endTest *test_obj, bool use_xds_enabled_server)
Definition: xds_end2end_test_lib.cc:214
grpc::testing::XdsEnd2endTest::RpcService
RpcService
Definition: xds_end2end_test_lib.h:479
profile_analyzer.builder
builder
Definition: profile_analyzer.py:159
grpc::testing::XdsEnd2endTest::ServerThread::notifier
XdsServingStatusNotifier * notifier()
Definition: xds_end2end_test_lib.h:254
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::METHOD_ECHO1
@ METHOD_ECHO1
Definition: xds_end2end_test_lib.h:488
grpc::testing::XdsEnd2endTest::default_cluster_
Cluster default_cluster_
Definition: xds_end2end_test_lib.h:1059
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::testing::XdsEnd2endTest::BootstrapBuilder::AddCertificateProviderPlugin
BootstrapBuilder & AddCertificateProviderPlugin(const std::string &key, const std::string &name, const std::string &plugin_config="")
Definition: xds_end2end_test_lib.h:419
grpc.StatusCode.OK
tuple OK
Definition: src/python/grpcio/grpc/__init__.py:260
grpc::testing::XdsTestType::set_rbac_action
XdsTestType & set_rbac_action(::envoy::config::rbac::v3::RBAC_Action action)
Definition: xds_end2end_test_lib.h:102
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::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::testing::XdsEnd2endTest::ServerThread::XdsServingStatusNotifier
Definition: xds_end2end_test_lib.h:218
grpc::testing::XdsTestType::set_use_xds_credentials
XdsTestType & set_use_xds_credentials()
Definition: xds_end2end_test_lib.h:82
grpc::testing::XdsEnd2endTest::WaitForRouteConfigNack
absl::optional< AdsServiceImpl::ResponseState > WaitForRouteConfigNack(const grpc_core::DebugLocation &debug_location, StatusCode expected_status=StatusCode::UNAVAILABLE)
Definition: xds_end2end_test_lib.h:972
gpr_log
GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, const char *format,...) GPR_PRINT_FORMAT_CHECK(4
grpc::testing::XdsTestType::set_enable_rds_testing
XdsTestType & set_enable_rds_testing()
Definition: xds_end2end_test_lib.h:72
grpc::testing::XdsEnd2endTest::CreateAndStartBackends
void CreateAndStartBackends(size_t num_backends, bool xds_enabled=false)
Definition: xds_end2end_test_lib.h:657
grpc::testing::XdsEnd2endTest::EdsResourceArgs::Locality::endpoints
std::vector< Endpoint > endpoints
Definition: xds_end2end_test_lib.h:593
grpc::testing::XdsTestType::enable_rds_testing
bool enable_rds_testing() const
Definition: xds_end2end_test_lib.h:108
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::testing::XdsEnd2endTest::CreateAndStartBalancer
std::unique_ptr< BalancerServerThread > CreateAndStartBalancer()
Definition: xds_end2end_test_lib.cc:534
grpc.h
grpc::testing::XdsTestType::rbac_action_
::envoy::config::rbac::v3::RBAC_Action rbac_action_
Definition: xds_end2end_test_lib.h:155
cond
static uv_cond_t cond
Definition: threadpool.c:33
grpc::testing::XdsEnd2endTest::BootstrapBuilder::SetServerListenerResourceNameTemplate
BootstrapBuilder & SetServerListenerResourceNameTemplate(const std::string &server_listener_resource_name_template="")
Definition: xds_end2end_test_lib.h:432
grpc::testing::XdsEnd2endTest::RpcOptions::set_rpc_method
RpcOptions & set_rpc_method(RpcMethod rpc_method)
Definition: xds_end2end_test_lib.h:737
grpc::testing::XdsEnd2endTest::ServerThread::Start
void Start()
Definition: xds_end2end_test_lib.cc:138
grpc::testing::XdsEnd2endTest::WaitForBackend
void WaitForBackend(const grpc_core::DebugLocation &debug_location, size_t backend_idx, std::function< void(const RpcResult &)> check_status=nullptr, const WaitForBackendOptions &wait_options=WaitForBackendOptions(), const RpcOptions &rpc_options=RpcOptions())
Definition: xds_end2end_test_lib.h:911
grpc::testing::XdsEnd2endTest::BackendServerThread::BackendServiceImpl
Definition: xds_end2end_test_lib.h:288
grpc::testing::XdsEnd2endTest::BackendServerThread
Definition: xds_end2end_test_lib.h:283
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::XdsTestType::set_use_v2
XdsTestType & set_use_v2()
Definition: xds_end2end_test_lib.h:77
grpc::testing::XdsEnd2endTest::ShutdownBackend
void ShutdownBackend(size_t index)
Definition: xds_end2end_test_lib.h:671
grpc::testing::XdsTestType::set_use_csds_streaming
XdsTestType & set_use_csds_streaming()
Definition: xds_end2end_test_lib.h:87
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
grpc::testing::XdsEnd2endTest::BootstrapBuilder::BootstrapBuilder
BootstrapBuilder()
Definition: xds_end2end_test_lib.h:400
grpc::gpr_unsetenv
gpr_unsetenv("STS_CREDENTIALS")
channel.h
grpc::testing::XdsEnd2endTest::ServerThread::Serve
void Serve(grpc_core::Mutex *mu, grpc_core::CondVar *cond)
Definition: xds_end2end_test_lib.cc:175
grpc::testing::XdsEnd2endTest::LongRunningRpc
Definition: xds_end2end_test_lib.h:844
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
GPR_CLOCK_MONOTONIC
@ GPR_CLOCK_MONOTONIC
Definition: gpr_types.h:36
grpc::testing::XdsEnd2endTest::kDefaultRouteConfigurationName
static const char kDefaultRouteConfigurationName[]
Definition: xds_end2end_test_lib.h:201
grpc::testing::XdsTestType::BootstrapSource
BootstrapSource
Definition: xds_end2end_test_lib.h:61
grpc::ClientContext::auth_context
std::shared_ptr< const grpc::AuthContext > auth_context() const
Definition: grpcpp/impl/codegen/client_context.h:309
grpc::testing::AdsServiceImpl
Definition: xds_server.h:68
grpc::Status::OK
static const Status & OK
An OK pre-defined instance.
Definition: include/grpcpp/impl/codegen/status.h:113
grpc.server
def server(thread_pool, handlers=None, interceptors=None, options=None, maximum_concurrent_rpcs=None, compression=None, xds=False)
Definition: src/python/grpcio/grpc/__init__.py:2034
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_fake_transport_security_server_credentials_create
grpc_server_credentials * grpc_fake_transport_security_server_credentials_create()
Definition: fake_credentials.cc:84
grpc::testing::XdsEnd2endTest::EdsResourceArgs::Locality
Definition: xds_end2end_test_lib.h:583
grpc::testing::XdsEnd2endTest::kCaCertPath
static const char kCaCertPath[]
Definition: xds_end2end_test_lib.h:207
grpc::testing::XdsEnd2endTest::WaitForEdsNack
absl::optional< AdsServiceImpl::ResponseState > WaitForEdsNack(const grpc_core::DebugLocation &debug_location)
Definition: xds_end2end_test_lib.h:963
grpc::testing::XdsEnd2endTest::ComputeIdealNumRpcs
static size_t ComputeIdealNumRpcs(double p, double error_tolerance)
Definition: xds_end2end_test_lib.h:1021
GPR_UNREACHABLE_CODE
#define GPR_UNREACHABLE_CODE(STATEMENT)
Definition: impl/codegen/port_platform.h:652
Endpoint
::grpc_event_engine::experimental::EventEngine::Endpoint Endpoint
Definition: event_engine_test_utils.cc:41
grpc_pick_unused_port_or_die
int grpc_pick_unused_port_or_die(void)
grpc::testing::XdsEnd2endTest::BackendServerThread::BackendServiceImpl::Shutdown
void Shutdown()
Definition: xds_end2end_test_lib.h:324
grpc::testing::XdsEnd2endTest::BalancerServerThread::lrs_service_
std::shared_ptr< LrsServiceImpl > lrs_service_
Definition: xds_end2end_test_lib.h:394
grpc::testing::XdsEnd2endTest::BootstrapBuilder::MakeXdsServersText
std::string MakeXdsServersText(absl::string_view server_uri)
Definition: xds_end2end_test_lib.cc:325
grpc::testing::XdsEnd2endTest::BackendServerThread::backend_service1
BackendServiceImpl< grpc::testing::EchoTest1Service::Service > * backend_service1()
Definition: xds_end2end_test_lib.h:350
grpc::testing::TestMultipleServiceImpl::Echo
Status Echo(ServerContext *context, const EchoRequest *request, EchoResponse *response)
Definition: test_service_impl.h:124
gpr_now
GPRAPI gpr_timespec gpr_now(gpr_clock_type clock)
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::BootstrapBuilder::plugins_
std::map< std::string, PluginInfo > plugins_
Definition: xds_end2end_test_lib.h:460
grpc::testing::XdsEnd2endTest::WaitForCdsNack
absl::optional< AdsServiceImpl::ResponseState > WaitForCdsNack(const grpc_core::DebugLocation &debug_location, StatusCode expected_status=StatusCode::UNAVAILABLE)
Definition: xds_end2end_test_lib.h:953
grpc::testing::XdsEnd2endTest::BackendServerThread::BackendServiceImpl::Echo2
Status Echo2(ServerContext *context, const EchoRequest *request, EchoResponse *response) override
Definition: xds_end2end_test_lib.h:318
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::EdsResourceArgs::Endpoint::Endpoint
Endpoint(int port, ::envoy::config::endpoint::v3::HealthStatus health_status=::envoy::config::endpoint::v3::HealthStatus::UNKNOWN, int lb_weight=1)
Definition: xds_end2end_test_lib.h:570
grpc::testing::XdsEnd2endTest::BalancerServerThread::ads_service
AdsServiceImpl * ads_service()
Definition: xds_end2end_test_lib.h:384
grpc::testing::XdsEnd2endTest::EdsResourceArgs::drop_categories
std::map< std::string, uint32_t > drop_categories
Definition: xds_end2end_test_lib.h:603
grpc::testing::XdsEnd2endTest::SERVICE_ECHO
@ SERVICE_ECHO
Definition: xds_end2end_test_lib.h:480
grpc::testing::CountedService< TestMultipleServiceImpl< RpcService > >::IncreaseRequestCount
void IncreaseRequestCount()
Definition: counted_service.h:44
grpc::testing::XdsEnd2endTest::BootstrapBuilder::server_listener_resource_name_template_
std::string server_listener_resource_name_template_
Definition: xds_end2end_test_lib.h:462
grpc::testing::XdsEnd2endTest::backends_
std::vector< std::unique_ptr< BackendServerThread > > backends_
Definition: xds_end2end_test_lib.h:1052
grpc::testing::XdsEnd2endTest::EdsResourceArgs::Locality::sub_zone
const std::string sub_zone
Definition: xds_end2end_test_lib.h:592
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::StartBackend
void StartBackend(size_t index)
Definition: xds_end2end_test_lib.h:663
grpc::testing::XdsEnd2endTest::ScopedExperimentalEnvVar::ScopedExperimentalEnvVar
ScopedExperimentalEnvVar(const char *env_var)
Definition: xds_end2end_test_lib.h:468
grpc::testing::XdsEnd2endTest::ServerThread::XdsServingStatusNotifier::ABSL_GUARDED_BY
std::map< std::string, grpc::Status > status_map ABSL_GUARDED_BY(mu_)
grpc::testing::XdsEnd2endTest::LongRunningRpc::status_
Status status_
Definition: xds_end2end_test_lib.h:861
grpc::testing::XdsEnd2endTest::EdsResourceArgs::EdsResourceArgs
EdsResourceArgs(std::vector< Locality > locality_list)
Definition: xds_end2end_test_lib.h:599
grpc::testing::XdsEnd2endTest::BalancerServerThread::lrs_service
LrsServiceImpl * lrs_service()
Definition: xds_end2end_test_lib.h:385
grpc::testing::XdsTestType::set_bootstrap_source
XdsTestType & set_bootstrap_source(BootstrapSource bootstrap_source)
Definition: xds_end2end_test_lib.h:97
grpc::testing::XdsEnd2endTest::bootstrap_file_
char * bootstrap_file_
Definition: xds_end2end_test_lib.h:1065
grpc::testing::XdsTestType::filter_config_setup_
HttpFilterConfigLocation filter_config_setup_
Definition: xds_end2end_test_lib.h:153
grpc::testing::XdsEnd2endTest::ServerThread::RegisterAllServices
virtual void RegisterAllServices(ServerBuilder *builder)=0
grpc::testing::XdsEnd2endTest::EdsResourceArgs::Locality::priority
int priority
Definition: xds_end2end_test_lib.h:595
grpc::testing::XdsEnd2endTest::BootstrapBuilder::AuthorityInfo::client_listener_resource_name_template
std::string client_listener_resource_name_template
Definition: xds_end2end_test_lib.h:448
grpc::testing::XdsEnd2endTest::ScopedExperimentalEnvVar::env_var_
const char * env_var_
Definition: xds_end2end_test_lib.h:475
grpc::testing::XdsEnd2endTest::RpcOptions::set_server_expected_error
RpcOptions & set_server_expected_error(StatusCode code)
Definition: xds_end2end_test_lib.h:778
secure_server_credentials.h
grpc::testing::XdsTestType::kBootstrapFromFile
@ kBootstrapFromFile
Definition: xds_end2end_test_lib.h:63
xds_server.h
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::EdsResourceArgs::Endpoint::health_status
::envoy::config::endpoint::v3::HealthStatus health_status
Definition: xds_end2end_test_lib.h:578
grpc::testing::XdsEnd2endTest::ServerThread::Shutdown
void Shutdown()
Definition: xds_end2end_test_lib.cc:154
grpc::testing::AdsServiceImpl::rds_response_state
absl::optional< ResponseState > rds_response_state()
Definition: xds_server.h:163
grpc::testing::XdsTestType::use_xds_credentials
bool use_xds_credentials() const
Definition: xds_end2end_test_lib.h:110
grpc::testing::XdsTestType::AsString
std::string AsString() const
Definition: xds_end2end_test_lib.h:120
client_context.h
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::testing::XdsEnd2endTest::BackendServerThread::backend_service1_
BackendServiceImpl< grpc::testing::EchoTest1Service::Service > backend_service1_
Definition: xds_end2end_test_lib.h:374
grpc::testing::XdsEnd2endTest::BackendServerThread::backend_service
BackendServiceImpl< grpc::testing::EchoTestService::Service > * backend_service()
Definition: xds_end2end_test_lib.h:346
grpc::testing::XdsEnd2endTest::BackendServerThread::BackendServiceImpl::ABSL_GUARDED_BY
std::set< std::string > clients_ ABSL_GUARDED_BY(mu_)
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
grpc::testing::XdsEnd2endTest::Cluster
::envoy::config::cluster::v3::Cluster Cluster
Definition: xds_end2end_test_lib.h:185
eds_service_name
std::string eds_service_name
Definition: xds_cluster_resolver.cc:99
client.action
action
Definition: examples/python/xds/client.py:49
grpc::testing::XdsEnd2endTest::kDefaultLocalityPriority
static const int kDefaultLocalityPriority
Definition: xds_end2end_test_lib.h:197
grpc::testing::XdsEnd2endTest::ServerThread::server_
std::unique_ptr< Server > server_
Definition: xds_end2end_test_lib.h:274
grpc::testing::XdsTestType
Definition: xds_end2end_test_lib.h:52
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
grpc::testing::XdsEnd2endTest::BackendServerThread::Type
const char * Type() override
Definition: xds_end2end_test_lib.h:366
server
Definition: examples/python/async_streaming/server.py:1
grpc::testing::XdsTestType::kHttpFilterConfigInListener
@ kHttpFilterConfigInListener
Definition: xds_end2end_test_lib.h:56
grpc::testing::XdsEnd2endTest::LongRunningRpc::context_
ClientContext context_
Definition: xds_end2end_test_lib.h:860
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::AdsServiceImpl::lds_response_state
absl::optional< ResponseState > lds_response_state()
Definition: xds_server.h:160
grpc::testing::XdsEnd2endTest::BootstrapBuilder::MakeCertificateProviderText
std::string MakeCertificateProviderText()
Definition: xds_end2end_test_lib.cc:367
grpc::testing::XdsEnd2endTest::BackendServerThread::ShutdownAllServices
void ShutdownAllServices() override
Definition: xds_end2end_test_lib.cc:265
grpc_core::PemKeyCertPairList
std::vector< PemKeyCertPair > PemKeyCertPairList
Definition: ssl_utils.h:183
grpc::testing::XdsEnd2endTest::RpcMethod
RpcMethod
Definition: xds_end2end_test_lib.h:486
grpc::testing::XdsEnd2endTest::BackendServerThread::BackendServiceImpl::Echo1
Status Echo1(ServerContext *context, const EchoRequest *request, EchoResponse *response) override
Definition: xds_end2end_test_lib.h:313
grpc::testing::XdsEnd2endTest::RpcOptions::service
RpcService service
Definition: xds_end2end_test_lib.h:718
grpc::testing::XdsEnd2endTest::ConcurrentRpc::elapsed_time
grpc_core::Duration elapsed_time
Definition: xds_end2end_test_lib.h:868
index
int index
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/protobuf.h:1184
grpc::testing::XdsEnd2endTest::ServerThread::thread_
std::unique_ptr< std::thread > thread_
Definition: xds_end2end_test_lib.h:276
grpc::testing::XdsTestType::enable_rds_testing_
bool enable_rds_testing_
Definition: xds_end2end_test_lib.h:149
grpc::testing::XdsEnd2endTest::RpcOptions::server_fail
bool server_fail
Definition: xds_end2end_test_lib.h:724
grpc::testing::XdsEnd2endTest::BootstrapBuilder::AuthorityInfo::server
std::string server
Definition: xds_end2end_test_lib.h:447
asyncio_get_stats.response
response
Definition: asyncio_get_stats.py:28
std
Definition: grpcpp/impl/codegen/async_unary_call.h:407
grpc::testing::XdsTestType::filter_config_setup
HttpFilterConfigLocation filter_config_setup() const
Definition: xds_end2end_test_lib.h:112
grpc::testing::XdsEnd2endTest::RpcOptions::set_metadata
RpcOptions & set_metadata(std::vector< std::pair< std::string, std::string >> rpc_metadata)
Definition: xds_end2end_test_lib.h:752
grpc::testing::XdsEnd2endTest::ClientHcmAccessor::Pack
void Pack(const HttpConnectionManager &hcm, Listener *listener) const override
Definition: xds_end2end_test_lib.cc:561
grpc_core::Timestamp::FromTimespecRoundDown
static Timestamp FromTimespecRoundDown(gpr_timespec t)
Definition: src/core/lib/gprpp/time.cc:141
grpc::testing::XdsEnd2endTest::BalancerServerThread
Definition: xds_end2end_test_lib.h:380
timeout_ms
int timeout_ms
Definition: rls_end2end_test.cc:239
grpc::testing::XdsEnd2endTest::BootstrapBuilder::SetDefaultServer
BootstrapBuilder & SetDefaultServer(const std::string &server)
Definition: xds_end2end_test_lib.h:409
grpc::testing::CountedService
Definition: counted_service.h:28
grpc::testing::XdsEnd2endTest::kDefaultClusterName
static const char kDefaultClusterName[]
Definition: xds_end2end_test_lib.h:202
grpc::testing::XdsEnd2endTest::kDefaultLocalityRegion
static const char kDefaultLocalityRegion[]
Definition: xds_end2end_test_lib.h:194
grpc::testing::XdsEnd2endTest::BalancerServerThread::ads_service_
std::shared_ptr< AdsServiceImpl > ads_service_
Definition: xds_end2end_test_lib.h:393
grpc::testing::XdsEnd2endTest::BackendServerThread::backend_service2
BackendServiceImpl< grpc::testing::EchoTest2Service::Service > * backend_service2()
Definition: xds_end2end_test_lib.h:354
testing::WithParamInterface< XdsTestType >::GetParam
static const ParamType & GetParam()
Definition: bloaty/third_party/googletest/googletest/include/gtest/gtest.h:1855
grpc::testing::XdsTestType::bootstrap_source
BootstrapSource bootstrap_source() const
Definition: xds_end2end_test_lib.h:115
grpc::testing::XdsEnd2endTest::ClientHcmAccessor
Definition: xds_end2end_test_lib.h:525
grpc::testing::XdsEnd2endTest::RpcOptions::set_wait_for_ready
RpcOptions & set_wait_for_ready(bool rpc_wait_for_ready)
Definition: xds_end2end_test_lib.h:747
grpc::Status
Definition: include/grpcpp/impl/codegen/status.h:35
grpc::testing::XdsEnd2endTest::BootstrapBuilder::v2_
bool v2_
Definition: xds_end2end_test_lib.h:456
grpc::testing::XdsEnd2endTest::BootstrapBuilder::ignore_resource_deletion_
bool ignore_resource_deletion_
Definition: xds_end2end_test_lib.h:457
grpc::testing::XdsEnd2endTest::ServerThread::StopListeningAndSendGoaways
void StopListeningAndSendGoaways()
Definition: xds_end2end_test_lib.cc:164
grpc::testing::XdsTestType::use_xds_credentials_
bool use_xds_credentials_
Definition: xds_end2end_test_lib.h:151
grpc::testing::XdsEnd2endTest::RpcOptions::skip_cancelled_check
bool skip_cancelled_check
Definition: xds_end2end_test_lib.h:727
grpc::testing::XdsEnd2endTest::MakeNonExistantEndpoint
EdsResourceArgs::Endpoint MakeNonExistantEndpoint()
Definition: xds_end2end_test_lib.h:629
grpc::testing::XdsEnd2endTest::stub_
std::unique_ptr< grpc::testing::EchoTestService::Stub > stub_
Definition: xds_end2end_test_lib.h:1048
grpc::testing::XdsEnd2endTest::NowFromCycleCounter
static grpc_core::Timestamp NowFromCycleCounter()
Definition: xds_end2end_test_lib.h:1000
grpc::testing::XdsEnd2endTest::RpcOptions::set_rpc_service
RpcOptions & set_rpc_service(RpcService rpc_service)
Definition: xds_end2end_test_lib.h:732
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::BootstrapBuilder::SetClientDefaultListenerResourceNameTemplate
BootstrapBuilder & SetClientDefaultListenerResourceNameTemplate(const std::string &client_default_listener_resource_name_template)
Definition: xds_end2end_test_lib.h:413
grpc::testing::XdsEnd2endTest::RpcOptions::SetupRpc
void SetupRpc(ClientContext *context, EchoRequest *request) const
Definition: xds_end2end_test_lib.cc:413
grpc.StatusCode.UNAVAILABLE
tuple UNAVAILABLE
Definition: src/python/grpcio/grpc/__init__.py:278
grpc::testing::XdsEnd2endTest::ServerThread::ServerThread
ServerThread(XdsEnd2endTest *test_obj, bool use_xds_enabled_server=false)
Definition: xds_end2end_test_lib.h:234
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::BalancerServerThread::Type
const char * Type() override
Definition: xds_end2end_test_lib.h:388
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::XdsTestType::set_enable_load_reporting
XdsTestType & set_enable_load_reporting()
Definition: xds_end2end_test_lib.h:67
grpc::testing::XdsEnd2endTest::EdsResourceArgs::EdsResourceArgs
EdsResourceArgs()=default
grpc::testing::XdsEnd2endTest::RpcOptions::wait_for_ready
bool wait_for_ready
Definition: xds_end2end_test_lib.h:721
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::RpcOptions::metadata
std::vector< std::pair< std::string, std::string > > metadata
Definition: xds_end2end_test_lib.h:722
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::XdsEnd2endTest::kRequestMessage
static const char kRequestMessage[]
Definition: xds_end2end_test_lib.h:212
grpc::testing::XdsEnd2endTest::RpcOptions::RpcOptions
RpcOptions()
Definition: xds_end2end_test_lib.h:730
code
Definition: bloaty/third_party/zlib/contrib/infback9/inftree9.h:24
absl::InlinedVector< grpc_arg, 3 >
grpc::testing::XdsTestType::use_v2
bool use_v2() const
Definition: xds_end2end_test_lib.h:109
grpc::testing::XdsEnd2endTest::EdsResourceArgs::Endpoint::port
int port
Definition: xds_end2end_test_lib.h:577
grpc::testing::XdsEnd2endTest::default_route_config_
RouteConfiguration default_route_config_
Definition: xds_end2end_test_lib.h:1056
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
grpc::testing::XdsEnd2endTest::RpcOptions::set_server_fail
RpcOptions & set_server_fail(bool rpc_server_fail)
Definition: xds_end2end_test_lib.h:758
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
grpc_core::Duration
Definition: src/core/lib/gprpp/time.h:122
grpc::testing::XdsEnd2endTest::bootstrap_contents_from_env_var_
bool bootstrap_contents_from_env_var_
Definition: xds_end2end_test_lib.h:1063
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::BackendServerThread::BackendServiceImpl::Echo
Status Echo(ServerContext *context, const EchoRequest *request, EchoResponse *response) override
Definition: xds_end2end_test_lib.h:293
grpc::testing::XdsEnd2endTest::RpcOptions
Definition: xds_end2end_test_lib.h:717
grpc::testing::XdsTestType::enable_load_reporting_
bool enable_load_reporting_
Definition: xds_end2end_test_lib.h:148
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::testing::XdsEnd2endTest::WaitForBackendOptions::set_reset_counters
WaitForBackendOptions & set_reset_counters(bool enable)
Definition: xds_end2end_test_lib.h:888
grpc::testing::XdsTestType::set_filter_config_setup
XdsTestType & set_filter_config_setup(HttpFilterConfigLocation setup)
Definition: xds_end2end_test_lib.h:92
counted_service.h
grpc::testing::XdsEnd2endTest::ipv6_only_
bool ipv6_only_
Definition: xds_end2end_test_lib.h:1043
grpc::testing::XdsEnd2endTest::RpcOptions::set_skip_cancelled_check
RpcOptions & set_skip_cancelled_check(bool rpc_skip_cancelled_check)
Definition: xds_end2end_test_lib.h:773
thread
static uv_thread_t thread
Definition: test-async-null-cb.c:29
grpc::testing::XdsEnd2endTest::kServerKeyPath
static const char kServerKeyPath[]
Definition: xds_end2end_test_lib.h:209
grpc::testing::XdsEnd2endTest::kDefaultLocalityWeight
static const int kDefaultLocalityWeight
Definition: xds_end2end_test_lib.h:196
grpc::testing::setup
static void setup()
Definition: bm_cq_multiple_threads.cc:117
grpc::testing::XdsTestType::use_csds_streaming
bool use_csds_streaming() const
Definition: xds_end2end_test_lib.h:111
ssl_utils.h
grpc::testing::XdsEnd2endTest::EdsResourceArgs::Locality::Locality
Locality(std::string sub_zone, std::vector< Endpoint > endpoints, int lb_weight=kDefaultLocalityWeight, int priority=kDefaultLocalityPriority)
Definition: xds_end2end_test_lib.h:584
run_interop_tests.servers
servers
Definition: run_interop_tests.py:1288
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::XdsEnd2endTest::BootstrapBuilder::SetV2
BootstrapBuilder & SetV2()
Definition: xds_end2end_test_lib.h:401
grpc::testing::XdsTestType::Name
static std::string Name(const ::testing::TestParamInfo< XdsTestType > &info)
Definition: xds_end2end_test_lib.h:143
grpc::testing::XdsEnd2endTest::BackendServerThread::BackendServiceImpl::BackendServiceImpl
BackendServiceImpl()
Definition: xds_end2end_test_lib.h:291
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::RouteConfigurationResponseState
absl::optional< AdsServiceImpl::ResponseState > RouteConfigurationResponseState(BalancerServerThread *balancer) const
Definition: xds_end2end_test_lib.h:983
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