Skip to content

Commit

Permalink
[fuzzers] Convert xds_client_fuzzer to fuzztest (grpc#38593)
Browse files Browse the repository at this point in the history
Closes grpc#38593

COPYBARA_INTEGRATE_REVIEW=grpc#38593 from ctiller:xds 5a04b2c
PiperOrigin-RevId: 720985062
  • Loading branch information
ctiller authored and copybara-github committed Jan 29, 2025
1 parent 8a28fcc commit 7bf13ef
Show file tree
Hide file tree
Showing 12 changed files with 265 additions and 330 deletions.
39 changes: 29 additions & 10 deletions test/core/xds/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
load(
"//bazel:grpc_build_system.bzl",
"grpc_cc_library",
"grpc_cc_proto_library",
"grpc_cc_test",
"grpc_internal_proto_library",
"grpc_package",
)
load("//test/core/test_util:grpc_fuzzer.bzl", "grpc_proto_fuzzer")
load("//test/core/test_util:grpc_fuzzer.bzl", "grpc_fuzz_test")

grpc_package(name = "test/core/xds")

Expand Down Expand Up @@ -176,26 +178,42 @@ grpc_cc_test(
],
)

grpc_proto_fuzzer(
name = "xds_client_fuzzer",
srcs = ["xds_client_fuzzer.cc"],
corpus = "xds_client_corpora",
external_deps = ["absl/log:log"],
proto = "xds_client_fuzzer.proto",
proto_deps = [
grpc_internal_proto_library(
name = "xds_client_fuzzer_proto",
srcs = [
"xds_client_fuzzer.proto",
],
deps = [
"//test/core/event_engine/fuzzing_event_engine:fuzzing_event_engine_proto",
"@envoy_api//envoy/service/discovery/v3:pkg",
],
)

grpc_cc_proto_library(
name = "xds_client_fuzzer_cc_proto",
deps = [
"xds_client_fuzzer_proto",
],
)

grpc_fuzz_test(
name = "xds_client_fuzzer",
srcs = ["xds_client_fuzzer.cc"],
external_deps = [
"absl/log:log",
"fuzztest",
"fuzztest_main",
"gtest",
],
tags = ["no_windows"],
uses_event_engine = True,
uses_polling = False,
deps = [
":xds_client_test_peer",
":xds_transport_fake",
"//src/core:grpc_xds_client",
"//test/core/test_util:grpc_test_util",
"//test/core/event_engine/fuzzing_event_engine",
"//test/core/event_engine:event_engine_test_utils",
"xds_client_fuzzer_cc_proto",
# These proto deps are needed to ensure that we can read these
# resource types out of the google.protobuf.Any fields in the
# textproto files in the corpora.
Expand All @@ -205,6 +223,7 @@ grpc_proto_fuzzer(
"@envoy_api//envoy/config/route/v3:pkg_cc_proto",
"@envoy_api//envoy/extensions/filters/http/router/v3:pkg_cc_proto",
"@envoy_api//envoy/extensions/filters/network/http_connection_manager/v3:pkg_cc_proto",
"@envoy_api//envoy/service/discovery/v3:pkg_cc_proto",
],
)

Expand Down
26 changes: 0 additions & 26 deletions test/core/xds/xds_client_corpora/assert_entry_is_null

This file was deleted.

41 changes: 0 additions & 41 deletions test/core/xds/xds_client_corpora/basic_cluster

This file was deleted.

57 changes: 0 additions & 57 deletions test/core/xds/xds_client_corpora/basic_endpoint

This file was deleted.

50 changes: 0 additions & 50 deletions test/core/xds/xds_client_corpora/basic_listener

This file was deleted.

45 changes: 0 additions & 45 deletions test/core/xds/xds_client_corpora/basic_route_config

This file was deleted.

10 changes: 0 additions & 10 deletions test/core/xds/xds_client_corpora/bootstrap_xds_servers_empty

This file was deleted.

This file was deleted.

26 changes: 0 additions & 26 deletions test/core/xds/xds_client_corpora/resource_wrapper_empty

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 7bf13ef

Please sign in to comment.