diff options
author | Aurelien Aptel <aaptel@suse.com> | 2020-09-23 01:05:39 +0200 |
---|---|---|
committer | Ronnie Sahlberg <ronniesahlberg@gmail.com> | 2020-09-26 02:23:23 +0000 |
commit | c5926c51e79c9b3b620b9116ab7929afce97d18b (patch) | |
tree | 6e64bcf1d30c3169654a765177a0a7a3349ff8c5 /test | |
parent | 3d94644dc8e9dbe7c407bf626f6de3865b1e2762 (diff) |
SMB2: add tests for chained compression and pattern_v1
Diffstat (limited to 'test')
-rw-r--r-- | test/captures/smb311-chained-patternv1-lznt1.pcapng.gz | bin | 0 -> 717 bytes | |||
-rw-r--r-- | test/suite_dissection.py | 16 |
2 files changed, 16 insertions, 0 deletions
diff --git a/test/captures/smb311-chained-patternv1-lznt1.pcapng.gz b/test/captures/smb311-chained-patternv1-lznt1.pcapng.gz Binary files differnew file mode 100644 index 0000000000..92e5a0446e --- /dev/null +++ b/test/captures/smb311-chained-patternv1-lznt1.pcapng.gz diff --git a/test/suite_dissection.py b/test/suite_dissection.py index c4f79e0ff1..d17fcc3496 100644 --- a/test/suite_dissection.py +++ b/test/suite_dissection.py @@ -248,6 +248,22 @@ class case_decompress_smb2(subprocesstest.SubprocessTestCase): fixtures.skip('this test is supported on little endian only') self.extract_compressed_payload(cmd_tshark, capture_file, 3) + def extract_chained_compressed_payload(self, cmd_tshark, capture_file, frame_num): + proc = self.assertRun((cmd_tshark, + '-r', capture_file('smb311-chained-patternv1-lznt1.pcapng.gz'), + '-Tfields', '-edata.data', + '-Y', 'frame.number == %d'%frame_num, + )) + self.assertEqual(b'\xaa'*256, bytes.fromhex(proc.stdout_str.strip())) + + def test_smb311_chained_lznt1_patternv1(self, cmd_tshark, capture_file): + if sys.byteorder == 'big': + fixtures.skip('this test is supported on little endian only') + self.extract_chained_compressed_payload(cmd_tshark, capture_file, 1) + + def test_smb311_chained_none_patternv1(self, cmd_tshark, capture_file): + self.extract_chained_compressed_payload(cmd_tshark, capture_file, 2) + @fixtures.mark_usefixtures('test_env') @fixtures.uses_fixtures class case_communityid(subprocesstest.SubprocessTestCase): |