Skip to content

Commit

Permalink
[fuzzer] Convert chaotic-good frame_fuzzer to fuzztest (grpc#38599)
Browse files Browse the repository at this point in the history
Closes grpc#38599

COPYBARA_INTEGRATE_REVIEW=grpc#38599 from ctiller:frame 698c483
PiperOrigin-RevId: 720678154
  • Loading branch information
ctiller authored and copybara-github committed Jan 28, 2025
1 parent 79f2937 commit 4ef0173
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 18 deletions.
24 changes: 17 additions & 7 deletions test/core/transport/chaotic_good/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_package")
load("//test/core/test_util:grpc_fuzzer.bzl", "grpc_fuzz_test", "grpc_proto_fuzzer")
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_fuzz_test")

licenses(["notice"])

Expand Down Expand Up @@ -81,21 +81,31 @@ grpc_cc_test(
],
)

grpc_proto_fuzzer(
grpc_internal_proto_library(
name = "frame_fuzzer_proto",
srcs = ["frame_fuzzer.proto"],
)

grpc_cc_proto_library(
name = "frame_fuzzer_cc_proto",
deps = ["frame_fuzzer_proto"],
)

grpc_fuzz_test(
name = "frame_fuzzer",
srcs = ["frame_fuzzer.cc"],
corpus = "frame_fuzzer_corpus",
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/random:bit_gen_ref",
"absl/status:statusor",
"gtest",
"fuzztest",
"fuzztest_main",
],
proto = "frame_fuzzer.proto",
tags = ["no_windows"],
uses_event_engine = False,
uses_polling = False,
deps = [
"frame_fuzzer_cc_proto",
"//:exec_ctx",
"//:gpr",
"//:hpack_encoder",
Expand Down
9 changes: 2 additions & 7 deletions test/core/transport/chaotic_good/frame_fuzzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "absl/log/log.h"
#include "absl/random/bit_gen_ref.h"
#include "absl/status/statusor.h"
#include "fuzztest/fuzztest.h"
#include "src/core/ext/transport/chaotic_good/frame.h"
#include "src/core/ext/transport/chaotic_good/frame_header.h"
#include "src/core/lib/iomgr/exec_ctx.h"
Expand All @@ -32,12 +33,9 @@
#include "src/core/lib/slice/slice.h"
#include "src/core/lib/slice/slice_buffer.h"
#include "src/core/util/ref_counted_ptr.h"
#include "src/libfuzzer/libfuzzer_macro.h"
#include "test/core/promise/test_context.h"
#include "test/core/transport/chaotic_good/frame_fuzzer.pb.h"

bool squelch = false;

namespace grpc_core {
namespace chaotic_good {

Expand Down Expand Up @@ -105,10 +103,7 @@ void Run(const frame_fuzzer::Test& test) {
break;
}
}
FUZZ_TEST(FrameFuzzer, Run);

} // namespace chaotic_good
} // namespace grpc_core

DEFINE_PROTO_FUZZER(const frame_fuzzer::Test& test) {
grpc_core::chaotic_good::Run(test);
}

This file was deleted.

1 change: 0 additions & 1 deletion test/core/transport/chaotic_good/frame_fuzzer_corpus/empty

This file was deleted.

This file was deleted.

0 comments on commit 4ef0173

Please sign in to comment.