1# Copyright 2016 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 15load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_package", "grpc_proto_library") 16load("//test/core/util:grpc_fuzzer.bzl", "grpc_proto_fuzzer") 17 18grpc_package(name = "test/core/end2end/fuzzers") 19 20licenses(["notice"]) 21 22grpc_proto_library( 23 name = "api_fuzzer_proto", 24 srcs = ["api_fuzzer.proto"], 25 has_services = False, 26 deps = [ 27 "//test/core/event_engine/fuzzing_event_engine:fuzzing_event_engine_proto", 28 "//test/core/util:fuzz_config_vars_proto", 29 "//test/core/util:fuzzing_channel_args_proto", 30 ], 31) 32 33grpc_cc_library( 34 name = "fuzzing_common", 35 srcs = ["fuzzing_common.cc"], 36 hdrs = ["fuzzing_common.h"], 37 external_deps = ["absl/strings"], 38 deps = [ 39 "api_fuzzer_proto", 40 "//:gpr", 41 "//:grpc", 42 "//test/core/event_engine/fuzzing_event_engine", 43 ], 44) 45 46grpc_proto_fuzzer( 47 name = "api_fuzzer", 48 srcs = ["api_fuzzer.cc"], 49 corpus = "api_fuzzer_corpus", 50 language = "C++", 51 proto = None, 52 tags = [ 53 "no_mac", 54 "no_windows", 55 ], 56 uses_event_engine = False, 57 uses_polling = False, 58 deps = [ 59 "api_fuzzer_proto", 60 "fuzzing_common", 61 "//:gpr", 62 "//:grpc", 63 "//src/core:channel_args", 64 "//src/core:closure", 65 "//src/core:slice", 66 "//test/core/end2end:ssl_test_data", 67 "//test/core/event_engine/fuzzing_event_engine", 68 "//test/core/util:fuzz_config_vars", 69 "//test/core/util:fuzzing_channel_args", 70 "//test/core/util:grpc_test_util", 71 "//test/core/util:grpc_test_util_base", 72 ], 73) 74 75grpc_proto_library( 76 name = "fuzzer_input_proto", 77 srcs = ["fuzzer_input.proto"], 78 has_services = False, 79 deps = [ 80 "api_fuzzer_proto", 81 "//test/core/event_engine/fuzzing_event_engine:fuzzing_event_engine_proto", 82 "//test/core/util:fuzz_config_vars_proto", 83 "//test/core/util:fuzzing_channel_args_proto", 84 ], 85) 86 87grpc_cc_library( 88 name = "network_input", 89 srcs = ["network_input.cc"], 90 hdrs = ["network_input.h"], 91 deps = [ 92 "fuzzer_input_proto", 93 "//:chttp2_frame", 94 "//src/core:chaotic_good_frame_header", 95 "//test/core/event_engine/fuzzing_event_engine", 96 "//test/core/util:fuzzing_channel_args", 97 "//test/core/util:grpc_test_util_base", 98 ], 99) 100 101grpc_proto_fuzzer( 102 name = "client_fuzzer", 103 srcs = ["client_fuzzer.cc"], 104 corpus = "client_fuzzer_corpus", 105 language = "C++", 106 proto = None, 107 tags = ["no_windows"], 108 uses_event_engine = False, 109 uses_polling = False, 110 deps = [ 111 "fuzzer_input_proto", 112 "fuzzing_common", 113 "network_input", 114 "//:gpr", 115 "//:grpc", 116 "//src/core:channel_args", 117 "//test/core/event_engine/fuzzing_event_engine", 118 "//test/core/util:fuzz_config_vars", 119 "//test/core/util:grpc_test_util", 120 "//test/core/util:grpc_test_util_base", 121 ], 122) 123 124grpc_cc_library( 125 name = "server_fuzzer", 126 srcs = ["server_fuzzer.cc"], 127 hdrs = ["server_fuzzer.h"], 128 deps = [ 129 "fuzzer_input_proto", 130 "fuzzing_common", 131 "network_input", 132 "//:gpr", 133 "//:grpc", 134 "//src/core:channel_args", 135 "//test/core/event_engine/fuzzing_event_engine", 136 "//test/core/util:fuzz_config_vars", 137 "//test/core/util:grpc_test_util", 138 "//test/core/util:grpc_test_util_base", 139 ], 140) 141 142grpc_proto_fuzzer( 143 name = "server_fuzzer_chttp2", 144 srcs = ["server_fuzzer_chttp2.cc"], 145 corpus = "server_fuzzer_chttp2_corpus", 146 language = "C++", 147 proto = None, 148 tags = [ 149 "no_mac", 150 "no_windows", 151 ], 152 uses_event_engine = False, 153 uses_polling = False, 154 deps = [ 155 ":server_fuzzer", 156 "//:grpc", 157 ], 158) 159 160grpc_proto_fuzzer( 161 name = "server_fuzzer_chaotic_good", 162 srcs = ["server_fuzzer_chaotic_good.cc"], 163 corpus = "server_fuzzer_chaotic_good_corpus", 164 language = "C++", 165 proto = None, 166 tags = [ 167 "no_mac", 168 "no_windows", 169 ], 170 uses_event_engine = False, 171 uses_polling = False, 172 deps = [ 173 ":server_fuzzer", 174 "//src/core:chaotic_good_server", 175 ], 176) 177