diff options
author | Dániel Bakai <bakaidl@gmail.com> | 2019-04-10 12:52:52 +0200 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2019-04-22 15:24:46 +0000 |
commit | 9ce60b173bf17b7d20695d9dc1de050989019664 (patch) | |
tree | 95ec8b8554415ef2c80d6d9950cc9201c8d22c94 /test/suite_dissection.py | |
parent | 51ac1047a7e434a0b2e264780b2fa31f1d986898 (diff) |
Add brotli decompression support for HTTP and HTTP2 dissectors.
Change-Id: I9c09f55673187f6fee723fcd72798fb6b9958b03
Reviewed-on: https://code.wireshark.org/review/32745
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'test/suite_dissection.py')
-rw-r--r-- | test/suite_dissection.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/suite_dissection.py b/test/suite_dissection.py index 9a62e933cc..c9234245cc 100644 --- a/test/suite_dissection.py +++ b/test/suite_dissection.py @@ -16,6 +16,20 @@ import fixtures @fixtures.mark_usefixtures('test_env') @fixtures.uses_fixtures +class case_dissect_http(subprocesstest.SubprocessTestCase): + def test_http_brotli_decompression(self, cmd_tshark, features, dirs, capture_file): + '''HTTP brotli decompression''' + if not features.have_brotli: + self.skipTest('Requires brotli.') + self.assertRun((cmd_tshark, + '-r', capture_file('http-brotli.pcapng'), + '-Y', 'http.response.code==200', + '-Tfields', '-etext', + )) + self.assertTrue(self.grepOutput('This is a test file for testing brotli decompression in Wireshark')) + +@fixtures.mark_usefixtures('test_env') +@fixtures.uses_fixtures class case_dissect_http2(subprocesstest.SubprocessTestCase): def test_http2_data_reassembly(self, cmd_tshark, features, dirs, capture_file): '''HTTP2 data reassembly''' @@ -30,6 +44,18 @@ class case_dissect_http2(subprocesstest.SubprocessTestCase): )) self.assertTrue(self.grepOutput('DATA')) + def test_http2_brotli_decompression(self, cmd_tshark, features, dirs, capture_file): + '''HTTP2 brotli decompression''' + if not features.have_nghttp2: + self.skipTest('Requires nghttp2.') + if not features.have_brotli: + self.skipTest('Requires brotli.') + self.assertRun((cmd_tshark, + '-r', capture_file('http2-brotli.pcapng'), + '-Y', 'http2.data.data matches "This is a test file for testing brotli decompression in Wireshark"', + )) + self.assertTrue(self.grepOutput('DATA')) + @fixtures.mark_usefixtures('test_env') @fixtures.uses_fixtures class case_dissect_tcp(subprocesstest.SubprocessTestCase): |