Skip to content

Commit

Permalink
fix nameserver testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
drawing committed Nov 6, 2024
1 parent 04baff4 commit 2184fbc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions tests/nginx-tests/tengine-tests/dynamic_resolve.t
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ BEGIN { use FindBin; chdir($FindBin::Bin); }

use lib 'lib';
use Test::Nginx;
eval { require Net::DNS::Nameserver; };
plan(skip_all => 'Net::DNS::Nameserver not installed') if $@;

###############################################################################
Expand Down Expand Up @@ -251,14 +250,16 @@ sub reply_handler {
}

sub dns_server_daemon {
eval { require Net::DNS::Nameserver; };

my $ns = new Net::DNS::Nameserver(
LocalAddr => '127.0.0.1',
LocalPort => 53530,
ReplyHandler => \&reply_handler,
Verbose => 0
) or die "couldn't create nameserver object\n";

$ns->main_loop;
$ns->start_server;
}

###############################################################################
5 changes: 3 additions & 2 deletions tests/nginx-tests/tengine-tests/vnswrr4dynamic_ups.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ BEGIN { use FindBin; chdir($FindBin::Bin); }

use lib 'lib';
use Test::Nginx;
eval { require Net::DNS::Nameserver; };
plan(skip_all => 'Net::DNS::Nameserver not installed') if $@;

###############################################################################
Expand Down Expand Up @@ -248,14 +247,16 @@ sub reply_handler {
}

sub dns_server_daemon {
eval { require Net::DNS::Nameserver; };

my $ns = new Net::DNS::Nameserver(
LocalAddr => '127.0.0.1',
LocalPort => 53530,
ReplyHandler => \&reply_handler,
Verbose => 0
) or die "couldn't create nameserver object\n";

$ns->main_loop;
$ns->start_server;
}

###############################################################################

0 comments on commit 2184fbc

Please sign in to comment.