diff --git a/tests/nginx-tests/tengine-tests/dynamic_resolve.t b/tests/nginx-tests/tengine-tests/dynamic_resolve.t index 262b3000a1..dc13463fde 100644 --- a/tests/nginx-tests/tengine-tests/dynamic_resolve.t +++ b/tests/nginx-tests/tengine-tests/dynamic_resolve.t @@ -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 $@; ############################################################################### @@ -251,6 +250,8 @@ 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, @@ -258,7 +259,7 @@ sub dns_server_daemon { Verbose => 0 ) or die "couldn't create nameserver object\n"; - $ns->main_loop; + $ns->start_server; } ############################################################################### diff --git a/tests/nginx-tests/tengine-tests/vnswrr4dynamic_ups.t b/tests/nginx-tests/tengine-tests/vnswrr4dynamic_ups.t index d0e17b1a06..37db8894b5 100644 --- a/tests/nginx-tests/tengine-tests/vnswrr4dynamic_ups.t +++ b/tests/nginx-tests/tengine-tests/vnswrr4dynamic_ups.t @@ -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 $@; ############################################################################### @@ -248,6 +247,8 @@ 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, @@ -255,7 +256,7 @@ sub dns_server_daemon { Verbose => 0 ) or die "couldn't create nameserver object\n"; - $ns->main_loop; + $ns->start_server; } ###############################################################################