From df804f25afc8dd91269303fea974d3860cfdd516 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Valverde?= Date: Fri, 12 May 2023 20:51:01 +0100 Subject: Tests+MSVC: Fix capture test suite using Npcap 1.75 Npcap 1.75 and possibly earlier changed the loopback interface string to: \Device\NPF_Loopback (Adapter for loopback traffic capture) The test suite expects: \Device\NPF_Loopback (Npcap Loopback Adapter) So the test is incorrectly skipped. Use a case insensitive regular expression to fix the capture interface detection. Remnove quoting command path to fix tests using cmd.exe on windows. Pipes are broken with the MSYS2 shell without quoting. Skip those tests for now. Fix some broken tests with reformatted error messages. --- test/suite_clopts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/suite_clopts.py') diff --git a/test/suite_clopts.py b/test/suite_clopts.py index 1150ff311d..a10845ca58 100644 --- a/test/suite_clopts.py +++ b/test/suite_clopts.py @@ -62,7 +62,7 @@ class case_dumpcap_capture_clopts(subprocesstest.SubprocessTestCase): # $DUMPCAP -i invalid_interface -w './testout.pcap' > ./testout.txt 2>&1 testout_file = result_file(testout_pcap) self.runProcess((cmd_dumpcap, '-i', invalid_interface, '-w', testout_file)) - self.assertTrue(self.grepOutput('There is no device named "__invalid_interface"')) + self.assertTrue(self.grepOutput('The capture session could not be initiated on capture device "__invalid_interface"')) def test_dumpcap_invalid_interface_index(self, cmd_dumpcap, capture_interface, result_file): '''Invalid capture interface index''' @@ -128,7 +128,7 @@ class case_tshark_capture_clopts(subprocesstest.SubprocessTestCase): # $TSHARK -i invalid_interface -w './testout.pcap' > ./testout.txt 2>&1 testout_file = result_file(testout_pcap) self.runProcess((cmd_tshark, '-i', invalid_interface, '-w', testout_file)) - self.assertTrue(self.grepOutput('There is no device named "__invalid_interface"')) + self.assertTrue(self.grepOutput('The capture session could not be initiated on capture device "__invalid_interface"')) def test_tshark_invalid_interface_index(self, cmd_tshark, capture_interface, result_file): '''Invalid capture interface index''' -- cgit v1.2.3