Skip Menu |

This queue is for tickets about the Net-Pcap CPAN distribution.

Report information
The Basics
Id: 117831
Status: open
Priority: 0/
Queue: Net-Pcap

People
Owner: Nobody in particular
Requestors: ppisar [...] redhat.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.18
Fixed in: (no value)



Subject: t/08-filter.t fails with libpcap-1.8.0
t/08-filter.t .............. ok # Failed test ' - $err must not be null: syntax error in filter expression: syntax error' # at t/09-error.t line 25. # 'syntax error in filter expression: syntax error' # doesn't match '/^(?:parse|syntax) error$/' # Looks like you failed 1 test of 10. t/09-error.t ............... Dubious, test returned 1 (wstat 256, 0x100) Failed 1/10 subtests This is cause by upgrading libpcap from 1.7.4 to 1.8.0. It looks like libpcap changed the error message wording.
From: ppisar [...] redhat.com
Dne St 14.zář.2016 05:10:01, ppisar napsal(a): Show quoted text
> t/08-filter.t .............. ok > # Failed test ' - $err must not be null: syntax error in filter > expression: syntax error' > # at t/09-error.t line 25. > # 'syntax error in filter expression: syntax error' > # doesn't match '/^(?:parse|syntax) error$/' > # Looks like you failed 1 test of 10. > t/09-error.t ............... > Dubious, test returned 1 (wstat 256, 0x100) > Failed 1/10 subtests >
Attached patch fixes it. New libpcap changed error message into two-level format.
Subject: Net-Pcap-0.18-Adapt-a-test-to-libpcap-1.8.0.patch
From 52607780c02ee90a93bd40e91c5263e55e7a351c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com> Date: Wed, 5 Oct 2016 15:54:02 +0200 Subject: [PATCH] Adapt a test to libpcap-1.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit libpcap-1.8.0 changed error message on invalid filter expression from "syntax error" to "syntax error in filter expression: syntax error". This patch adjust the t/09-error.t for that. CPAN RT#117831 Signed-off-by: Petr Písař <ppisar@redhat.com> --- t/09-error.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/09-error.t b/t/09-error.t index bcd2a13..ef8f0b2 100644 --- a/t/09-error.t +++ b/t/09-error.t @@ -22,7 +22,7 @@ is( $@, '', "compile() with an invalid filter string" ); is( $res, -1, " - result must not be null: $res" ); eval { $err = Net::Pcap::geterr($pcap) }; is( $@, '', "geterr()" ); -like( $err, '/^(?:parse|syntax) error$/', " - \$err must not be null: $err" ); +like( $err, '/(?:parse|syntax) error$/', " - \$err must not be null: $err" ); # Testing compile() with a valid filter eval { $res = Net::Pcap::compile($pcap, \$filter, "tcp", 0, $mask) }; -- 2.7.4
On 2016-10-05 10:01:16, ppisar wrote: Show quoted text
> Dne St 14.zář.2016 05:10:01, ppisar napsal(a):
> > t/08-filter.t .............. ok > > # Failed test ' - $err must not be null: syntax error in filter > > expression: syntax error' > > # at t/09-error.t line 25. > > # 'syntax error in filter expression: syntax error' > > # doesn't match '/^(?:parse|syntax) error$/' > > # Looks like you failed 1 test of 10. > > t/09-error.t ............... > > Dubious, test returned 1 (wstat 256, 0x100) > > Failed 1/10 subtests > >
> Attached patch fixes it. New libpcap changed error message into two- > level format.
This test fails also on newer freebsd systems (10, 11, 12). The proposed patch works here, too.
On 2016-09-14 05:10:01, ppisar wrote: Show quoted text
> t/08-filter.t .............. ok > # Failed test ' - $err must not be null: syntax error in filter > expression: syntax error' > # at t/09-error.t line 25. > # 'syntax error in filter expression: syntax error' > # doesn't match '/^(?:parse|syntax) error$/' > # Looks like you failed 1 test of 10. > t/09-error.t ............... > Dubious, test returned 1 (wstat 256, 0x100) > Failed 1/10 subtests > > This is cause by upgrading libpcap from 1.7.4 to 1.8.0. It looks like > libpcap changed the error message wording.
It seems this is fixed in https://github.com/maddingue/Net-Pcap/commit/1790442e3a95b81dc90b5e0be55439605156c157 --- so all it needs now is a new release...