[fuzzing] Allow flow control fuzzer to fuzz across experiments (#33241)

<!--

If you know who should review your pull request, please assign it to
that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the
appropriate
lang label.

-->

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
pull/33253/head
Craig Tiller 2 years ago committed by GitHub
parent efebae82f0
commit c8f45f5b51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      test/core/transport/chttp2/BUILD
  2. 4
      test/core/transport/chttp2/flow_control_fuzzer.cc
  3. 3
      test/core/transport/chttp2/flow_control_fuzzer.proto

@ -50,12 +50,14 @@ grpc_proto_fuzzer(
corpus = "flow_control_fuzzer_corpus",
language = "C++",
proto = "flow_control_fuzzer.proto",
proto_deps = ["//test/core/util:fuzz_config_vars_proto"],
tags = ["no_windows"],
uses_event_engine = False,
uses_polling = False,
deps = [
"//:gpr",
"//src/core:chttp2_flow_control",
"//test/core/util:fuzz_config_vars",
],
)

@ -37,6 +37,7 @@
#include <grpc/support/time.h>
#include "src/core/ext/transport/chttp2/transport/flow_control.h"
#include "src/core/lib/experiments/config.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/time.h"
#include "src/core/lib/iomgr/exec_ctx.h"
@ -44,6 +45,7 @@
#include "src/core/lib/transport/bdp_estimator.h"
#include "src/libfuzzer/libfuzzer_macro.h"
#include "test/core/transport/chttp2/flow_control_fuzzer.pb.h"
#include "test/core/util/fuzz_config_vars.h"
// IWYU pragma: no_include <google/protobuf/repeated_ptr_field.h>
@ -442,6 +444,8 @@ void FlowControlFuzzer::AssertAnnouncedOverInitialWindowSizeCorrect() const {
} // namespace grpc_core
DEFINE_PROTO_FUZZER(const flow_control_fuzzer::Msg& msg) {
grpc_core::ApplyFuzzConfigVars(msg.config_vars());
grpc_core::TestOnlyReloadExperimentsFromConfigVariables();
grpc_core::chttp2::InitGlobals();
grpc_core::chttp2::FlowControlFuzzer fuzzer(msg.enable_bdp());
for (const auto& action : msg.actions()) {

@ -16,6 +16,8 @@ syntax = "proto3";
package flow_control_fuzzer;
import "test/core/util/fuzz_config_vars.proto";
message Empty {};
message StreamWrite {
@ -44,4 +46,5 @@ message Action {
message Msg {
bool enable_bdp = 1;
repeated Action actions = 2;
grpc.testing.FuzzConfigVars config_vars = 3;
}

Loading…
Cancel
Save