The C based gRPC (C++, Python, Ruby, Objective-C, PHP, C#) https://grpc.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

398 lines
9.5 KiB

# Copyright 2017 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
8 years ago
load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_package", "grpc_proto_library")
licenses(["notice"])
8 years ago
grpc_package(
name = "test/core/util",
visibility = "public",
)
grpc_cc_library(
name = "grpc_suppressions",
data = [
"lsan_suppressions.txt",
"tsan_suppressions.txt",
"ubsan_suppressions.txt",
],
)
TEST_UTILS_THAT_USE_GRPC_H_SOURCES = [
"port.cc",
"port_isolated_runtime_environment.cc",
"port_server_client.cc",
"reconnect_server.cc",
"test_config.cc",
"test_tcp_server.cc",
]
TEST_UTILS_THAT_USE_GRPC_H_HEADERS = [
"port.h",
"reconnect_server.h",
"port_server_client.h",
"test_config.h",
"test_tcp_server.h",
]
grpc_cc_library(
name = "grpc_test_util_base",
srcs = [
"cmdline.cc",
7 years ago
"fuzzer_util.cc",
"grpc_profiler.cc",
"histogram.cc",
"mock_endpoint.cc",
"parse_hexstring.cc",
"passthru_endpoint.cc",
"resolve_localhost_ip46.cc",
"slice_splitter.cc",
"subprocess_posix.cc",
"subprocess_windows.cc",
"tracer_util.cc",
8 years ago
],
hdrs = [
"cmdline.h",
"evaluate_args_test_util.h",
7 years ago
"fuzzer_util.h",
8 years ago
"grpc_profiler.h",
"histogram.h",
"mock_authorization_endpoint.h",
8 years ago
"mock_endpoint.h",
"parse_hexstring.h",
"passthru_endpoint.h",
"resolve_localhost_ip46.h",
8 years ago
"slice_splitter.h",
"subprocess.h",
"tracer_util.h",
8 years ago
],
external_deps = [
"absl/status:statusor",
"absl/strings",
"absl/strings:str_format",
"absl/types:span",
],
language = "C++",
tags = ["nofixdeps"],
deps = [
"//:debug_location",
"//:gpr",
"//:grpc_base",
"//:grpc_security_base",
"//:grpc_trace",
"//:iomgr_timer",
"//:ref_counted_ptr",
"//src/core:arena",
"//src/core:closure",
"//src/core:grpc_authorization_base",
"//src/core:grpc_sockaddr",
"//src/core:iomgr_fwd",
"//src/core:memory_quota",
"//src/core:resolved_address",
"//src/core:resource_quota",
"//src/core:slice",
"//src/core:slice_refcount",
"//src/core:time",
"//src/core:useful",
],
)
grpc_cc_library(
name = "grpc_test_util",
srcs = TEST_UTILS_THAT_USE_GRPC_H_SOURCES + ["tls_utils.cc"],
hdrs = TEST_UTILS_THAT_USE_GRPC_H_HEADERS + ["tls_utils.h"],
external_deps = [
"absl/base:core_headers",
"absl/debugging:failure_signal_handler",
"absl/status",
"absl/status:statusor",
"absl/strings",
"absl/strings:str_format",
],
language = "C++",
deps = [
"build",
"stack_tracer",
"//:config",
"//:exec_ctx",
"//:gpr",
"//:grpc",
"//:grpc_public_hdrs",
"//:grpc_security_base",
"//:httpcli",
"//:orphanable",
"//:ref_counted_ptr",
"//:tsi_ssl_credentials",
"//:uri_parser",
"//src/core:channel_args_endpoint_config",
"//src/core:channel_args_preconditioning",
"//src/core:closure",
"//src/core:error",
"//src/core:gpr_atm",
"//src/core:grpc_sockaddr",
"//src/core:iomgr_fwd",
"//src/core:iomgr_port",
"//src/core:resolved_address",
"//src/core:slice",
"//src/core:slice_refcount",
"//src/core:status_helper",
"//src/core:time",
"//test/core/event_engine:test_init",
],
alwayslink = 1,
)
grpc_cc_library(
name = "grpc_test_util_unsecure",
srcs = TEST_UTILS_THAT_USE_GRPC_H_SOURCES,
hdrs = TEST_UTILS_THAT_USE_GRPC_H_HEADERS,
external_deps = [
"absl/debugging:failure_signal_handler",
"absl/status",
"absl/status:statusor",
"absl/strings",
"absl/strings:str_format",
],
language = "C++",
deps = [
"build",
"stack_tracer",
"//:config",
"//:exec_ctx",
"//:gpr",
"//:grpc_security_base",
"//:grpc_unsecure",
"//:httpcli",
"//:orphanable",
"//:ref_counted_ptr",
"//:uri_parser",
"//src/core:channel_args_endpoint_config",
"//src/core:channel_args_preconditioning",
"//src/core:closure",
"//src/core:error",
"//src/core:gpr_atm",
"//src/core:grpc_sockaddr",
"//src/core:iomgr_fwd",
"//src/core:iomgr_port",
"//src/core:resolved_address",
"//src/core:status_helper",
"//src/core:time",
"//test/core/event_engine:test_init",
],
alwayslink = 1,
)
grpc_cc_test(
name = "cmdline_test",
srcs = ["cmdline_test.cc"],
external_deps = ["gtest"],
language = "C++",
uses_event_engine = False,
uses_polling = False,
deps = [
"grpc_test_util",
"grpc_test_util_base",
"//:gpr",
"//src/core:useful",
],
)
grpc_cc_library(
name = "fuzzer_corpus_test",
testonly = 1,
srcs = ["fuzzer_corpus_test.cc"],
external_deps = [
"absl/flags:flag",
"gtest",
],
linkstatic = True,
tags = [
"no_windows",
"nofixdeps",
],
deps = [
":grpc_test_util",
"//:grpc",
"//test/cpp/util:test_config",
],
)
grpc_cc_test(
name = "histogram_test",
srcs = ["histogram_test.cc"],
external_deps = ["gtest"],
language = "C++",
tags = ["nofixdeps"],
uses_event_engine = False,
uses_polling = False,
deps = [
"grpc_test_util",
"grpc_test_util_base",
"//:gpr",
],
8 years ago
)
sh_library(
name = "fuzzer_one_entry_runner",
srcs = ["fuzzer_one_entry_runner.sh"],
)
grpc_cc_library(
name = "stack_tracer",
srcs = [
"stack_tracer.cc",
],
hdrs = [
"stack_tracer.h",
],
external_deps = [
"absl/debugging:stacktrace",
"absl/debugging:symbolize",
],
language = "C++",
deps = [
"//:gpr_platform",
"//src/core:examine_stack",
],
)
grpc_cc_test(
name = "stack_tracer_test",
srcs = [
"stack_tracer_test.cc",
],
external_deps = [
"absl/strings",
"gtest",
],
language = "C++",
# TODO(https://github.com/grpc/grpc/issues/24627): Disable this on Windows
tags = ["no_windows"],
uses_event_engine = False,
uses_polling = False,
deps = [
"grpc_test_util",
"stack_tracer",
"//:gpr",
],
)
grpc_cc_library(
name = "test_lb_policies",
testonly = 1,
srcs = ["test_lb_policies.cc"],
hdrs = ["test_lb_policies.h"],
external_deps = [
"absl/status",
"absl/status:statusor",
"absl/strings",
"absl/types:variant",
],
deps = [
"//:config",
"//:gpr",
"//:grpc",
"//:grpc_client_channel",
"//:orphanable",
[EventEngine] Modify iomgr to allow creation of event engine clients and client side endpoints (#31661) * [WIP] EventEngine iomgr endpoint shims * [WIP] EventEngine::Endpoint iomgr shims for the PosixEventEngine * Util functions to help with posix engine listener implementation * sanity * update comments in posix_engine_listener_utils.h * review comments * iwyu * revert prev commit * iwyu * update build * update * regenerate projects * regenerate projects * minor fixes * update BUILD * sanity * update build * regenerate projects * fix unused parameter * sanity * update * sanity * regenerate_projects * remove unused variable * start * update * regenerate_projects * sanity * update * fixes * update * regenerate_projects * update * fix sanity and msan failure * more fixes * build failure * update * fix * sanity * fixes * update * regenerate projects * fix sanity * review comments * An EventEngine subclass to be implemented by all posix based event engines * sanity * comments * update * review comments * re-word * fix * update * review comments * regenerate projects * syntax fix * add lock free event benchmark * releasable mutex lock * fix build isue * update * start * regenerate projects * update * fix * windows build * update * windows portability issue * update * update * update * update * format * update * update * update * update * update * fix sanity * regenerate projects * update * iwyu * Fix resolved address length related bugs in tcp_socket_utils and listener_utils * iwyu * cleanup src/core/lib/event_engine/tcp_socket_utils.cc * iwyu * fix * regenerate projects * fix sanity * re-write endpoint shim * more re-write * cleanup * update * review comments * build issue * more build issue fixes plus adding event_engine_trace * even more build issue fixes * iwyu * add static_cast * update * remove redundant code * update * deduplicate * iwyu * Fix review comments and regenerate_projects * sanity * review comments * fix include guards Co-authored-by: AJ Heller <hork@google.com>
2 years ago
"//:parse_address",
"//:ref_counted_ptr",
"//:server_address",
"//:uri_parser",
"//src/core:channel_args",
"//src/core:error",
"//src/core:grpc_backend_metric_data",
"//src/core:json",
"//src/core:json_util",
"//src/core:lb_policy",
"//src/core:lb_policy_factory",
"//src/core:lb_policy_registry",
"//src/core:pollset_set",
"//src/core:resolved_address",
"//src/core:status_helper",
"//src/core:subchannel_interface",
"//src/core:time",
],
)
grpc_cc_library(
name = "fake_udp_and_tcp_server",
srcs = ["fake_udp_and_tcp_server.cc"],
hdrs = ["fake_udp_and_tcp_server.h"],
external_deps = [
"absl/status:statusor",
"absl/strings",
],
language = "C++",
deps = [
"grpc_test_util",
"//:gpr",
"//:grpc",
"//:sockaddr_utils",
"//src/core:resolved_address",
],
)
grpc_cc_library(
name = "fake_udp_and_tcp_server_unsecure",
srcs = ["fake_udp_and_tcp_server.cc"],
hdrs = ["fake_udp_and_tcp_server.h"],
external_deps = [
"absl/status:statusor",
"absl/strings",
],
language = "C++",
deps = [
"grpc_test_util_unsecure",
"//:gpr",
"//:grpc",
"//:sockaddr_utils",
"//src/core:resolved_address",
],
)
grpc_cc_library(
name = "build",
srcs = ["build.cc"],
hdrs = ["build.h"],
)
xDS cluster resource type: use ValidationErrors and add unit test (#31025) * XdsBootstrap: move two more methods out of the interface * Automated change: Fix sanity tests * XdsClient: add unit test * Automated change: Fix sanity tests * fix memory leaks * add helper method * add unsubscription * add test for multiple subscriptions * clang-format * fix build * fix flakiness * add checking for other node fields * add v2 test * add response builder * add test for update from server * add test for update containing only changed resources * clang-format * fix build * add test for resource not existing upon subscription * add test for stream closed by server * add test for multiple watchers for the same resource * add test for connection failure * clang-format * add test for resources wrapped in Resource wrapper message * add test for resource validation failure * add test for multiple invalid resources, and fix a case in XdsClient * add test for validation failure for already-cached resource * add test for server not resending resources after stream disconnect * clang-format * fix XdsClient to report channel errors to newly started watchers * fix XdsClient to send cached errors/does-not-exists to newly started watchers * fix watcher to ensure events arrive in the expected order * fix tests * clang-format * add test for multiple resource types * fix xds_cluster_e2e_test * Automated change: Fix sanity tests * cleanup * add federation tests * clang-format * remove now-unnecessary XdsCertificateProviderPluginMapInterface * code review comments * simplify XdsResourceType::Decode() API * XdsClient: add unit tests for XdsClusterResourceType * add XdsClient with gRPC bootstrap config * add LB policy tests * started adding CertificateProvider tests * update for recent API changes * fix merge bugs * xDS resource validation: identify extensions by type_url instead of name * fix build * migrate to ValidationErrors * add xds_common_types_test * finish TLS tests and add LRS tests * move ScopedExperimentalEnvVar to its own library and remove redundant e2e tests * add circuit breaking and outlier detection tests * add validation to outlier detection LB policy parsing * clang-format * Automated change: Fix sanity tests * fix signedness * fix sanity * fix sanity * iwyu * update code for XdsResourceTypeImpl changes Co-authored-by: markdroth <markdroth@users.noreply.github.com>
2 years ago
grpc_cc_library(
name = "scoped_env_var",
testonly = True,
hdrs = ["scoped_env_var.h"],
deps = [
"//:gpr_platform",
"//src/core:env",
xDS cluster resource type: use ValidationErrors and add unit test (#31025) * XdsBootstrap: move two more methods out of the interface * Automated change: Fix sanity tests * XdsClient: add unit test * Automated change: Fix sanity tests * fix memory leaks * add helper method * add unsubscription * add test for multiple subscriptions * clang-format * fix build * fix flakiness * add checking for other node fields * add v2 test * add response builder * add test for update from server * add test for update containing only changed resources * clang-format * fix build * add test for resource not existing upon subscription * add test for stream closed by server * add test for multiple watchers for the same resource * add test for connection failure * clang-format * add test for resources wrapped in Resource wrapper message * add test for resource validation failure * add test for multiple invalid resources, and fix a case in XdsClient * add test for validation failure for already-cached resource * add test for server not resending resources after stream disconnect * clang-format * fix XdsClient to report channel errors to newly started watchers * fix XdsClient to send cached errors/does-not-exists to newly started watchers * fix watcher to ensure events arrive in the expected order * fix tests * clang-format * add test for multiple resource types * fix xds_cluster_e2e_test * Automated change: Fix sanity tests * cleanup * add federation tests * clang-format * remove now-unnecessary XdsCertificateProviderPluginMapInterface * code review comments * simplify XdsResourceType::Decode() API * XdsClient: add unit tests for XdsClusterResourceType * add XdsClient with gRPC bootstrap config * add LB policy tests * started adding CertificateProvider tests * update for recent API changes * fix merge bugs * xDS resource validation: identify extensions by type_url instead of name * fix build * migrate to ValidationErrors * add xds_common_types_test * finish TLS tests and add LRS tests * move ScopedExperimentalEnvVar to its own library and remove redundant e2e tests * add circuit breaking and outlier detection tests * add validation to outlier detection LB policy parsing * clang-format * Automated change: Fix sanity tests * fix signedness * fix sanity * fix sanity * iwyu * update code for XdsResourceTypeImpl changes Co-authored-by: markdroth <markdroth@users.noreply.github.com>
2 years ago
],
)
grpc_proto_library(
name = "fuzz_config_vars_proto",
srcs = ["fuzz_config_vars.proto"],
has_services = False,
)
grpc_cc_library(
name = "fuzz_config_vars",
srcs = ["fuzz_config_vars.cc"],
hdrs = ["fuzz_config_vars.h"],
external_deps = ["absl/types:optional"],
deps = [
"fuzz_config_vars_proto",
"//:config_vars",
"//:gpr_platform",
],
)