diff options
author | John Thacker <johnthacker@gmail.com> | 2022-01-12 23:17:51 -0500 |
---|---|---|
committer | John Thacker <johnthacker@gmail.com> | 2022-01-12 23:22:39 -0500 |
commit | 5074b4d71791b6240829b53cf80c66c9f8ca7835 (patch) | |
tree | 186f3e5d84108b59ea3d367450ae572dafed280d /test | |
parent | b5f89dbe2db357a0f4a08de7d00fdeed7ca2780c (diff) |
test: Update text2pcap test to use new hexdump option
Update the text2pcap tests to use the new tshark hexdump option
(see b5f89dbe2db357a0 ), which allow us to get a consistent roundtrip
of results instead of having to override the expected number of packets
and data size.
Diffstat (limited to 'test')
-rw-r--r-- | test/suite_text2pcap.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/test/suite_text2pcap.py b/test/suite_text2pcap.py index 389b16fca3..acf1eac8d8 100644 --- a/test/suite_text2pcap.py +++ b/test/suite_text2pcap.py @@ -120,7 +120,7 @@ def check_text2pcap(cmd_tshark, cmd_text2pcap, capture_file): # text2pcap_generate_input() # $TSHARK -o 'gui.column.format:"Time","%t"' -tad -P -x -r $1 > testin.txt testin_file = self.filename_from_id(testin_txt) - tshark_cmd = '{cmd} -r {cf} -o gui.column.format:"Time","%t" -t ad -P -x > {of}'.format( + tshark_cmd = '{cmd} -r {cf} -o gui.column.format:"Time","%t" -t ad -P --hexdump frames > {of}'.format( cmd = cmd_tshark, cf = cap_file, of = testin_file, @@ -195,9 +195,10 @@ class case_text2pcap_pcap(subprocesstest.SubprocessTestCase): def test_text2pcap_sample_control4_2012_03_24_pcap(self, check_text2pcap): '''Test text2pcap with sample_control4_2012-03-24.pcap.''' - # tshark currently output decrypted ZigBee packets and - # as a result the number of packets and data size are different - check_text2pcap(self, 'sample_control4_2012-03-24.pcap', 'pcap', 239, 10095) + # Tests handling additional data source (decrypted ZigBee packets) + # Either tshark must not output the additional data source, + # or text2pcap must ignore it. + check_text2pcap(self, 'sample_control4_2012-03-24.pcap', 'pcap') def test_text2pcap_snakeoil_dtls_pcap(self, check_text2pcap): '''Test text2pcap with snakeoil-dtls.pcap.''' @@ -205,9 +206,10 @@ class case_text2pcap_pcap(subprocesstest.SubprocessTestCase): def test_text2pcap_wpa_eap_tls_pcap_gz(self, check_text2pcap): '''Test text2pcap with wpa-eap-tls.pcap.gz.''' - # tshark reassembles some packets and because of this - # the number of packets and data size are different - check_text2pcap(self, 'wpa-eap-tls.pcap.gz', 'pcap', 88, 38872) + # Tests handling additional data source (reassemblies) + # Either tshark must not output the additional data source, + # or text2pcap must ignore it. + check_text2pcap(self, 'wpa-eap-tls.pcap.gz', 'pcap') def test_text2pcap_wpa_induction_pcap(self, check_text2pcap): '''Test text2pcap with wpa-Induction.pcap.gz.''' |