diff options
author | Gerald Combs <gerald@wireshark.org> | 2018-04-27 09:35:37 -0700 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2018-04-27 17:15:19 +0000 |
commit | 9b3be1711f2a92ed4c59e32961d4d19b8f593d94 (patch) | |
tree | 8e5b5d878c367df09261a17282ddc6c453ba3aa6 /test/suite_clopts.py | |
parent | 662210f3d5c631f30b476ed2fcd9ab81d0dfd080 (diff) |
test: Miscellaneous fixups.
In util_slow_dhcp.py, open stdout as O_BINARY on Windows.
Have ctest pass --verbose to test.py.
Call config.canCapture at test time so that we don't inadvertently skip
some tests.
Stringify our dumpcap config check.
Fix our Gcrypt variable.
Change-Id: I884ec23ddfc7c28b79d4a860c6c43c308598e6db
Reviewed-on: https://code.wireshark.org/review/27182
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'test/suite_clopts.py')
-rw-r--r-- | test/suite_clopts.py | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/test/suite_clopts.py b/test/suite_clopts.py index 37165852d5..3516d5fa36 100644 --- a/test/suite_clopts.py +++ b/test/suite_clopts.py @@ -45,25 +45,28 @@ class case_dumpcap_invalid_interface_chars(subprocesstest.SubprocessTestCase): class case_dumpcap_capture_clopts(subprocesstest.SubprocessTestCase): - @unittest.skipUnless(config.canCapture(), 'Test requires capture privileges') def test_dumpcap_invalid_capfilter(self): '''Invalid capture filter''' + if not config.canCapture(): + self.skipTest('Test requires capture privileges and an interface.') invalid_filter = '__invalid_protocol' # $DUMPCAP -f 'jkghg' -w './testout.pcap' > ./testout.txt 2>&1 self.runProcess((config.cmd_dumpcap, '-f', invalid_filter, '-w', 'testout.pcap' )) self.assertTrue(self.grepOutput('Invalid capture filter "' + invalid_filter + '" for interface')) - @unittest.skipUnless(config.canCapture(), 'Test requires capture privileges') def test_dumpcap_invalid_interface_name(self): '''Invalid capture interface name''' + if not config.canCapture(): + self.skipTest('Test requires capture privileges and an interface.') invalid_interface = '__invalid_interface' # $DUMPCAP -i invalid_interface -w './testout.pcap' > ./testout.txt 2>&1 self.runProcess((config.cmd_dumpcap, '-i', invalid_interface, '-w', 'testout.pcap')) self.assertTrue(self.grepOutput('The capture session could not be initiated')) - @unittest.skipUnless(config.canCapture(), 'Test requires capture privileges') def test_dumpcap_invalid_interface_index(self): '''Invalid capture interface index''' + if not config.canCapture(): + self.skipTest('Test requires capture privileges and an interface.') invalid_index = '0' # $DUMPCAP -i 0 -w './testout.pcap' > ./testout.txt 2>&1 self.runProcess((config.cmd_dumpcap, '-i', invalid_index, '-w', 'testout.pcap')) @@ -110,25 +113,28 @@ class case_tshark_invalid_interface_chars(subprocesstest.SubprocessTestCase): class case_tshark_capture_clopts(subprocesstest.SubprocessTestCase): - @unittest.skipUnless(config.canCapture(), 'Test requires capture privileges') def test_tshark_invalid_capfilter(self): '''Invalid capture filter''' + if not config.canCapture(): + self.skipTest('Test requires capture privileges and an interface.') invalid_filter = '__invalid_protocol' # $TSHARK -f 'jkghg' -w './testout.pcap' > ./testout.txt 2>&1 self.runProcess((config.cmd_tshark, '-f', invalid_filter, '-w', 'testout.pcap' )) self.assertTrue(self.grepOutput('Invalid capture filter "' + invalid_filter + '" for interface')) - @unittest.skipUnless(config.canCapture(), 'Test requires capture privileges') def test_tshark_invalid_interface_name(self): '''Invalid capture interface name''' + if not config.canCapture(): + self.skipTest('Test requires capture privileges and an interface.') invalid_interface = '__invalid_interface' # $TSHARK -i invalid_interface -w './testout.pcap' > ./testout.txt 2>&1 self.runProcess((config.cmd_tshark, '-i', invalid_interface, '-w', 'testout.pcap')) self.assertTrue(self.grepOutput('The capture session could not be initiated')) - @unittest.skipUnless(config.canCapture(), 'Test requires capture privileges') def test_tshark_invalid_interface_index(self): '''Invalid capture interface index''' + if not config.canCapture(): + self.skipTest('Test requires capture privileges and an interface.') invalid_index = '0' # $TSHARK -i 0 -w './testout.pcap' > ./testout.txt 2>&1 self.runProcess((config.cmd_tshark, '-i', invalid_index, '-w', 'testout.pcap')) @@ -136,8 +142,9 @@ class case_tshark_capture_clopts(subprocesstest.SubprocessTestCase): class case_tshark_name_resolution_clopts(subprocesstest.SubprocessTestCase): - @unittest.skipUnless(config.canCapture(), 'Test requires capture privileges') def test_tshark_valid_name_resolution(self): + if not config.canCapture(): + self.skipTest('Test requires capture privileges and an interface.') # $TSHARK -N mntC -a duration:1 > ./testout.txt 2>&1 self.assertRun((config.cmd_tshark, '-N', 'mntC', '-a', 'duration: 1')) |