Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: ask [...] develooper.com
Cc:
AdminCc:

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

Attachments


Subject: PATCH: Fix 12-misc-2 test to be more robust
Date: Tue, 9 Oct 2007 21:16:07 -0700
To: bug-Net-DNS [...] rt.cpan.org
From: Ask Bjørn Hansen <ask [...] develooper.com>
12-misc-2 only uses one IP address, so just use 127.0.0.1 (the "detect if the address is available" logic didn't work, but it doesn't seem needed here so I just took it out to make the test simpler)

Message body is not shown because sender requested not to inline it.

From e384f63ca434a9b08a70e4b8a996ddc11329988e Mon Sep 17 00:00:00 2001 From: Ask Bjoern Hansen <ask@develooper.com> Date: Tue, 9 Oct 2007 21:14:11 -0700 Subject: [PATCH] 12-misc-2 only uses one IP address, so just use 127.0.0.1 (the "detect if the address is available" logic didn't work, but it doesn't seem needed here so I just took it out to make the test simpler) --- Changes | 2 ++ t/12-misc-2.t | 47 +++-------------------------------------------- 2 files changed, 5 insertions(+), 44 deletions(-) diff --git a/Changes b/Changes index 2d8c008..ef7cde8 100644 --- a/Changes +++ b/Changes @@ -8,6 +8,8 @@ Revision history for Net::DNS -*-text-*- *** 0.61_01, UNRELEASED +Fix various tests so they are more robust (Ask Bjoern Hansen) + Fix rt.cpan.org #29531 The code that detects a query name to be an address faulty interpreted diff --git a/t/12-misc-2.t b/t/12-misc-2.t index 6428622..1ccedb3 100644 --- a/t/12-misc-2.t +++ b/t/12-misc-2.t @@ -26,50 +26,9 @@ use vars qw( -BEGIN { - - $lameloop=0; - $TestPort = 53000 + int(rand(1000)); - $address = "127.53.53.12"; - - - if( - eval {require IO::Socket;} - ){ - #Try binding to the test addresses .. - diag ("Testing availability of $address:$TestPort"); - - eval { - my $s = IO::Socket::INET->new(Proto => 'udp', - LocalAddr => $address, - LocalPort => $TestPort, - ReusePort => 1, - # turns out that closing the - # socket does not immediatly - # make the port available. - ); - - - return $s; - sleep 2; - }; - if ( $@ ){ - diag ($@); - diag ("This test needs ".join (" ",$address). " to be configured on your system"); - - plan skip_all => "$address has not been configured"; - exit; - } - - }else{ - - plan skip_all => 'Some prerequisites required for this test are not available (dont\'t worry about this)'; - exit; - } - -} - - +$lameloop = 0; +$TestPort = 53000 + int(rand(1000)); +$address = "127.0.0.1"; my $nameserver; -- 1.5.3.2
Subject: Re: [rt.cpan.org #29883] PATCH: Fix 12-misc-2 test to be more robust
Date: Wed, 10 Oct 2007 12:31:29 +0200
To: bug-Net-DNS [...] rt.cpan.org
From: "Olaf M. Kolkman" <olaf [...] dacht.net>
Ohhooo... Locally optimized development code is used elsewhere and now I've got to debug it :-). I reckon you got the code via a subversion checkout. Although your suggestion to simplify the code to use 127.0.0.1 is a correct one I actually wonder how the logic breaks. (Oh, hereby I also acknowledge seeing your other tickets. wrt Question.pm there is a patch waiting to fix your problem, which is different from your solution. It may take a while before I get around to it.) --Olaf On 10Oct 2007, at 6:18 AM, ask@develooper.com via RT wrote: Show quoted text
> > Wed Oct 10 00:18:08 2007: Request 29883 was acted upon. > Transaction: Ticket created by ask@develooper.com > Queue: Net-DNS > Subject: PATCH: Fix 12-misc-2 test to be more robust > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: ask@develooper.com > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=29883 > > > > 12-misc-2 only uses one IP address, so just use 127.0.0.1 (the "detect > if the address is available" logic didn't work, but it doesn't seem > needed here so I just took it out to make the test simpler) > > > <0003-12-misc-2-only-uses-one-IP-address-so-just-use-127.patch> > > From e384f63ca434a9b08a70e4b8a996ddc11329988e Mon Sep 17 00:00:00 > 2001 > From: Ask Bjoern Hansen <ask@develooper.com> > Date: Tue, 9 Oct 2007 21:14:11 -0700 > Subject: [PATCH] 12-misc-2 only uses one IP address, so just use > 127.0.0.1 (the "detect > if the address is available" logic didn't work, but it doesn't seem > needed here so I just took it out to make the test simpler) > > --- > Changes | 2 ++ > t/12-misc-2.t | 47 +++-------------------------------------------- > 2 files changed, 5 insertions(+), 44 deletions(-) > > diff --git a/Changes b/Changes > index 2d8c008..ef7cde8 100644 > --- a/Changes > +++ b/Changes > @@ -8,6 +8,8 @@ Revision history for > Net::DNS -*-text-*- > *** 0.61_01, UNRELEASED > +Fix various tests so they are more robust (Ask Bjoern Hansen) > + > Fix rt.cpan.org #29531 > The code that detects a query name to be an address faulty > interpreted > diff --git a/t/12-misc-2.t b/t/12-misc-2.t > index 6428622..1ccedb3 100644 > --- a/t/12-misc-2.t > +++ b/t/12-misc-2.t > @@ -26,50 +26,9 @@ use vars qw( > -BEGIN { > - > - $lameloop=0; > - $TestPort = 53000 + int(rand(1000)); > - $address = "127.53.53.12"; > - > - > - if( > - eval {require IO::Socket;} > - ){ > - #Try binding to the test addresses .. > - diag ("Testing availability of $address:$TestPort"); > - > - eval { > - my $s = IO::Socket::INET->new(Proto => 'udp', > - LocalAddr => $address, > - LocalPort => $TestPort, > - ReusePort => 1, > - # turns out that closing the > - # socket does not immediatly > - # make the port available. > - ); > - > - > - return $s; > - sleep 2; > - }; > - if ( $@ ){ > - diag ($@); > - diag ("This test needs ".join (" ",$address). " to be > configured on your system"); > - > - plan skip_all => "$address has not been configured"; > - exit; > - } > - > - }else{ > - > - plan skip_all => 'Some prerequisites required for this test are not > available (dont\'t worry about this)'; > - exit; > - } > - > -} > - > - > +$lameloop = 0; > +$TestPort = 53000 + int(rand(1000)); > +$address = "127.0.0.1"; > my $nameserver; > -- > 1.5.3.2 > >
------------------------------------------------------ Ik dacht net... heel even maar.
Download PGP.sig
application/pgp-signature 227b

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #29883] PATCH: Fix 12-misc-2 test to be more robust
Date: Wed, 10 Oct 2007 23:44:02 -0700
To: bug-Net-DNS [...] rt.cpan.org
From: Ask Bjørn Hansen <ask [...] develooper.com>
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Oct 10, 2007, at 4:14 AM, Olaf M. Kolkman via RT wrote: Show quoted text
> Ohhooo... Locally optimized development code is used elsewhere and > now I've got to debug it :-). I reckon you got the code via a > subversion checkout.
Yup. Thank you for providing that! Show quoted text
> Although your suggestion to simplify the code to use 127.0.0.1 is a > correct one I actually wonder how the logic breaks.
Yeah, I wondered too since it works in 12-misc.t. I didn't bother to investigate though as it was appropriate to just simplify it anyway (and I just wanted the tests to pass so I could spend time making a suggestion for the Question.pm issue). Thank you for being so responsive and for maintaining Net::DNS, I appreciate it! - ask - -- http://develooper.com/ - http://askask.com/ -----BEGIN PGP SIGNATURE----- iQCVAwUBRw3GNfkoKP1ixIspAQKERwQAkAJy6L7ePLGpwumkfxLCXVR+hMlc7Iap DruBnRb062/rncLtixILJjDh2D3mZJOCpsBjfebiGUQHGcGnF63YTtoWMSagvRVd YmOpizQAeRJCn8/sLpwUqfY9cz8dPnGJrx/zNwBZOBwhVIZAz/CNm9FXPhvSx622 5BuM4TYSmL0= =MktB -----END PGP SIGNATURE-----