diff options
author | Gerald Combs <gerald@wireshark.org> | 2018-11-19 08:40:08 -0800 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2018-11-20 10:01:44 +0000 |
commit | cce885e1124215ea5dfb3a0d75b215ad9384fd2e (patch) | |
tree | a38d98a7316fcd661c8f20a18511a74ea384df6b /test | |
parent | 97cd30d3ca27b677be66649949365263f17347e3 (diff) |
Test: Fix some dumpcap section checks and skip one.
In check_dumpcap_pcapng_sections, append a copy of our check_val dict so
that we properly check our first file.
Skip IDB checks when we have multiple interfaces. Dumpcap creates a
separate thread for each interface when the interface count is > 1,
which means that we can't guarantee that we will always read and write
everything in the same order.
Change-Id: Ie458f31e0e901db2b538e9826a136dbe89167bcf
Reviewed-on: https://code.wireshark.org/review/30718
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'test')
-rw-r--r-- | test/suite_capture.py | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/test/suite_capture.py b/test/suite_capture.py index adc1e91221..5795dc4f12 100644 --- a/test/suite_capture.py +++ b/test/suite_capture.py @@ -370,7 +370,7 @@ def check_dumpcap_pcapng_sections(cmd_dumpcap, cmd_tshark, capture_file): rb_unique = 'sections_rb_' + uuid.uuid4().hex[:6] # Random ID testout_glob = '{}.{}_*.pcapng'.format(self.id(), rb_unique) testout_file = '{}.{}.pcapng'.format(self.id(), rb_unique) - check_vals.append(check_val_d) + check_vals.append(check_val_d.copy()) # check_vals[]['filename'] will be filled in below else: testout_file = self.filename_from_id(testout_pcapng) @@ -396,7 +396,7 @@ def check_dumpcap_pcapng_sections(cmd_dumpcap, cmd_tshark, capture_file): '-b', 'packets:53' ) check_vals[0]['packet_count'] = 53 - check_vals[0]['idb_count'] = 22 + check_vals[0]['idb_count'] = 11 check_vals[0]['ua_pt1_count'] = 1 check_vals[1]['packet_count'] = 26 check_vals[1]['idb_count'] = 22 @@ -422,7 +422,7 @@ def check_dumpcap_pcapng_sections(cmd_dumpcap, cmd_tshark, capture_file): '-b', 'packets:53' ) check_vals[0]['packet_count'] = 53 - check_vals[0]['idb_count'] = 35 + check_vals[0]['idb_count'] = 13 check_vals[0]['ua_dc_count'] = 1 check_vals[1]['packet_count'] = 35 check_vals[1]['idb_count'] = 35 @@ -466,6 +466,13 @@ def check_dumpcap_pcapng_sections(cmd_dumpcap, cmd_tshark, capture_file): # many_interfaces.pcapng.1 : 64 packets written by "Passthrough test #1" # many_interfaces.pcapng.2 : 15 packets written by "Passthrough test #2" # many_interfaces.pcapng.3 : 9 packets written by "Passthrough test #3" + # Each has 11 interfaces. + idb_compare_eq = True + if multi_input and multi_output: + # Having multiple inputs forces the use of threads. In our + # case this means that non-packet block counts in the first + # file in is nondeterministic. + idb_compare_eq = False for check_val in check_vals: self.checkPacketCount(check_val['packet_count'], cap_file=check_val['filename']) @@ -475,8 +482,13 @@ def check_dumpcap_pcapng_sections(cmd_dumpcap, cmd_tshark, capture_file): '-X', 'read_format:MIME Files Format' )) # XXX Are there any other sanity checks we should run? - self.assertEqual(self.countOutput('Block: Interface Description Block', - proc=tshark_proc), check_val['idb_count']) + if idb_compare_eq: + self.assertEqual(self.countOutput('Block: Interface Description Block', + proc=tshark_proc), check_val['idb_count']) + else: + self.assertGreaterEqual(self.countOutput('Block: Interface Description Block', + proc=tshark_proc), check_val['idb_count']) + idb_compare_eq = True self.assertEqual(self.countOutput('Option: User Application = Passthrough test #1', proc=tshark_proc), check_val['ua_pt1_count']) self.assertEqual(self.countOutput('Option: User Application = Passthrough test #2', |