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