Skip to content

fuzz: improve fuzz performance for accesslog and route #8397

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 4, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions test/common/router/route_fuzz_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ cleanRouteConfig(envoy::api::v2::RouteConfiguration route_config) {
// headers.
envoy::api::v2::RouteConfiguration clean_config =
replaceInvalidHeaders<envoy::api::v2::RouteConfiguration>(route_config);
// Replace invalid characters from
auto internal_only_headers = clean_config.mutable_internal_only_headers();
std::for_each(internal_only_headers->begin(), internal_only_headers->end(),
[](std::string& n) { n = Fuzz::replaceInvalidCharacters(n); });
Expand Down Expand Up @@ -69,9 +68,9 @@ cleanRouteConfig(envoy::api::v2::RouteConfiguration route_config) {

// TODO(htuch): figure out how to generate via a genrule from config_impl_test the full corpus.
DEFINE_PROTO_FUZZER(const test::common::router::RouteTestCase& input) {
static NiceMock<Envoy::StreamInfo::MockStreamInfo> stream_info;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

static NiceMock<Server::Configuration::MockFactoryContext> factory_context;
try {
NiceMock<Envoy::StreamInfo::MockStreamInfo> stream_info;
NiceMock<Server::Configuration::MockFactoryContext> factory_context;
TestUtility::validate(input.config());
ConfigImpl config(cleanRouteConfig(input.config()), factory_context, true);
Http::TestHeaderMapImpl headers = Fuzz::fromHeaders(input.headers());
Expand Down