Commit 2298392e authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[trac606] Merge commit '309d02a5' (in a personal branch) into trac606...

[trac606] Merge commit '309d02a5' (in a personal branch) into trac606 with resolving conflicts.

This commit adjusts test framework so that it will work with BIND 10.

Conflicts:
	tests/system/start.pl
	tests/system/stop.pl
parents ddd7b7c3 309d02a5
......@@ -26,7 +26,8 @@ SYSTEMTESTTOP=.
find . -type f \( \
-name 'K*' -o -name '*~' -o -name '*.core' -o -name '*.log' \
-o -name '*.pid' -o -name '*.keyset' -o -name named.run \
-o -name lwresd.run -o -name ans.run \) -print | xargs rm -f
-o name bind10.run -o -name lwresd.run -o -name ans.run \) -print | \
xargs rm -f
status=0
......
......@@ -20,56 +20,18 @@
# other shell scripts.
#
# Find the top of the BIND9 tree.
TOP=${SYSTEMTESTTOP:=.}/../../..
# Find the top of the source tree.
TOP=@abs_top_srcdir@
# Make it absolute so that it continues to work after we cd.
TOP=`cd $TOP && pwd`
RUN_BIND10=$TOP/src/bin/bind10/run_bind10.sh
B10_LOADZONE=$TOP/src/bin/loadzone/run_loadzone.sh
BIND9_NAMED=$BIND9_TOP/bin/named/named
DIG=$BIND9_TOP/bin/dig/dig
NAMED=$TOP/bin/named/named
# We must use "named -l" instead of "lwresd" because argv[0] is lost
# if the program is libtoolized.
LWRESD="$TOP/bin/named/named -l"
DIG=$TOP/bin/dig/dig
RNDC=$TOP/bin/rndc/rndc
NSUPDATE=$TOP/bin/nsupdate/nsupdate
DDNSCONFGEN=$TOP/bin/confgen/ddns-confgen
KEYGEN=$TOP/bin/dnssec/dnssec-keygen
KEYFRLAB=$TOP/bin/dnssec/dnssec-keyfromlabel
SIGNER=$TOP/bin/dnssec/dnssec-signzone
REVOKE=$TOP/bin/dnssec/dnssec-revoke
SETTIME=$TOP/bin/dnssec/dnssec-settime
DSFROMKEY=$TOP/bin/dnssec/dnssec-dsfromkey
CHECKZONE=$TOP/bin/check/named-checkzone
CHECKCONF=$TOP/bin/check/named-checkconf
PK11GEN="$TOP/bin/pkcs11/pkcs11-keygen -s 0 -p 1234"
PK11LIST="$TOP/bin/pkcs11/pkcs11-list -s 0 -p 1234"
PK11DEL="$TOP/bin/pkcs11/pkcs11-destroy -s 0 -p 1234"
JOURNALPRINT=$TOP/bin/tools/named-journalprint
# The "stress" test is not run by default since it creates enough
# load on the machine to make it unusable to other users.
# v6synth
SUBDIRS="acl allow_query addzone autosign cacheclean checkconf checknames
dlv @DLZ_SYSTEM_TEST@ dlzexternal dns64 dnssec forward glue gost ixfr limits
lwresd masterfile masterformat metadata notify nsupdate pending pkcs11
resolver rpz rrsetorder sortlist smartsign staticstub stub tkey
tsig tsiggss unknown upforwd views xfer xferquota zonechecks"
SUBDIRS="glue"
#SUBDIRS="dnssec glue masterfile xfer"
# PERL will be an empty string if no perl interpreter was found.
PERL=@PERL@
if test -n "$PERL"
then
if $PERL -e "use IO::Socket::INET6;" 2> /dev/null
then
TESTSOCK6="$PERL $TOP/bin/tests/system/testsock6.pl"
else
TESTSOCK6=false
fi
else
TESTSOCK6=false
fi
export NAMED LWRESD DIG NSUPDATE KEYGEN KEYFRLAB SIGNER KEYSIGNER KEYSETTOOL \
PERL SUBDIRS RNDC CHECKZONE PK11GEN PK11LIST PK11DEL TESTSOCK6 \
JOURNALPRINT
export RUN_BIND10 BIND9_NAMED DIG SUBDIRS PERL
......@@ -23,7 +23,7 @@
#
config_guess=""
for f in ./config.guess ../../../config.guess
for f in ./config.guess ../../config.guess
do
if test -f $f
then
......
......@@ -52,6 +52,7 @@ if ($server && !-d "$test/$server") {
# Global variables
my $topdir = abs_path("$test/..");
my $testdir = abs_path("$test");
my $RUN_BIND10 = $ENV{'RUN_BIND10'};
my $NAMED = $ENV{'NAMED'};
my $LWRESD = $ENV{'LWRESD'};
my $DIG = $ENV{'DIG'};
......@@ -73,17 +74,17 @@ if ($server) {
my @files = sort readdir DIR;
closedir DIR;
my @ns = grep /^ns[0-9]*$/, @files;
my @ns = grep /^nsx?[0-9]*$/, @files;
my @lwresd = grep /^lwresd[0-9]*$/, @files;
my @ans = grep /^ans[0-9]*$/, @files;
# Start the servers we found.
&check_ports();
foreach (@ns, @lwresd, @ans) {
&start_server($_);
foreach my $s (@ns, @lwresd, @ans) {
&start_server($s);
}
foreach (@ns) {
&verify_server($_);
foreach my $s (@ns) {
&verify_server($s);
}
}
......@@ -121,7 +122,20 @@ sub start_server {
my $command;
my $pid_file;
if ($server =~ /^ns/) {
if ($server =~ /^nsx/) {
$cleanup_files = "{bind10.run}";
$command = "B10_FROM_SOURCE_CONFIG_DATA_PATH=$testdir/$server/ ";
$command .= "$RUN_BIND10 ";
if ($options) {
$command .= "$options";
} else {
$command .= "--msgq-socket-file=$testdir/$server/msgq_socket ";
$command .= "--pid-file=$testdir/$server/bind10.pid ";
$command .= "-v";
}
$command .= " >bind10.run 2>&1 &";
$pid_file = "bind10.pid";
} elsif ($server =~ /^ns/) {
$cleanup_files = "{*.jnl,*.bk,*.st,named.run}";
$command = "$NAMED ";
if ($options) {
......@@ -192,7 +206,7 @@ sub start_server {
sub verify_server {
my $server = shift;
my $n = $server;
$n =~ s/^ns//;
$n =~ s/^nsx?//;
my $tries = 0;
while (1) {
......
......@@ -64,7 +64,7 @@ if (defined $server) {
my @files = sort readdir DIR;
closedir DIR;
my @ns = grep /^ns[0-9]*$/, @files;
my @ns = grep /^nsx?[0-9]*$/, @files;
my @lwresd = grep /^lwresd[0-9]*$/, @files;
my @ans = grep /^ans[0-9]*$/, @files;
......@@ -103,7 +103,9 @@ sub server_pid_file {
my($server) = @_;
my $pid_file;
if ($server =~ /^ns/) {
if ($server =~ /^nsx/) {
$pid_file = "bind10.pid";
} elsif ($server =~ /^ns/) {
$pid_file = "named.pid";
} elsif ($server =~ /^lwresd/) {
$pid_file = "lwresd.pid";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment