- Fix tests

PR:		ports/166698
Submited by:	Mel Flynn <rflynn@acsalaska.net>
This commit is contained in:
Steve Wills 2012-05-09 11:22:20 +00:00
parent ad8705da01
commit a543cedb7c
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=296289
3 changed files with 34 additions and 1 deletions

View file

@ -15,10 +15,18 @@ MAINTAINER= perl@FreeBSD.org
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>

View file

@ -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" );
}

View file

@ -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")) {