[libnet-mac-vendor-perl] 01/09: Skip tests that require internet

Nuno Carvalho smash at cpan.org
Tue Oct 8 14:43:00 UTC 2013


This is an automated email from the git hooks/post-receive script.

mestre-guest pushed a commit to branch master
in repository libnet-mac-vendor-perl.

commit ff66ee35dd06800f5614f6f2a3732600ccf3cec6
Author: Nuno Carvalho <smash at cpan.org>
Date:   Tue Oct 8 15:03:49 2013 +0100

    Skip tests that require internet
---
 debian/changelog                      |    4 +-
 debian/patches/network-tests.patch    |   15 ------
 debian/patches/no-network-tests.patch |   96 +++++++++++++++++++++++++++++++++
 debian/patches/series                 |    2 +-
 4 files changed, 98 insertions(+), 19 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index c5e15c7..3bf624b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -14,14 +14,11 @@ libnet-mac-vendor-perl (1.20-1) UNRELEASED; urgency=low
   - d/copyright: cosmetic: the license stanzas could be updated
     (our "modern" ones don't mention 'GNU/Linux', and are fomatted
     differently)
-  - now to the real problem: some tests fail without internet access
-    --> http://paste.debian.net/52640/
 
   * Team upload.
 
   [ Harlan Lieberman-Berg ]
   * Update d/* to latest S-V
-  * Remove patch that no long applies, refresh remaining patch.
 
   [ Salvatore Bonaccorso ]
   * debian/control: Changed: Replace versioned (build-)dependency on
@@ -50,6 +47,7 @@ libnet-mac-vendor-perl (1.20-1) UNRELEASED; urgency=low
     + remove libtest-pod* from D-B-I
     + remove libdbm-deep-perl from D-B-I, not required anymore
   * debian/copyright: update copyright years
+  * Update patch to skip tests that required internet
 
  -- Nuno Carvalho <smash at cpan.org>  Mon, 07 Oct 2013 14:34:57 +0100
 
diff --git a/debian/patches/network-tests.patch b/debian/patches/network-tests.patch
deleted file mode 100644
index b48771d..0000000
--- a/debian/patches/network-tests.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-Subject: Do not fail tests if not connected to the network
-From: Ansgar Burchardt <ansgar at 43-1.org>
-Date: Sun, 21 Jun 2009 19:24:30 +0200
-
---- a/t/fetch_oui.t
-+++ b/t/fetch_oui.t
-@@ -15,7 +15,7 @@
- # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
- my $connected = head( 'http://standards.ieee.org/regauth/oui/oui.txt' );
- 
--ok( defined $connected, "Am connected to network" );
-+#ok( defined $connected, "Am connected to network" );
- 
- # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-  # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
diff --git a/debian/patches/no-network-tests.patch b/debian/patches/no-network-tests.patch
new file mode 100644
index 0000000..dc163f6
--- /dev/null
+++ b/debian/patches/no-network-tests.patch
@@ -0,0 +1,96 @@
+--- a/t/fetch_oui_from_ieee.t
++++ b/t/fetch_oui_from_ieee.t
+@@ -5,13 +5,17 @@
+ use_ok( $class );
+ ok( defined &{"${class}::fetch_oui_from_ieee"}, "&fetch_oui_from_ieee is defined" );
+ 
+-my $array = Net::MAC::Vendor::fetch_oui_from_ieee( '00:01:02' );
+-isa_ok( $array, ref [], "Got back array reference" );
++SKIP: {
++  skip 'Tests require internet', 3 if $ENV{NO_NETWORK};
+ 
+-my $html = join "\n", @$array;
++  my $array = Net::MAC::Vendor::fetch_oui_from_ieee( '00:01:02' );
++  isa_ok( $array, ref [], "Got back array reference" );
+ 
+-like( $html, qr/3COM CORPORATION/, "Fetched 3M's OUI entry" );
++  my $html = join "\n", @$array;
+ 
+-unlike( $html, qr/PRIVATE/, "Still see PRIVATE in 3M entry" );
++  like( $html, qr/3COM CORPORATION/, "Fetched 3M's OUI entry" );
++
++  unlike( $html, qr/PRIVATE/, "Still see PRIVATE in 3M entry" );
++}
+ 
+ done_testing();
+--- a/t/fetch_oui.t
++++ b/t/fetch_oui.t
+@@ -13,15 +13,19 @@
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+  # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+-my $connected = head( 'http://standards.ieee.org/regauth/oui/oui.txt' );
++SKIP: {
++  skip 'Tests require internet', 1 if $ENV{NO_NETWORK};
++
++  my $connected = head( 'http://standards.ieee.org/regauth/oui/oui.txt' );
+ 
+-ok( defined $connected, "Am connected to network" );
++  ok( defined $connected, "Am connected to network" );
++}
+ 
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+  # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+ SKIP: {
+-skip "Can't connect to the IEEE web site", 4 unless $connected;
++skip "Can't connect to the IEEE web site", 4 unless ($connected or $ENV{NO_NETWORK});
+ 
+ Net::MAC::Vendor::fetch_oui( $oui[0] );
+ 
+--- a/t/rt79369.t
++++ b/t/rt79369.t
+@@ -11,10 +11,14 @@
+ my $private_mac = '00-00-6C';
+ 
+ subtest html => sub {
+-	my $array = Net::MAC::Vendor::lookup( $private_mac );
+-	isa_ok( $array, ref [], "Got back array reference" );
++      SKIP: {
++        skip 'Tests require internet', 2 if $ENV{NO_NETWORK};
+ 
+-	is( $array->[0], 'PRIVATE', 'This is a private entry' );
++	    my $array = Net::MAC::Vendor::lookup( $private_mac );
++	    isa_ok( $array, ref [], "Got back array reference" );
++
++	    is( $array->[0], 'PRIVATE', 'This is a private entry' );
++      }
+ 	};
+ 
+ subtest local_cache => sub {
+--- a/t/run.t
++++ b/t/run.t
+@@ -6,7 +6,9 @@
+ ok( defined &{"${class}::run"}, "run() method is defined" );
+ can_ok( $class, qw(run) );
+ 
+-{
++SKIP: {
++skip 'Tests require internet', 1 if $ENV{NO_NETWORK};
++
+ local *STDOUT;
+ 
+ open STDOUT, ">", \ my $output;
+--- a/t/load_cache.t
++++ b/t/load_cache.t
+@@ -12,7 +12,9 @@
+ is( $rc, undef, "load_cache returns undef for bad source [not_there.txt]");
+ }
+ 
+-{
++SKIP: {
++skip 'Tests require internet', 1 if $ENV{NO_NETWORK};
++
+ local *STDERR;
+ open STDERR, ">", \my $output;
+ my $rc = Net::MAC::Vendor::load_cache();
diff --git a/debian/patches/series b/debian/patches/series
index e998461..4677d0e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1 @@
-network-tests.patch
+no-network-tests.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libnet-mac-vendor-perl.git



More information about the Pkg-perl-cvs-commits mailing list