use Getopt::Long;
# Usage:
-# perl start.pl [--noclean] --restart] [--port port] test [server [options]]
+# perl start.pl [--noclean] [--restart] [--port port] test [server [options]]
#
# --noclean Do not cleanup files in server directory.
#
# "named" nameservers, this can be overridden by the presence
# of the file "named.port" in the server directory containing
# the number of the query port.)
-#
+#
# test Name of the test directory.
#
# server Name of the server directory. This will be of the form
# If not given, the script will start all the servers in the
# test directory.
#
-# options Alternate options for the server,
+# options Alternate options for the server.
#
# NOTE: options must be specified with '-- "<option list>"',
# 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.
+# 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] [--port <port>] test-directory [server-directory [server-options]]";
my $noclean = '';
my $restart = '';
-my $defaultport = 5300;
+my $queryport = 5300;
-GetOptions('noclean' => \$noclean, 'restart' => \$restart, 'port=i' => \$defaultport) or die "$usage\n";
+GetOptions('noclean' => \$noclean, 'restart' => \$restart, 'port=i' => \$queryport) or die "$usage\n";
my $test = $ARGV[0];
my $server = $ARGV[1];
foreach $name(@ns, @ans) {
&start_server($name);
&verify_server($name) if ($name =~ /^ns/);
-
}
}
sub check_ports {
my $server = shift;
my $options = "";
- my $port = $defaultport;
+ my $port = $queryport;
my $file = "";
$file = $testdir . "/" . $server . "/named.port" if ($server);
$command .= "-X named.lock ";
$command .= "-m record,size,mctx ";
$command .= "-T clienttest ";
- $command .= "-T nosoa "
+ $command .= "-T nosoa "
if (-e "$testdir/$server/named.nosoa");
- $command .= "-T noaa "
+ $command .= "-T noaa "
if (-e "$testdir/$server/named.noaa");
- $command .= "-T noedns "
+ $command .= "-T noedns "
if (-e "$testdir/$server/named.noedns");
- $command .= "-T dropedns "
+ $command .= "-T dropedns "
if (-e "$testdir/$server/named.dropedns");
- $command .= "-T maxudp512 "
+ $command .= "-T maxudp512 "
if (-e "$testdir/$server/named.maxudp512");
- $command .= "-T maxudp1460 "
+ $command .= "-T maxudp1460 "
if (-e "$testdir/$server/named.maxudp1460");
$command .= "-c named.conf -d 99 -g -U 4";
}
} elsif ($server =~ /^ans/) {
$cleanup_files = "{ans.run}";
if (-e "$testdir/$server/ans.py") {
- $command = "$PYTHON -u ans.py 10.53.0.$' $defaultport";
+ $command = "$PYTHON -u ans.py 10.53.0.$' $queryport";
} elsif (-e "$testdir/$server/ans.pl") {
$command = "$PERL ans.pl";
} else {
sub verify_server {
my $server = shift;
my $n = $server;
- my $port = $defaultport;
+ my $port = $queryport;
my $tcp = "+tcp";
$n =~ s/^ns//;
use Getopt::Long;
# Usage:
-# perl stop.pl [[-use-rndc] [--port port] test [server]
+# perl stop.pl [-use-rndc [--port port]] test [server]
#
# --use-rndc Attempt to stop the server via the "rndc stop" command.
#
# command port over which the attempt should be made. If
# not specified, port 9953 is used.
#
-# test Name of the test directory,
+# test Name of the test directory.
#
-# server Name of the server directory
+# server Name of the server directory.
-my $usage = "usage: $0 [--use-rndc] [--port port] test-directory [server-directory]";
+my $usage = "usage: $0 [--use-rndc [--port port]] test-directory [server-directory]";
my $use_rndc = 0;
my $port = 9953;
die "$usage\n" unless defined($test);
die "No test directory: \"$test\"\n" unless (-d $test);
die "No server directory: \"$server\"\n" if (defined($server) && !-d "$test/$server");
-
+
# Global variables
my $testdir = abs_path($test);
my @servers;