Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
ctiller committed Jan 30, 2025
1 parent 802d0e5 commit 5520380
Show file tree
Hide file tree
Showing 21 changed files with 30 additions and 48 deletions.
1 change: 1 addition & 0 deletions test/core/call/yodel/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ grpc_cc_library(
"//test/core/event_engine/fuzzing_event_engine",
"//test/core/test_util:fuzz_config_vars",
"//test/core/test_util:grpc_test_util",
"//test/core/test_util:fuzz_config_vars_helpers",
"//test/core/test_util:proto_bit_gen",
],
)
Expand Down
1 change: 1 addition & 0 deletions test/core/call/yodel/yodel_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "test/core/call/yodel/fuzzer.pb.h"
#include "test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.h"
#include "test/core/test_util/fuzz_config_vars.h"
#include "test/core/test_util/fuzz_config_vars_helpers.h"
#include "test/core/test_util/proto_bit_gen.h"
#include "test/core/test_util/test_config.h"

Expand Down
4 changes: 2 additions & 2 deletions test/core/end2end/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@ grpc_cc_library(
"//test/core/call:batch_builder",
"//test/core/event_engine:event_engine_test_utils",
"//test/core/event_engine/fuzzing_event_engine",
"//test/core/test_util:fuzz_config_vars",
"//test/core/test_util:grpc_test_util",
],
"//test/core/test_util:fuzz_config_vars",
] + (["//test/core/test_util:fuzz_config_vars_helpers"] if fuzz else []),
alwayslink = 1,
)
for (fuzz, gtest) in [
Expand Down
1 change: 0 additions & 1 deletion test/core/end2end/end2end_tests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include "src/core/util/no_destruct.h"
#include "test/core/end2end/cq_verifier.h"
#include "test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.h"
#include "test/core/test_util/fuzz_config_vars.h"

using grpc_event_engine::experimental::EventEngine;
using grpc_event_engine::experimental::FuzzingEventEngine;
Expand Down
1 change: 1 addition & 0 deletions test/core/end2end/end2end_tests.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@

#ifdef GRPC_END2END_TEST_INCLUDE_FUZZER
#include "fuzztest/fuzztest.h"
#include "test/core/test_util/fuzz_config_vars_helpers.h"
#endif

#define CA_CERT_PATH "src/core/tsi/test_creds/ca.pem"
Expand Down
4 changes: 4 additions & 0 deletions test/core/end2end/fuzzers/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ grpc_fuzz_test(
"//test/core/end2end:ssl_test_data",
"//test/core/event_engine/fuzzing_event_engine",
"//test/core/test_util:fuzz_config_vars",
"//test/core/test_util:fuzz_config_vars_helpers",
"//test/core/test_util:fuzzing_channel_args",
"//test/core/test_util:grpc_test_util",
"//test/core/test_util:grpc_test_util_base",
Expand Down Expand Up @@ -130,6 +131,7 @@ grpc_fuzz_test(
"//src/core:channel_args",
"//test/core/event_engine/fuzzing_event_engine",
"//test/core/test_util:fuzz_config_vars",
"//test/core/test_util:fuzz_config_vars_helpers",
"//test/core/test_util:grpc_test_util",
"//test/core/test_util:grpc_test_util_base",
],
Expand All @@ -154,6 +156,7 @@ grpc_fuzz_test(
"//src/core:chaotic_good_server",
"//test/core/event_engine/fuzzing_event_engine",
"//test/core/test_util:fuzz_config_vars",
"//test/core/test_util:fuzz_config_vars_helpers",
"//test/core/test_util:grpc_test_util",
"//test/core/test_util:grpc_test_util_base",
],
Expand All @@ -177,6 +180,7 @@ grpc_fuzz_test(
"//src/core:channel_args",
"//test/core/event_engine/fuzzing_event_engine",
"//test/core/test_util:fuzz_config_vars",
"//test/core/test_util:fuzz_config_vars_helpers",
"//test/core/test_util:grpc_test_util",
"//test/core/test_util:grpc_test_util_base",
],
Expand Down
1 change: 1 addition & 0 deletions test/core/end2end/fuzzers/api_fuzzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
#include "test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.h"
#include "test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.pb.h"
#include "test/core/test_util/fuzz_config_vars.h"
#include "test/core/test_util/fuzz_config_vars_helpers.h"
#include "test/core/test_util/fuzzing_channel_args.h"
#include "test/core/test_util/test_config.h"

Expand Down
1 change: 1 addition & 0 deletions test/core/end2end/fuzzers/client_fuzzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include "test/core/end2end/fuzzers/fuzzing_common.h"
#include "test/core/end2end/fuzzers/network_input.h"
#include "test/core/test_util/fuzz_config_vars.h"
#include "test/core/test_util/fuzz_config_vars_helpers.h"
#include "test/core/test_util/mock_endpoint.h"
#include "test/core/test_util/test_config.h"

Expand Down
1 change: 1 addition & 0 deletions test/core/end2end/fuzzers/server_fuzzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "test/core/end2end/fuzzers/fuzzing_common.h"
#include "test/core/end2end/fuzzers/network_input.h"
#include "test/core/test_util/fuzz_config_vars.h"
#include "test/core/test_util/fuzz_config_vars_helpers.h"
#include "test/core/test_util/test_config.h"

namespace grpc_core {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ grpc_fuzz_test(
"//test/core/event_engine:aborting_event_engine",
"//test/core/event_engine/fuzzing_event_engine",
"//test/core/test_util:fuzz_config_vars",
"//test/core/test_util:fuzz_config_vars_helpers",
"//test/core/test_util:fuzzing_channel_args",
"//test/core/test_util:grpc_test_util",
"//test/core/test_util:grpc_test_util_base",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include "test/core/event_engine/util/aborting_event_engine.h"
#include "test/core/ext/filters/event_engine_client_channel_resolver/resolver_fuzzer.pb.h"
#include "test/core/test_util/fuzz_config_vars.h"
#include "test/core/test_util/fuzz_config_vars_helpers.h"
#include "test/core/test_util/fuzzing_channel_args.h"
#include "test/core/test_util/test_config.h"

Expand Down
1 change: 1 addition & 0 deletions test/core/resource_quota/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ grpc_fuzz_test(
"//src/core:memory_quota",
"//src/core:useful",
"//test/core/test_util:fuzz_config_vars",
"//test/core/test_util:fuzz_config_vars_helpers",
"//test/core/test_util:grpc_test_util",
],
)
Expand Down
1 change: 1 addition & 0 deletions test/core/resource_quota/memory_quota_fuzzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include "test/core/resource_quota/call_checker.h"
#include "test/core/resource_quota/memory_quota_fuzzer.pb.h"
#include "test/core/test_util/fuzz_config_vars.h"
#include "test/core/test_util/fuzz_config_vars_helpers.h"
#include "test/core/test_util/test_config.h"

namespace grpc_core {
Expand Down
1 change: 0 additions & 1 deletion test/core/test_util/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,6 @@ grpc_cc_library(
],
deps = [
"fuzz_config_vars_cc_proto",
"fuzz_config_vars_helpers",
"//:config_vars",
"//:gpr_platform",
],
Expand Down
8 changes: 3 additions & 5 deletions test/core/test_util/fuzz_config_vars.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,16 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//
// Automatically generated by tools/codegen/core/gen_config_vars.py
//

#ifndef GRPC_TEST_CORE_TEST_UTIL_FUZZ_CONFIG_VARS_H
#define GRPC_TEST_CORE_TEST_UTIL_FUZZ_CONFIG_VARS_H

// See fuzz_config_vars_helpers.h for a fuzztest domain that quickly
// finds interesting and legal configs.

#include <grpc/support/port_platform.h>

#include "src/core/config/config_vars.h"
#include "test/core/test_util/fuzz_config_vars.pb.h"
#include "test/core/test_util/fuzz_config_vars_helpers.h"

namespace grpc_core {

Expand Down
5 changes: 5 additions & 0 deletions test/core/test_util/fuzz_config_vars_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
#ifndef GRPC_TEST_CORE_TEST_UTIL_FUZZ_CONFIG_VARS_HELPERS_H
#define GRPC_TEST_CORE_TEST_UTIL_FUZZ_CONFIG_VARS_HELPERS_H

// We can't currently compile fuzztest for Windows, so we separate
// this code from the code to read the protobufs - allowing the latter
// to also be used in regression tests that do run on Windows, and
// reserving this code only for the actual fuzzers.

#include <grpc/support/port_platform.h>
#include <stdint.h>

Expand Down
3 changes: 3 additions & 0 deletions test/core/transport/chttp2/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ grpc_fuzz_test(
"hpack_parser_fuzzer_cc_proto",
"//:grpc",
"//test/core/test_util:fuzz_config_vars",
"//test/core/test_util:fuzz_config_vars_helpers",
"//test/core/test_util:grpc_test_util",
"//test/core/test_util:proto_bit_gen",
],
Expand Down Expand Up @@ -73,6 +74,7 @@ grpc_fuzz_test(
"hpack_sync_fuzzer_cc_proto",
"//:grpc",
"//test/core/test_util:fuzz_config_vars",
"//test/core/test_util:fuzz_config_vars_helpers",
"//test/core/test_util:grpc_test_util",
"//test/core/test_util:proto_bit_gen",
],
Expand Down Expand Up @@ -103,6 +105,7 @@ grpc_fuzz_test(
"//:gpr",
"//src/core:chttp2_flow_control",
"//test/core/test_util:fuzz_config_vars",
"//test/core/test_util:fuzz_config_vars_helpers",
],
)

Expand Down
1 change: 1 addition & 0 deletions test/core/transport/chttp2/flow_control_fuzzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include "src/core/util/time.h"
#include "src/core/util/useful.h"
#include "test/core/test_util/fuzz_config_vars.h"
#include "test/core/test_util/fuzz_config_vars_helpers.h"
#include "test/core/transport/chttp2/flow_control_fuzzer.pb.h"

// IWYU pragma: no_include <google/protobuf/repeated_ptr_field.h>
Expand Down
1 change: 1 addition & 0 deletions test/core/transport/chttp2/hpack_parser_fuzzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include "src/core/util/ref_counted_ptr.h"
#include "src/core/util/status_helper.h"
#include "test/core/test_util/fuzz_config_vars.h"
#include "test/core/test_util/fuzz_config_vars_helpers.h"
#include "test/core/test_util/proto_bit_gen.h"
#include "test/core/test_util/test_config.h"
#include "test/core/transport/chttp2/hpack_parser_fuzzer.pb.h"
Expand Down
1 change: 1 addition & 0 deletions test/core/transport/chttp2/hpack_sync_fuzzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include "src/core/util/ref_counted_ptr.h"
#include "src/core/util/status_helper.h"
#include "test/core/test_util/fuzz_config_vars.h"
#include "test/core/test_util/fuzz_config_vars_helpers.h"
#include "test/core/test_util/proto_bit_gen.h"
#include "test/core/test_util/test_config.h"
#include "test/core/transport/chttp2/hpack_sync_fuzzer.pb.h"
Expand Down
39 changes: 0 additions & 39 deletions tools/codegen/core/gen_config_vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,45 +209,6 @@ def string_default_value(x, name):
)
print("};", file=P)

with open("test/core/test_util/fuzz_config_vars.h", "w") as H:
put_copyright(H)

put_banner(
[H],
[
"",
"Automatically generated by tools/codegen/core/gen_config_vars.py",
"",
],
)

print("#ifndef GRPC_TEST_CORE_TEST_UTIL_FUZZ_CONFIG_VARS_H", file=H)
print("#define GRPC_TEST_CORE_TEST_UTIL_FUZZ_CONFIG_VARS_H", file=H)
print(file=H)
print("#include <grpc/support/port_platform.h>", file=H)
print(file=H)
print('#include "test/core/test_util/fuzz_config_vars.pb.h"', file=H)
print('#include "src/core/config/config_vars.h"', file=H)
print('#include "test/core/test_util/fuzz_config_vars_helpers.h"', file=H)
print(file=H)
print("namespace grpc_core {", file=H)
print(file=H)
print(
(
"ConfigVars::Overrides OverridesFromFuzzConfigVars(const"
" grpc::testing::FuzzConfigVars& vars);"
),
file=H,
)
print(
"void ApplyFuzzConfigVars(const grpc::testing::FuzzConfigVars& vars);",
file=H,
)
print(file=H)
print("} // namespace grpc_core", file=H)
print(file=H)
print("#endif // GRPC_TEST_CORE_TEST_UTIL_FUZZ_CONFIG_VARS_H", file=H)

with open("test/core/test_util/fuzz_config_vars.cc", "w") as C:
put_copyright(C)

Expand Down

0 comments on commit 5520380

Please sign in to comment.