Skip to content

Commit

Permalink
Add client HTTP/2 fuzzer
Browse files Browse the repository at this point in the history
Signed-off-by: Yan Avlasov <yavlasov@google.com>
  • Loading branch information
yanavlasov committed Jun 30, 2023
1 parent 766b290 commit 1ba6c48
Show file tree
Hide file tree
Showing 7 changed files with 397 additions and 106 deletions.
1 change: 1 addition & 0 deletions test/common/http/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,7 @@ envoy_cc_fuzz_test(
"//source/common/stream_info:stream_info_lib",
"//source/common/upstream:upstream_includes",
"//source/common/upstream:upstream_lib",
"//test/common/http/http2:http2_frame",
"//test/common/upstream:utility_lib",
"//test/config:utility_lib",
"//test/fuzz:utility_lib",
Expand Down
401 changes: 298 additions & 103 deletions test/common/http/client_codec_diff_fuzz_test.cc

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/common/http/http2/http2_frame.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace Envoy {
namespace Http {
namespace Http2 {

const char Http2Frame::Preamble[25] = "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n";
const absl::string_view Http2Frame::Preamble("PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n");

void Http2Frame::setHeader(absl::string_view header) {
ASSERT(header.size() >= HeaderSize);
Expand Down
2 changes: 1 addition & 1 deletion test/common/http/http2/http2_frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class Http2Frame {
using ConstIterator = DataContainer::const_iterator;

static constexpr size_t HeaderSize = 9;
static const char Preamble[25];
static const absl::string_view Preamble;

enum class Type : uint8_t {
Data = 0,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/common/http/server_codec_diff_fuzz_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ class Http2HcmTest : public HcmTest {
}

for (const auto& header : input_.request().headers()) {
absl::string_view value = header.value();
std::string value = header.value();
if (input_.send_request_body() && header.key() == "content-length") {
value = std::to_string(request_body.size());
}
Expand Down

0 comments on commit 1ba6c48

Please sign in to comment.