[perl-libwww-perl] Run tests against localhost

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



commit 09d996d036359229f2e4e9c1b6202ddcf75ed131
Author: Petr Písař <ppisar@xxxxxxxxxx>
Date:   Wed Apr 23 12:50:58 2014 +0200

    Run tests against localhost

 ...-Connect-to-localhost-instead-of-hostname.patch |   75 ++++++++++++++++++++
 perl-libwww-perl.spec                              |    4 +
 2 files changed, 79 insertions(+), 0 deletions(-)
---
diff --git a/libwww-perl-6.06-Connect-to-localhost-instead-of-hostname.patch b/libwww-perl-6.06-Connect-to-localhost-instead-of-hostname.patch
new file mode 100644
index 0000000..25b9679
--- /dev/null
+++ b/libwww-perl-6.06-Connect-to-localhost-instead-of-hostname.patch
@@ -0,0 +1,75 @@
+From 2d7a479b39bb20a0d61f067ba6c2df92117fcb8c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@xxxxxxxxxx>
+Date: Wed, 23 Apr 2014 12:45:38 +0200
+Subject: [PATCH] Connect to localhost instead of hostname
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The hostname does not have to be resolvable nor reachable. It's just
+a machine name.
+
+Signed-off-by: Petr Písař <ppisar@xxxxxxxxxx>
+---
+ t/local/http.t   | 2 +-
+ t/robot/ua-get.t | 2 +-
+ t/robot/ua.t     | 2 +-
+ talk-to-ourself  | 3 +--
+ 4 files changed, 4 insertions(+), 5 deletions(-)
+
+diff --git a/t/local/http.t b/t/local/http.t
+index 779cc21..534b4c8 100644
+--- a/t/local/http.t
++++ b/t/local/http.t
+@@ -20,7 +20,7 @@ if ($D eq 'daemon') {
+ 
+     require HTTP::Daemon;
+ 
+-    my $d = HTTP::Daemon->new(Timeout => 10);
++    my $d = HTTP::Daemon->new(Timeout => 10, LocalAddr => 'localhost');
+ 
+     print "Please to meet you at: <URL:", $d->url, ">\n";
+     open(STDOUT, $^O eq 'VMS'? ">nl: " : ">/dev/null");
+diff --git a/t/robot/ua-get.t b/t/robot/ua-get.t
+index 5754c4b..bf24589 100644
+--- a/t/robot/ua-get.t
++++ b/t/robot/ua-get.t
+@@ -19,7 +19,7 @@ if ($D eq 'daemon') {
+ 
+     require HTTP::Daemon;
+ 
+-    my $d = new HTTP::Daemon Timeout => 10;
++    my $d = new HTTP::Daemon Timeout => 10, LocalAddr => 'localhost';
+ 
+     print "Please to meet you at: <URL:", $d->url, ">\n";
+     open(STDOUT, $^O eq 'MSWin32' ?  ">nul" : $^O eq 'VMS' ? ">NL:"  : ">/dev/null");
+diff --git a/t/robot/ua.t b/t/robot/ua.t
+index 21ad5c8..11fafa8 100644
+--- a/t/robot/ua.t
++++ b/t/robot/ua.t
+@@ -19,7 +19,7 @@ if ($D eq 'daemon') {
+ 
+     require HTTP::Daemon;
+ 
+-    my $d = new HTTP::Daemon Timeout => 10;
++    my $d = new HTTP::Daemon Timeout => 10, LocalAddr => 'localhost';
+ 
+     print "Please to meet you at: <URL:", $d->url, ">\n";
+     open(STDOUT, $^O eq 'MSWin32' ?  ">nul" : $^O eq 'VMS' ? ">NL:"  : ">/dev/null");
+diff --git a/talk-to-ourself b/talk-to-ourself
+index 6c0257a..b4acda2 100644
+--- a/talk-to-ourself
++++ b/talk-to-ourself
+@@ -9,8 +9,7 @@ require IO::Socket;
+ 
+ if (@ARGV >= 2 && $ARGV[0] eq "--port") {
+     my $port = $ARGV[1];
+-    require Sys::Hostname;
+-    my $host = Sys::Hostname::hostname();
++    my $host = 'localhost';
+     if (my $socket = IO::Socket::INET->new(PeerAddr => "$host:$port", Timeout => 5)) {
+ 	require IO::Select;
+ 	if (IO::Select->new($socket)->can_read(1)) {
+-- 
+1.9.0
+
diff --git a/perl-libwww-perl.spec b/perl-libwww-perl.spec
index 34c7279..6ea3f2a 100644
--- a/perl-libwww-perl.spec
+++ b/perl-libwww-perl.spec
@@ -6,6 +6,8 @@ Group:          Development/Libraries
 License:        GPL+ or Artistic
 URL:            http://search.cpan.org/dist/libwww-perl/
 Source0:        http://www.cpan.org/authors/id/M/MS/MSCHILLI/libwww-perl-%{version}.tar.gz
+# Run tests against localhost
+Patch0:         libwww-perl-6.06-Connect-to-localhost-instead-of-hostname.patch
 BuildArch:      noarch
 BuildRequires:  perl
 BuildRequires:  perl(ExtUtils::MakeMaker)
@@ -116,6 +118,7 @@ use and even classes that help you implement simple HTTP servers.
 
 %prep
 %setup -q -n libwww-perl-%{version} 
+%patch0 -p1
 
 %build
 # Install the aliases by default
@@ -143,6 +146,7 @@ make test
 %changelog
 * Wed Apr 23 2014 Petr Pisar <ppisar@xxxxxxxxxx> - 6.06-1
 - 6.06 bump
+- Run tests against localhost
 
 * Sun Aug 04 2013 Fedora Release Engineering <rel-eng@xxxxxxxxxxxxxxxxxxxxxxx> - 6.05-3
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
--
Fedora Extras Perl SIG
http://www.fedoraproject.org/wiki/Extras/SIGs/Perl
perl-devel mailing list
perl-devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/perl-devel





[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Legacy Announce]     [Fedora PHP Devel]     [Kernel Devel]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Big List of Linux Books]     [Gimp]     [Yosemite Information]
  Powered by Linux