Skip to content

Commit

Permalink
Added test for binary encoding in thrift
Browse files Browse the repository at this point in the history
  • Loading branch information
Tudor Golubenco committed Dec 4, 2014
1 parent aa9eda6 commit e57ce90
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/packetbeat
Submodule packetbeat updated from ee6b14 to 3e1835
Binary file added tests/pcaps/thrift_echo_binary.pcap
Binary file not shown.
17 changes: 17 additions & 0 deletions tests/test_0002_thrift_basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,3 +187,20 @@ def test_thrift_send_request_response(self):

assert all([o["request_raw"] == "" for o in objs])
assert all([o["response_raw"] == "" for o in objs])

def test_thrift_binary(self):
self.render_config_template(
thrift_ports=[9090],
thrift_transport_type="framed",
thrift_idl_files=["tutorial.thrift", "shared.thrift"]
)
self.copy_files(["tutorial.thrift", "shared.thrift"])
self.run_packetbeat(pcap="thrift_echo_binary.pcap",
debug_selectors=["thrift"])

objs = self.read_output()
assert len(objs) == 1
o = objs[0]

assert o["thrift"]["request"]["method"] == "echo_binary"
assert o["thrift"]["reply"]["returnValue"] == "ab0c1d281a000000"

0 comments on commit e57ce90

Please sign in to comment.