Skip Menu |

This queue is for tickets about the Net-DNS CPAN distribution.

Report information
The Basics
Id: 55682
Status: resolved
Priority: 0/
Queue: Net-DNS

People
Owner: Nobody in particular
Requestors: mail [...] fhinzmann.de
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.66
Fixed in: (no value)



Subject: Make tests run offline
Hello! There has been a bug report against the Debian package of Net::DNS v0.66. make test failed without internet access. While I could not reproduce the failure reported there yet, I found another failure when running make test with my interface down. t/01-resolver.t called some network functions to test for private ip addresses before checking for online tests being disabled. The patch attached should fix that. Please have a look at it. I would be glad to hear back about it. Regards, Florian Hinzmann
Subject: do-not-fail-make-test-offline.patch
Index: libnet-dns-perl/t/01-resolver.t =================================================================== --- libnet-dns-perl.orig/t/01-resolver.t 2010-03-18 09:12:46.000000000 +0100 +++ libnet-dns-perl/t/01-resolver.t 2010-03-18 09:32:55.000000000 +0100 @@ -63,34 +63,35 @@ -# Some people try to run these on private address space." - -use Net::IP; - -use IO::Socket::INET; - -my $sock = IO::Socket::INET->new(PeerAddr => '193.0.14.129', # k.root-servers.net. - PeerPort => '53', - Proto => 'udp'); - - -my $ip=Net::IP->new(inet_ntoa($sock->sockaddr)); SKIP: { + # Test first, if we want online tests at all. skip 'Online tests disabled.', 3 unless -e 't/online.enabled'; skip 'Online tests disabled.', 3 if -e 't/online.disabled'; + + # Some people try to run these on private address space - test for this case and skip. + use Net::IP; + use IO::Socket::INET; + + my $sock = IO::Socket::INET->new(PeerAddr => '193.0.14.129', # k.root-servers.net. + PeerPort => '53', + Proto => 'udp'); + + my $ip=Net::IP->new(inet_ntoa($sock->sockaddr)); + skip 'Tests may not run succesful from private IP('.$ip->ip() .')', 3 if ($ip->iptype() ne "PUBLIC"); + my $res = Net::DNS::Resolver->new; $res->nameservers('a.t.net-dns.org'); - my $ip = ($res->nameservers)[0]; + $ip = ($res->nameservers)[0]; is($ip, '10.0.1.128', 'Nameservers() looks up IP.') or diag ($res->errorstring . $res->print) ;
From: mail [...] fhinzmann.de
P.S: In addition it called skip outside a SKIP: block, which is not good for Test::More as far as I understand. Regards Florian Hinzmann
Hi Florian, You are correct, he order of events in t/01-resolver.t was erroneous. I have applied your patch. I could not find the bug report. Is it still current? Regards, Willem On Thu Mar 18 04:56:48 2010, butch wrote: Show quoted text
> Hello! > > > There has been a bug report against the Debian package > of Net::DNS v0.66. > > make test failed without internet access. While I could not > reproduce the failure reported there yet, I found another failure > when running make test with my interface down. > > t/01-resolver.t called some network functions to test for > private ip addresses before checking for online tests being > disabled. > > The patch attached should fix that. Please have a look at it. I would > be glad to hear back about it. > > Regards, > Florian Hinzmann
Subject: Re: [rt.cpan.org #55682] Make tests run offline
Date: Mon, 17 Jan 2011 14:31:08 +0100
To: bug-Net-DNS [...] rt.cpan.org
From: Florian Hinzmann <mail [...] fhinzmann.de>
On Mon, 17 Jan 2011 08:13:28 -0500 "Willem Toorop via RT" <bug-Net-DNS@rt.cpan.org> wrote: Show quoted text
Show quoted text
> You are correct, he order of events in t/01-resolver.t was erroneous. > I have applied your patch.
Thanks. Show quoted text
> I could not find the bug report. Is it still current?
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=574331 Regards Florian -- Florian Hinzmann private: mail@fhinzmann.de Debian: fh@debian.org PGP Key / ID: 1024D/B4071A65 Fingerprint : F9AB 00C1 3E3A 8125 DD3F DF1C DF79 A374 B407 1A65
Subject: Re: [rt.cpan.org #55682] Make tests run offline
Date: Mon, 17 Jan 2011 14:34:44 +0100
To: bug-Net-DNS [...] rt.cpan.org
From: Florian Hinzmann <mail [...] fhinzmann.de>
On Mon, 17 Jan 2011 08:13:28 -0500 "Willem Toorop via RT" <bug-Net-DNS@rt.cpan.org> wrote: Show quoted text
> I could not find the bug report. Is it still current?
To pay the second half of that line attention, too: It is not current with regard to the patch you've just applied is that one has been applied to the Debian package already. It is current, however, as there seems to be some more work to do. Regards Florian -- Florian Hinzmann private: mail@fhinzmann.de Debian: fh@debian.org PGP Key / ID: 1024D/B4071A65 Fingerprint : F9AB 00C1 3E3A 8125 DD3F DF1C DF79 A374 B407 1A65
Subject: Re: [rt.cpan.org #55682] Make tests run offline
Date: Mon, 17 Jan 2011 14:44:42 +0100
To: bug-Net-DNS [...] rt.cpan.org
From: Willem Toorop <willem [...] NLnetLabs.nl>
Hi Florian, I have not yet looked at the Debian package, but let me ask a quick question about its configuration... Do you call Makefile.PL with the --noonline-tests and --noipv6-tests options to disable online tests from your Debian build files? Thanks, Willem On 01/17/11 14:34, Florian Hinzmann via RT wrote: Show quoted text
> Queue: Net-DNS > Ticket<URL: https://rt.cpan.org/Ticket/Display.html?id=55682> > > > On Mon, 17 Jan 2011 08:13:28 -0500 > "Willem Toorop via RT"<bug-Net-DNS@rt.cpan.org> wrote: >
>> I could not find the bug report. Is it still current?
> To pay the second half of that line attention, too: > > It is not current with regard to the patch you've just > applied is that one has been applied to the Debian > package already. It is current, however, as there > seems to be some more work to do. > > > Regards > Florian > > > >
Subject: Re: [rt.cpan.org #55682] Make tests run offline
Date: Mon, 17 Jan 2011 14:49:16 +0100
To: bug-Net-DNS [...] rt.cpan.org
From: Florian Hinzmann <mail [...] fhinzmann.de>
On Mon, 17 Jan 2011 08:44:53 -0500 "Willem Toorop via RT" <bug-Net-DNS@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=55682 > > > Hi Florian, > > I have not yet looked at the Debian package, but let me ask a quick > question about its configuration... > Do you call Makefile.PL with the --noonline-tests and --noipv6-tests
Currently I do call Show quoted text
> $(PERL) Makefile.PL INSTALLDIRS=vendor --online-tests --IPv6-tests
to enable them. I consider calling build tests a feature to be safe about the builds, even builds called automatically. "make test" should be called only, when the Debian build option "nocheck" was not given: Show quoted text
> ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) > $(MAKE) test > endif
Regards Florian -- Florian Hinzmann private: mail@fhinzmann.de Debian: fh@debian.org PGP Key / ID: 1024D/B4071A65 Fingerprint : F9AB 00C1 3E3A 8125 DD3F DF1C DF79 A374 B407 1A65
Subject: Re: [rt.cpan.org #55682] Make tests run offline
Date: Tue, 18 Jan 2011 11:16:11 +0100
To: bug-Net-DNS [...] rt.cpan.org
From: Willem Toorop <willem [...] NLnetLabs.nl>
On 01/17/11 14:49, Florian Hinzmann via RT wrote: Show quoted text
> Currently I do call
>> $(PERL) Makefile.PL INSTALLDIRS=vendor --online-tests --IPv6-tests
> to enable them. I consider calling build tests a feature to be > safe about the builds, even builds called automatically.
Absolutely. So you think the test scripts should detect internet availability in stead of enabling and disabling certain tests on the command line?
Subject: Re: [rt.cpan.org #55682] Make tests run offline
Date: Tue, 18 Jan 2011 12:08:28 +0100
To: bug-Net-DNS [...] rt.cpan.org
From: Willem Toorop <willem [...] NLnetLabs.nl>
If it should be detectable whether online tests should be performed or not, I suppose it has to be detected with an external tools, like drill, dig or host. Otherwise we can not distinguish between network unavailability and library failure. On 01/18/11 11:16, Willem Toorop via RT wrote: Show quoted text
> Absolutely. > So you think the test scripts should detect internet availability in > stead of enabling and disabling certain tests on the command line?
Hi Florian, The new release (which will follow soon) will have a non interactive Makefile.PL that makes online tests non-fatal by default. Best regards, -- Willem