mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-01 15:05:23 +00:00
added ability to set named params through "named.args" file
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||||
# PERFORMANCE OF THIS SOFTWARE.
|
# PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
# $Id: start.pl,v 1.24 2011/05/05 23:15:56 smann Exp $
|
# $Id: start.pl,v 1.25 2011/10/09 22:47:15 smann Exp $
|
||||||
|
|
||||||
# Framework for starting test servers.
|
# Framework for starting test servers.
|
||||||
# Based on the type of server specified, check for port availability, remove
|
# Based on the type of server specified, check for port availability, remove
|
||||||
@@ -23,6 +23,7 @@
|
|||||||
# If a server is specified, start it. Otherwise, start all servers for test.
|
# If a server is specified, start it. Otherwise, start all servers for test.
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
|
use Cwd;
|
||||||
use Cwd 'abs_path';
|
use Cwd 'abs_path';
|
||||||
use Getopt::Long;
|
use Getopt::Long;
|
||||||
|
|
||||||
@@ -35,6 +36,12 @@ use Getopt::Long;
|
|||||||
# options - alternate options for the server
|
# options - alternate options for the server
|
||||||
# NOTE: options must be specified with '-- "<option list>"',
|
# NOTE: options must be specified with '-- "<option list>"',
|
||||||
# for instance: start.pl . ns1 -- "-c n.conf -d 43"
|
# for instance: start.pl . ns1 -- "-c n.conf -d 43"
|
||||||
|
# ALSO NOTE: this variable will be filled with the
|
||||||
|
# contents of the first non-commented/non-blank line of args
|
||||||
|
# in a file called "named.args" in an ns*/ subdirectory only
|
||||||
|
# the FIRST non-commented/non-blank line is used (everything
|
||||||
|
# else in the file is ignored. If "options" is already set,
|
||||||
|
# then "named.args" is ignored.
|
||||||
|
|
||||||
my $usage = "usage: $0 [--noclean] [--restart] test-directory [server-directory [server-options]]";
|
my $usage = "usage: $0 [--noclean] [--restart] test-directory [server-directory [server-options]]";
|
||||||
my $noclean = '';
|
my $noclean = '';
|
||||||
@@ -81,14 +88,15 @@ if ($server) {
|
|||||||
my @ns = grep /^ns[0-9]*$/, @files;
|
my @ns = grep /^ns[0-9]*$/, @files;
|
||||||
my @lwresd = grep /^lwresd[0-9]*$/, @files;
|
my @lwresd = grep /^lwresd[0-9]*$/, @files;
|
||||||
my @ans = grep /^ans[0-9]*$/, @files;
|
my @ans = grep /^ans[0-9]*$/, @files;
|
||||||
|
my $name;
|
||||||
|
|
||||||
# Start the servers we found.
|
# Start the servers we found.
|
||||||
&check_ports();
|
&check_ports();
|
||||||
foreach (@ns, @lwresd, @ans) {
|
foreach $name(@ns, @lwresd, @ans) {
|
||||||
&start_server($_);
|
&start_server($name);
|
||||||
}
|
}
|
||||||
foreach (@ns) {
|
foreach $name(@ns) {
|
||||||
&verify_server($_);
|
&verify_server($name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,12 +133,26 @@ sub start_server {
|
|||||||
my $cleanup_files;
|
my $cleanup_files;
|
||||||
my $command;
|
my $command;
|
||||||
my $pid_file;
|
my $pid_file;
|
||||||
|
my $args_file = getcwd() . "/" . $test . "/" . $server . "/" . "named.args";
|
||||||
|
|
||||||
if ($server =~ /^ns/) {
|
if ($server =~ /^ns/) {
|
||||||
$cleanup_files = "{*.jnl,*.bk,*.st,named.run}";
|
$cleanup_files = "{*.jnl,*.bk,*.st,named.run}";
|
||||||
$command = "$NAMED ";
|
$command = "$NAMED ";
|
||||||
if ($options) {
|
if ($options) {
|
||||||
$command .= "$options";
|
$command .= "$options";
|
||||||
|
} elsif (-e $args_file) {
|
||||||
|
open(FH, "<", $args_file);
|
||||||
|
while(my $line=<FH>)
|
||||||
|
{
|
||||||
|
$line =~ s/\R//g;
|
||||||
|
next if ($line =~ /^\s*$/); #discard blank lines
|
||||||
|
next if ($line =~ /^\s*#/); #discard comment lines
|
||||||
|
$line =~ s/#.*$//g;
|
||||||
|
$options = $line;
|
||||||
|
last;
|
||||||
|
}
|
||||||
|
close FH;
|
||||||
|
$command .= "$options";
|
||||||
} else {
|
} else {
|
||||||
$command .= "-m record,size,mctx ";
|
$command .= "-m record,size,mctx ";
|
||||||
$command .= "-T clienttest ";
|
$command .= "-T clienttest ";
|
||||||
@@ -188,7 +210,7 @@ sub start_server {
|
|||||||
exit 1;
|
exit 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
# print "I:starting server $server\n";
|
# print "I:starting server %s\n",$server;
|
||||||
|
|
||||||
chdir "$testdir/$server";
|
chdir "$testdir/$server";
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user