Commit f1a85d0c authored by Stephen Morris's avatar Stephen Morris
Browse files

[1213] Initial commit of changes

The ixfr tests are in the tools/system/ixfr directory.  To simplify
things, each test is in a subdirectory of that, with the common
data files in ixfr itself.

This commit got the starting and stopping of the nameservers for the
first test running, and created some basic data files.
parent 8fe024cd
......@@ -767,6 +767,8 @@ fi
#
AC_PATH_PROGS(PERL, perl5 perl)
AC_SUBST(PERL)
AC_PATH_PROGS(AWK, gawk awk)
AC_SUBST(AWK)
AC_ARG_ENABLE(man, [AC_HELP_STRING([--enable-man],
[regenerate man pages [default=no]])], enable_man=yes, enable_man=no)
......@@ -959,9 +961,13 @@ AC_OUTPUT([doc/version.ent
src/lib/util/python/gen_wiredata.py
src/lib/server_common/tests/data_path.h
tests/system/conf.sh
tests/system/run.sh
tests/system/glue/setup.sh
tests/system/glue/nsx1/b10-config.db
tests/system/bindctl/nsx1/b10-config.db.template
tests/system/ixfr/in-1/setup.sh
tests/system/ixfr/in-1/tests.sh
tests/system/ixfr/in-1/nsx2/b10-config.db
], [
chmod +x src/bin/cmdctl/run_b10-cmdctl.sh
chmod +x src/bin/xfrin/run_b10-xfrin.sh
......@@ -990,6 +996,9 @@ AC_OUTPUT([doc/version.ent
chmod +x src/lib/util/python/gen_wiredata.py
chmod +x src/lib/python/isc/log/tests/log_console.py
chmod +x tests/system/conf.sh
chmod +x tests/system/run.sh
chmod +x tests/system/ixfr/in-1/setup.sh
chmod +x tests/system/ixfr/in-1/tests.sh
])
AC_OUTPUT
......
/*
* Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000, 2001 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
options {
default-key "rndc_key";
};
key rndc_key {
algorithm hmac-md5;
secret "1234abcd8765";
};
/*
* Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC")
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: rndc.key,v 1.3 2011-03-12 04:59:47 tbox Exp $ */
key rndc_key {
secret "1234abcd8765";
algorithm hmac-md5;
};
......@@ -35,23 +35,34 @@ if [ -z $BIND9_TOP ]; then
fi
# Find the top of the source and test trees.
TOP=@abs_top_srcdir@
TEST_TOP=@abs_builddir@
RUN_BIND10=$TOP/src/bin/bind10/run_bind10.sh
RUN_BINDCTL=$TOP/src/bin/bindctl/run_bindctl.sh
BINDCTL_CSV_DIR=@abs_srcdir@/common/
B10_LOADZONE=$TOP/src/bin/loadzone/run_loadzone.sh
BIND9_NAMED=$BIND9_TOP/bin/named/named
DIG=$BIND9_TOP/bin/dig/dig
export TOP=@abs_top_srcdir@
export TEST_TOP=@abs_builddir@
# Programs
export RUN_BIND10=$TOP/src/bin/bind10/run_bind10.sh
export RUN_BINDCTL=$TOP/src/bin/bindctl/run_bindctl.sh
export BINDCTL_CSV_DIR=@abs_srcdir@/common/
export B10_LOADZONE=$TOP/src/bin/loadzone/run_loadzone.sh
export BIND9_NAMED=$BIND9_TOP/bin/named/named
export DIG=$BIND9_TOP/bin/dig/dig
export RNDC=$BIND9_TOP/bin/rndc/rndc
# Test tools borrowed from BIND 9's system test (without change).
TESTSOCK=$BIND9_TOP/bin/tests/system/testsock.pl
DIGCOMP=$BIND9_TOP/bin/tests/system/digcomp.pl
export TESTSOCK=$BIND9_TOP/bin/tests/system/testsock.pl
export DIGCOMP=$BIND9_TOP/bin/tests/system/digcomp.pl
SUBDIRS="bindctl glue"
export SUBDIRS="bindctl glue"
#SUBDIRS="dnssec masterfile xfer"
# PERL will be an empty string if no perl interpreter was found.
PERL=@PERL@
# PERL will be an empty string if no perl interpreter was found. A similar
# comment applies to AWK.
export PERL=@PERL@
export AWK=@AWK@
# Other constants
export RNDC_PORT=9953
export DNS_PORT=53210
export RUN_BIND10 BIND9_NAMED DIG SUBDIRS PERL TESTSOCK
export TESTS_TOP=$TOP/tests
export SYSTEM_TOP=$TESTS_TOP/system
export IXFR_TOP=$SYSTEM_TOP/ixfr
#!/bin/sh
#
# Copyright (C) 2004, 2007, 2011 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 2000, 2001 Internet Software Consortium.
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
# $Id: clean.sh,v 1.14.732.2 2011-03-12 04:59:15 tbox Exp $
#
# Clean up after zone transfer tests.
#
rm -f ns1/named.conf
rm -f ns1/largezone.db
rm -f ns1/named.memstats
rm -f nsx2/zone.sqlite3
/*
* Copyright (C) 2004, 2007, 2011 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000, 2001 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
include "../../../common/rndc.key";
controls {
inet 10.53.0.1 port 9953 allow { any; } keys { rndc_key; };
};
options {
query-source address 10.53.0.1;
notify-source 10.53.0.1;
transfer-source 10.53.0.1;
port 53210;
pid-file "named.pid";
listen-on { 10.53.0.1; };
listen-on-v6 { none; };
recursion no;
notify no;
};
zone "example" {
type master;
file "zone.db";
};
/*
* Copyright (C) 2004, 2007, 2011 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000, 2001 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
include ".../../../common/rndc.key";
controls {
inet 10.53.0.1 port 9953 allow { any; } keys { rndc_key; };
};
options {
query-source address 10.53.0.1;
notify-source 10.53.0.1;
transfer-source 10.53.0.1;
port 53210;
pid-file "named.pid";
listen-on { 10.53.0.1; };
listen-on-v6 { none; };
recursion no;
notify explicit;
also-notify { 10.53.0.2; };
};
zone "example" {
type master;
file "zone.db";
};
{"version": 2,
"Auth": {
"listen_on": [{"address": "10.53.0.2", "port": 53210}],
"database_file": "@abs_builddir@/zone.sqlite3"
}
}
#!/bin/sh
#
# Copyright (C) 2004, 2007, 2011 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 2001, 2002 Internet Software Consortium.
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
. @abs_top_builddir@/tests/system/conf.sh
# Clean up from last time
sh clean.sh
# Set up the IXFR server - Load an old version of the zone.
cp -f ns1/named_nonotify.conf ns1/named.conf
cp -f $IXFR_TOP/largezone_n-4.db ns1/zone.db
# Set up the IXFR client
${B10_LOADZONE} -o . -d @builddir@/nsx2/zone.sqlite3 $IXFR_TOP/largezone_n-4.db
#!/bin/sh
#
# Copyright (C) 2004, 2005, 2007, 2011 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 2000, 2001 Internet Software Consortium.
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
# This script performs the first IXFR-IN test. A BIND 9 nameserver (the
# "server") contains a version of the zone (version N) and two previous
# versions, N-2 and N-4. A BIND 10 nameserver (the "client") is loaded with
# version N-2 of the zone. A NOTIFY is sent to it, and it is expected that
# it will send an IXFR to the server and update itself with the latest version
# of the zone. (The changes are such that the update should be in the form of
# a single UDP packet.)
#
# The code checks that the zones are identical, and checks the BIND 10 log
# file to ensure that the debug message recording the sending of the IXFR
# request and the receipt of the single update is recorded.
. @abs_top_builddir@/tests/system/conf.sh
IXFR_SERVER=10.53.0.1 # BIND 9
IXFR_CLIENT=10.53.0.2 # BIND 10
# Short-hand for getting SOA - just supply address of the server
DIG_SOA="$DIG +norecurse +short -p $DNS_PORT example. SOA"
status=0
# do_rndc
#
# Controls the BIND 9 IXFR server. Called do_rndc (instead of rndc) to avoid
# confusion if rndc itself is in the search path.
#
# $* - Command to execute (which may be multiple tokens)
do_rndc () {
$RNDC -c $SYSTEM_TOP/common/rndc.conf -s $IXFR_SERVER -p $RNDC_PORT $* 2>&1 \
| sed 's/^/I:ns1 /'
}
# wait_for_update
#
# Given a serial number and a server, poll the nameserver until the SOA serial
# number is different from that given. The poll takes place every five seconds
# for a minute.
#
# $1 - Server to check
# $2 - Serial number to check against
#
# Returns:
# 0 - Serial number is different (requires another poll to obatin it)
# 1 - Serial number has not changed
wait_for_update() {
for i in 1 2 3 4 5 6 7 8 9 10 11 12
do
new_serial=`$DIG_SOA @$1 | $AWK '{print $3}'`
if [ "$new_serial" != "$2" ];
then
break
fi
sleep 5
done
if [ "$new_serial" = "$2" ];
then
return 1
fi
return 0
}
# update_server_zone
#
# Reloads the example. zone in the IXFR server and waits a maximum of 50
# seconds for it to be served.
#
# $1 - Name of new zone file (should be in the default directory).
update_server_zone() {
old_serial=`$DIG_SOA @$IXFR_SERVER | $AWK '{print $3}'`
echo "I:ns1 IXFR server loading $1"
cp $1 ns1/zone.db
do_rndc reload
wait_for_update $IXFR_SERVER $old_serial
if [ $? -ne 0 ];
then
echo "R:ns1 FAIL IXFR server did not update zone after reload"
return 1
fi
new_serial=`$DIG_SOA @$IXFR_SERVER | $AWK '{print $3}'`
echo "R:ns1 IXFR server was at serial $old_serial, now at $new_serial"
return 0
}
# The current state of the nameservers is that they should both be running the
# "n - 4" version of the zone.
#
# Load the BIND 9 system (the IXFR server) with the "n - 2" and "n" version of
# the zones. With ixfr-from-differences set to "yes", the nameserver should
# generate the differences between them.
echo "I:updating IXFR-server for ixfr-in tests"
update_server_zone $IXFR_TOP/largezone_n-2.db
if [ $? != 0 ]; then
status=1
fi
# Wait a bit - it seems that if two updates are loaded in quick succession,
# the second sometimes gets lost.
sleep 5
update_server_zone $IXFR_TOP/largezone_n-0.db
if [ $? != 0 ]; then
status=1
fi
# Get the IXFR server to notify the slave server of the new zone. Do this by
# allowing notifies and then triggering a re-notification of the server.
echo "I:notifying IXFR-client of presence of new zones"
cp ns1/named_notify.conf ns1/named.conf
do_rndc reconfig
do_rndc notify example
# Store the SOA serial number of the latest zone in the BIND 9 server
server_serial=`$DIG_SOA @$IXFR_SERVER | $AWK '{print $3}'`
echo "I:SOA serial of IXFR server is $server_serial"
client_serial=`$DIG_SOA @$IXFR_CLIENT | $AWK '{print $3}'`
echo "I:SOA serial of IXFR client is $client_serial"
# Now compare the two zones - they should be the same.
# Check the BIND 10 log, looking for the IXFR messages that
# indicate that it has initiated an IXFR.
echo "I:exit status: $status"
exit $status
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
; Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
; Copyright (C) 2000, 2001 Internet Software Consortium.
;
; Permission to use, copy, modify, and/or distribute this software for any
; purpose with or without fee is hereby granted, provided that the above
; copyright notice and this permission notice appear in all copies.
;
; THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
; REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
; AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
; INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
; LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
; OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
; PERFORMANCE OF THIS SOFTWARE.
$ORIGIN example.
$TTL 3600
@ IN SOA ns2.example. hostmaster.example. 92 5 5 1814400 3600
IN NS ns2.example.
IN NS ns3.example.
www IN A 192.0.2.1
......@@ -19,8 +19,8 @@
# Run a system test.
#
SYSTEMTESTTOP=.
. $SYSTEMTESTTOP/conf.sh
SYSTEMTOP=@abs_top_builddir@/tests/system
. $SYSTEMTOP/conf.sh
stopservers=true
......@@ -87,7 +87,7 @@ then
fi
# Start name servers running
$PERL start.pl $test || exit 1
$PERL $SYSTEMTOP/start.pl $test || exit 1
# Run the tests
( cd $test ; sh tests.sh )
......@@ -102,7 +102,7 @@ else
fi
# Shutdown
$PERL stop.pl $test
$PERL $SYSTEMTOP/stop.pl $test
status=`expr $status + $?`
......
......@@ -53,7 +53,7 @@ if ($server && !-d "$test/$server") {
my $topdir = abs_path("$test/..");
my $testdir = abs_path("$test");
my $RUN_BIND10 = $ENV{'RUN_BIND10'};
my $NAMED = $ENV{'NAMED'};
my $NAMED = $ENV{'BIND9_NAMED'};
my $LWRESD = $ENV{'LWRESD'};
my $DIG = $ENV{'DIG'};
my $PERL = $ENV{'PERL'};
......@@ -182,7 +182,7 @@ sub start_server {
exit 1;
}
# print "I:starting server $server\n";
print "I:starting server $server\n";
chdir "$testdir/$server";
......
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