Skip Menu |

This queue is for tickets about the POE-Component-Client-DNS CPAN distribution.

Report information
The Basics
Id: 41313
Status: resolved
Priority: 0/
Queue: POE-Component-Client-DNS

People
Owner: Nobody in particular
Requestors: rmayorga [...] debian.org.sv
Cc:
AdminCc:

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



Subject: Using Net::DNS to find poe.perl.org address
Hello, After Net::DNS is required at test, then using a hardcode IP addres to poe.perl.org could lead to fails at the test suite when this IP changes. I attach a proposal patch that changes all hardcode IP address and use Net::DNS to find the right one, this patch comes from a bug reported at Debian, you can find more info here: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=506915 Cheers -- René
Subject: use_netdns_instead_of_harcode_ips.patch
Author: Rene Mayorga <rmayorga@debian.org.sv> Description: Use Net::DNS to get poe.perl.org's IP Address Bug: #506915 --- libpoe-component-client-dns-perl.orig/t/06_hosts.t +++ libpoe-component-client-dns-perl/t/06_hosts.t @@ -13,6 +13,13 @@ require Net::DNS; my $can_resolve = Net::DNS::Resolver->new->search("poe.perl.org"); +my $addr; +if ($can_resolve) { + foreach ($can_resolve->answer) { + $addr = $_->address unless $_->type ne "A"; + } +} + use constant HOSTS_FILE => "./test-hosts"; my $resolver = POE::Component::Client::DNS->spawn( @@ -52,7 +59,7 @@ skip "Can't resolve with Net::DNS, network probably not available", 1 unless($can_resolve); ok( - ($address eq "67.207.145.70") || ($address eq "208.97.190.64"), + $address eq $addr, "lookup with no hosts file ($address)" ); } @@ -98,7 +105,7 @@ skip "Can't resolve with Net::DNS, network probably not available", 1 unless($can_resolve); ok( - ($address eq "67.207.145.70") || ($address eq "208.97.190.64"), + $address eq $addr, "lookup with hosts file but no match ($address)" ); }
Patch applied, thanks! It will show up in version 1.04.