Date: Fri, 6 Apr 2012 09:32:57 -0800 (AKDT) From: Mel Flynn <rflynn@acsalaska.net> To: FreeBSD-gnats-submit@FreeBSD.org Cc: Steve Wills <swills@FreeBSD.org>, Maintainer <clsung@FreeBSD.org> Subject: ports/166698: [patch] net/p5-Net-Pcap: fix tests Message-ID: <201204061732.q36HWvB4087657@datakitty.lan.rachie.is-a-geek.net> Resent-Message-ID: <201204061740.q36He8X8087043@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 166698 >Category: ports >Synopsis: [patch] net/p5-Net-Pcap: fix tests >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Apr 06 17:40:08 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Mel Flynn >Release: FreeBSD 8.2-STABLE amd64 >Organization: >Environment: System: FreeBSD datakitty.lan.rachie.is-a-geek.net 8.2-STABLE FreeBSD 8.2-STABLE #6 r230977: Sun Feb 5 06:20:11 AKST 2012 mel@datakitty.lan.rachie.is-a-geek.net:/data/obj/data/RELENG_8/src/sys/GENERIC amd64 >Description: 1) libpcap-1.0.0 no longer returns an error description for the case of a non-existing device. The test expects to see the 0.9.8 format. 2) When usbus devices are selected for the test, the tests will hang indefenitely. As such, filter out these devices. >How-To-Repeat: cd /usr/ports/net/p5-Net-Pcap make build cd `make -V WRKSRC` make test >Fix: While in here, add TEST_DEPENDS. --- net__p5-Net-Pcap.patch begins here --- diff -urN --exclude CVS --exclude '*~' net/p5-Net-Pcap/Makefile /usr/ports/net/p5-Net-Pcap/Makefile --- net/p5-Net-Pcap/Makefile.orig 2008-01-14 15:58:11.000000000 -0900 +++ net/p5-Net-Pcap/Makefile 2012-04-05 18:14:14.000000000 -0800 @@ -15,10 +15,18 @@ COMMENT= Interface to pcap(3) LBL packet capture library RUN_DEPENDS= ${SITE_PERL}/${PERL_ARCH}/IO/Interface.pm:${PORTSDIR}/net/p5-IO-Interface +TEST_DEPENDS= p5-Socket>=0:${PORTSDIR}/net/p5-Socket \ + p5-Test-Exception>=0:${PORTSDIR}/devel/p5-Test-Exception PERL_CONFIGURE= yes MAN1= pcapinfo.1 MAN3= Net::Pcap.3 -.include <bsd.port.mk> +.include <bsd.port.pre.mk> + +.if ${OSVERSION} >= 800000 +EXTRA_PATCHES+= ${FILESDIR}/extra-patch-t__03-openlive.t +.endif + +.include <bsd.port.post.mk> diff -urN --exclude CVS --exclude '*~' net/p5-Net-Pcap/files/extra-patch-t__03-openlive.t /usr/ports/net/p5-Net-Pcap/files/extra-patch-t__03-openlive.t --- net/p5-Net-Pcap/files/extra-patch-t__03-openlive.t.orig 1969-12-31 14:00:00.000000000 -1000 +++ net/p5-Net-Pcap/files/extra-patch-t__03-openlive.t 2012-04-05 16:46:19.000000000 -0800 @@ -0,0 +1,14 @@ +--- t/03-openlive.t.orig 2007-12-22 10:46:39.000000000 -0900 ++++ t/03-openlive.t 2012-04-05 16:45:58.000000000 -0800 +@@ -64,8 +64,10 @@ + is( $@, '', "open_live()" ); + if($^O eq 'MSWin32' or $^O eq 'cygwin') { + like( $err, '/^Error opening adapter:/', " - \$err must be set: $err" ); +-} elsif($^O eq 'darwin' or $^O eq 'freebsd' or $^O eq 'openbsd') { ++} elsif($^O eq 'darwin' or $^O eq 'openbsd') { + like( $err, "/^(?:BIOCSETIF: )?$fakedev: Device not configured/", " - \$err must be set: $err" ); ++} elsif($^O eq 'freebsd') { ++ is( $err, ''); # Since pcap 1.0.0 nonexisting gives empty string. + } else { + like( $err, '/^(?:bind|ioctl|SIOCGIFHWADDR): (?:No such device)/', " - \$err must be set: $err" ); + } diff -urN --exclude CVS --exclude '*~' net/p5-Net-Pcap/files/patch-t__Utils.pm /usr/ports/net/p5-Net-Pcap/files/patch-t__Utils.pm --- net/p5-Net-Pcap/files/patch-t__Utils.pm.orig 1969-12-31 14:00:00.000000000 -1000 +++ net/p5-Net-Pcap/files/patch-t__Utils.pm 2012-04-05 17:41:15.000000000 -0800 @@ -0,0 +1,11 @@ +--- t/Utils.pm.orig 2012-04-05 17:39:45.000000000 -0800 ++++ t/Utils.pm 2012-04-05 17:41:15.000000000 -0800 +@@ -73,7 +73,7 @@ + my @devs = Net::Pcap::findalldevs(\%devs, \$err); + + # filter out unusable devices +-@devs = grep { $_ ne "lo" and $_ ne "lo0" and $_ !~ /GenericDialupAdapter/ } @devs; ++@devs = grep { $_ ne "lo" and $_ ne "lo0" and $_ !~ /GenericDialupAdapter/ and $_ !~ /^usbus/ } @devs; + + # check if the user has specified a prefered device to use for tests + if (open(PREF, "device.txt")) { --- net__p5-Net-Pcap.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201204061732.q36HWvB4087657>