Skip to content

Commit

Permalink
fuzz: route lookup and header finalization fuzzer. (#4116)
Browse files Browse the repository at this point in the history
This was a pretty easy small test to add to gain coverage over all route resolution and header
finalization. Automatically generated corpus from //test/common/router:config_impl_test. To regenerate the corpus:

bazel run //test/common/router:config_impl_test \
     --test_env="ROUTE_CORPUS_PATH=$PWD/test/common/router/route_corpus"
Risk level: Low
Testing: Corpus coverage of 72.4% for config_impl.cc.

Signed-off-by: Harvey Tuch <htuch@google.com>
  • Loading branch information
htuch authored Aug 14, 2018
1 parent 5894673 commit 5a7152d
Show file tree
Hide file tree
Showing 7 changed files with 523 additions and 89 deletions.
24 changes: 24 additions & 0 deletions test/common/router/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ envoy_cc_test(
name = "config_impl_test",
srcs = ["config_impl_test.cc"],
deps = [
":route_fuzz_proto",
"//source/common/config:metadata_lib",
"//source/common/config:rds_json_lib",
"//source/common/http:header_map_lib",
"//source/common/http:headers_lib",
"//source/common/json:json_loader_lib",
"//source/common/router:config_lib",
"//source/extensions/filters/http/common:empty_http_filter_config_lib",
"//test/fuzz:utility_lib",
"//test/mocks/server:server_mocks",
"//test/test_common:environment_lib",
"//test/test_common:registry_lib",
Expand Down Expand Up @@ -83,6 +85,28 @@ envoy_cc_test(
],
)

envoy_proto_library(
name = "route_fuzz_proto",
srcs = ["route_fuzz.proto"],
generate_python = 0,
deps = [
"//test/fuzz:common_proto",
"@envoy_api//envoy/api/v2:rds_cc_proto",
],
)

envoy_cc_fuzz_test(
name = "route_fuzz_test",
srcs = ["route_fuzz_test.cc"],
corpus = "route_corpus",
deps = [
":route_fuzz_proto",
"//source/common/router:config_lib",
"//test/fuzz:utility_lib",
"//test/mocks/server:server_mocks",
],
)

envoy_cc_test(
name = "router_ratelimit_test",
srcs = ["router_ratelimit_test.cc"],
Expand Down
Loading

0 comments on commit 5a7152d

Please sign in to comment.