[libnet-route-perl] 01/01: 0001-Survive-systems-with-an-empty-routing-table.patch, 0002-Survive-systems-without-a-default-route.patch: new patches, to have the test suite survive systems with an empty routing table, or with no default route (Closes: #788758).

Intrigeri intrigeri at moszumanska.debian.org
Wed Jun 29 13:54:21 UTC 2016


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

intrigeri pushed a commit to branch bugfix/788758
in repository libnet-route-perl.

commit 4bc786a92085204911c0207339500dc4b7bbd7b4
Author: intrigeri <intrigeri at boum.org>
Date:   Wed Jun 29 13:51:40 2016 +0000

    0001-Survive-systems-with-an-empty-routing-table.patch, 0002-Survive-systems-without-a-default-route.patch: new patches, to have the test suite survive systems with an empty routing table, or with no default route (Closes: #788758).
---
 ...rvive-systems-with-an-empty-routing-table.patch | 38 ++++++++++++++++++++++
 ...2-Survive-systems-without-a-default-route.patch | 31 ++++++++++++++++++
 debian/patches/series                              |  2 ++
 3 files changed, 71 insertions(+)

diff --git a/debian/patches/0001-Survive-systems-with-an-empty-routing-table.patch b/debian/patches/0001-Survive-systems-with-an-empty-routing-table.patch
new file mode 100644
index 0000000..d87d8c7
--- /dev/null
+++ b/debian/patches/0001-Survive-systems-with-an-empty-routing-table.patch
@@ -0,0 +1,38 @@
+From: Niko Tyni <ntyni at debian.org>
+Date: Mon, 24 Aug 2015 22:40:36 +0300
+Subject: Survive systems with an empty routing table
+
+On at least Linux, 'route -n' returns 1 if there are no routes.
+This shouldn't make the test suite fail, so skip the tests on errors.
+
+This is not an optimal solution as other errors might now
+go unnoticed.
+
+Bug-Debian: https://bugs.debian.org/788758
+---
+ t/50-integration.t | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/t/50-integration.t b/t/50-integration.t
+index d408d43..e4677c2 100644
+--- a/t/50-integration.t
++++ b/t/50-integration.t
+@@ -20,11 +20,12 @@ sub diag_system_command
+     return;
+ }
+ 
++SKIP: {
+ my $table_ref;
+ if ( !eval { $table_ref = Net::Route::Table->from_system(); 1 } )
+ {
+     diag_system_command();
+-    die $EVAL_ERROR;
++    skip "error getting routes: $EVAL_ERROR", 2;
+ }
+ 
+ my $default_network = NetAddr::IP->new( '0.0.0.0', '0.0.0.0' );
+@@ -33,3 +34,4 @@ is( $table_ref->default_route()->destination(), $default_network, 'The default g
+ 
+ my $size = @{ $table_ref->all_routes() };
+ cmp_ok( $size, '>' , 1, 'There are at least two routes' );
++}
diff --git a/debian/patches/0002-Survive-systems-without-a-default-route.patch b/debian/patches/0002-Survive-systems-without-a-default-route.patch
new file mode 100644
index 0000000..bab3ab8
--- /dev/null
+++ b/debian/patches/0002-Survive-systems-without-a-default-route.patch
@@ -0,0 +1,31 @@
+From: intrigeri <intrigeri at boum.org>
+Date: Wed, 29 Jun 2016 13:50:08 +0000
+Subject: Survive systems without a default route.
+
+When using cowbuilder and USENETWORK=no, 'route -n' returns 0 but
+$table_ref->default_route() is undefined.
+
+This shouldn't make the test suite fail, so skip the tests on errors.
+
+This is not an optimal solution as other errors might now
+go unnoticed.
+
+Bug-Debian: https://bugs.debian.org/788758
+---
+ t/50-integration.t | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/t/50-integration.t b/t/50-integration.t
+index e4677c2..efa096d 100644
+--- a/t/50-integration.t
++++ b/t/50-integration.t
+@@ -27,6 +27,9 @@ if ( !eval { $table_ref = Net::Route::Table->from_system(); 1 } )
+     diag_system_command();
+     skip "error getting routes: $EVAL_ERROR", 2;
+ }
++if ( !defined($table_ref->default_route()) ) {
++    skip "error getting default route", 2;
++}
+ 
+ my $default_network = NetAddr::IP->new( '0.0.0.0', '0.0.0.0' );
+ 
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..751e27d
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,2 @@
+0001-Survive-systems-with-an-empty-routing-table.patch
+0002-Survive-systems-without-a-default-route.patch

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



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