-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…20234) * refactor(packet beat): Improve support for 100-continue * test(packetbeat): 100-continue only generate one event without error * test(packetbeat): 100-continue only generate one event without error * Update packetbeat/protos/http/http.go Co-authored-by: Adrian Serrano <[email protected]> * delete unused string * Fix format issue Co-authored-by: Marc Guasch <[email protected]> Co-authored-by: Adrian Serrano <[email protected]> (cherry picked from commit 41bc8c6) Co-authored-by: Bonsai <[email protected]>
- Loading branch information
Showing
4 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from packetbeat import BaseTest | ||
|
||
""" | ||
Tests for checking expect 100-continue only generate 1 event | ||
""" | ||
|
||
|
||
class Test(BaseTest): | ||
|
||
def test_http_100_continue(self): | ||
""" | ||
Should only generate one event | ||
""" | ||
self.render_config_template( | ||
iface_device="lo0", | ||
http_ports=["9200"], | ||
http_send_all_headers=True | ||
) | ||
self.run_packetbeat(pcap="http_100_continue.pcap") | ||
objs = self.read_output_json() | ||
|
||
assert len(objs) == 1 | ||
o = objs[0] | ||
|
||
assert o["type"] == "http" | ||
assert "request" in o["http"] | ||
assert "headers" in o["http"]["request"] | ||
assert o["http"]["request"]["headers"]["expect"] == "100-continue" | ||
|
||
assert "response" in o["http"] | ||
|
||
assert not "error" in o |