• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_cc_proto_library", "grpc_internal_proto_library", "grpc_package")
16load("//test/core/test_util:grpc_fuzzer.bzl", "grpc_proto_fuzzer")
17
18grpc_package(name = "test/core/end2end/fuzzers")
19
20licenses(["notice"])
21
22grpc_internal_proto_library(
23    name = "api_fuzzer_proto",
24    srcs = ["api_fuzzer.proto"],
25    deps = [
26        "//test/core/event_engine/fuzzing_event_engine:fuzzing_event_engine_proto",
27        "//test/core/test_util:fuzz_config_vars_proto",
28        "//test/core/test_util:fuzzing_channel_args_proto",
29    ],
30)
31
32grpc_cc_proto_library(
33    name = "api_fuzzer_cc_proto",
34    deps = ["api_fuzzer_proto"],
35)
36
37grpc_cc_library(
38    name = "fuzzing_common",
39    srcs = ["fuzzing_common.cc"],
40    hdrs = ["fuzzing_common.h"],
41    external_deps = [
42        "absl/log:check",
43        "absl/log:log",
44        "absl/strings",
45    ],
46    deps = [
47        "api_fuzzer_cc_proto",
48        "//:gpr",
49        "//:grpc",
50        "//test/core/event_engine/fuzzing_event_engine",
51    ],
52)
53
54grpc_proto_fuzzer(
55    name = "api_fuzzer",
56    srcs = ["api_fuzzer.cc"],
57    corpus = "api_fuzzer_corpus",
58    end2end_fuzzer = True,
59    external_deps = ["absl/log:check"],
60    language = "C++",
61    proto = None,
62    tags = [
63        "no_mac",
64        "no_windows",
65    ],
66    uses_event_engine = False,
67    uses_polling = False,
68    deps = [
69        "api_fuzzer_cc_proto",
70        "fuzzing_common",
71        "//:gpr",
72        "//:grpc",
73        "//src/core:channel_args",
74        "//src/core:closure",
75        "//src/core:slice",
76        "//test/core/end2end:ssl_test_data",
77        "//test/core/event_engine/fuzzing_event_engine",
78        "//test/core/test_util:fuzz_config_vars",
79        "//test/core/test_util:fuzzing_channel_args",
80        "//test/core/test_util:grpc_test_util",
81        "//test/core/test_util:grpc_test_util_base",
82    ],
83)
84
85grpc_internal_proto_library(
86    name = "fuzzer_input_proto",
87    srcs = ["fuzzer_input.proto"],
88    deps = [
89        "api_fuzzer_proto",
90        "//src/core:chaotic_good_frame_proto",
91        "//test/core/event_engine/fuzzing_event_engine:fuzzing_event_engine_proto",
92        "//test/core/test_util:fuzz_config_vars_proto",
93        "//test/core/test_util:fuzzing_channel_args_proto",
94    ],
95)
96
97grpc_cc_proto_library(
98    name = "fuzzer_input_cc_proto",
99    deps = ["fuzzer_input_proto"],
100)
101
102grpc_cc_library(
103    name = "network_input",
104    srcs = ["network_input.cc"],
105    hdrs = ["network_input.h"],
106    external_deps = ["absl/log:log"],
107    deps = [
108        "fuzzer_input_cc_proto",
109        "//:chttp2_frame",
110        "//src/core:chaotic_good_frame_header",
111        "//test/core/event_engine/fuzzing_event_engine",
112        "//test/core/test_util:fuzzing_channel_args",
113        "//test/core/test_util:grpc_test_util_base",
114    ],
115)
116
117grpc_proto_fuzzer(
118    name = "client_fuzzer",
119    srcs = ["client_fuzzer.cc"],
120    corpus = "client_fuzzer_corpus",
121    end2end_fuzzer = True,
122    external_deps = ["absl/log:check"],
123    language = "C++",
124    proto = None,
125    tags = ["no_windows"],
126    uses_event_engine = False,
127    uses_polling = False,
128    deps = [
129        "fuzzer_input_cc_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/test_util:fuzz_config_vars",
137        "//test/core/test_util:grpc_test_util",
138        "//test/core/test_util:grpc_test_util_base",
139    ],
140)
141
142grpc_cc_library(
143    name = "server_fuzzer",
144    srcs = ["server_fuzzer.cc"],
145    hdrs = ["server_fuzzer.h"],
146    external_deps = ["absl/log:check"],
147    deps = [
148        "fuzzer_input_cc_proto",
149        "fuzzing_common",
150        "network_input",
151        "//:gpr",
152        "//:grpc",
153        "//src/core:channel_args",
154        "//test/core/event_engine/fuzzing_event_engine",
155        "//test/core/test_util:fuzz_config_vars",
156        "//test/core/test_util:grpc_test_util",
157        "//test/core/test_util:grpc_test_util_base",
158    ],
159)
160
161grpc_proto_fuzzer(
162    name = "server_fuzzer_chttp2",
163    srcs = ["server_fuzzer_chttp2.cc"],
164    corpus = "server_fuzzer_chttp2_corpus",
165    end2end_fuzzer = True,
166    language = "C++",
167    proto = None,
168    tags = [
169        "no_mac",
170        "no_windows",
171    ],
172    uses_event_engine = False,
173    uses_polling = False,
174    deps = [
175        ":server_fuzzer",
176        "//:grpc",
177    ],
178)
179
180grpc_proto_fuzzer(
181    name = "server_fuzzer_chttp2_fake_creds",
182    srcs = ["server_fuzzer_chttp2_fake_creds.cc"],
183    corpus = "server_fuzzer_chttp2_fake_creds_corpus",
184    end2end_fuzzer = True,
185    language = "C++",
186    proto = None,
187    tags = [
188        "no_mac",
189        "no_windows",
190    ],
191    uses_event_engine = False,
192    uses_polling = False,
193    deps = [
194        ":server_fuzzer",
195        "//:grpc",
196    ],
197)
198
199grpc_proto_fuzzer(
200    name = "server_fuzzer_chaotic_good",
201    srcs = ["server_fuzzer_chaotic_good.cc"],
202    corpus = "server_fuzzer_chaotic_good_corpus",
203    end2end_fuzzer = True,
204    external_deps = ["absl/log:check"],
205    language = "C++",
206    proto = None,
207    tags = [
208        "no_mac",
209        "no_windows",
210    ],
211    uses_event_engine = False,
212    uses_polling = False,
213    deps = [
214        ":server_fuzzer",
215        "//src/core:chaotic_good_server",
216    ],
217)
218
219grpc_cc_library(
220    name = "connector_fuzzer",
221    srcs = ["connector_fuzzer.cc"],
222    hdrs = ["connector_fuzzer.h"],
223    external_deps = ["absl/log:check"],
224    deps = [
225        "fuzzer_input_cc_proto",
226        "fuzzing_common",
227        "network_input",
228        "//:gpr",
229        "//:grpc",
230        "//src/core:channel_args",
231        "//test/core/event_engine/fuzzing_event_engine",
232        "//test/core/test_util:fuzz_config_vars",
233        "//test/core/test_util:grpc_test_util",
234        "//test/core/test_util:grpc_test_util_base",
235    ],
236)
237
238grpc_proto_fuzzer(
239    name = "connector_fuzzer_chttp2",
240    srcs = ["connector_fuzzer_chttp2.cc"],
241    corpus = "connector_fuzzer_chttp2_corpus",
242    end2end_fuzzer = True,
243    language = "C++",
244    proto = None,
245    tags = [
246        "no_mac",
247        "no_windows",
248    ],
249    uses_event_engine = False,
250    uses_polling = False,
251    deps = [
252        ":connector_fuzzer",
253        "//:grpc",
254    ],
255)
256
257grpc_proto_fuzzer(
258    name = "connector_fuzzer_chttp2_fakesec",
259    srcs = ["connector_fuzzer_chttp2_fakesec.cc"],
260    corpus = "connector_fuzzer_chttp2_fakesec_corpus",
261    end2end_fuzzer = True,
262    language = "C++",
263    proto = None,
264    tags = [
265        "no_mac",
266        "no_windows",
267    ],
268    uses_event_engine = False,
269    uses_polling = False,
270    deps = [
271        ":connector_fuzzer",
272        "//:grpc",
273    ],
274)
275