Browse Source

[1213] Add skeleton for second test

Stephen Morris 13 years ago
parent
commit
a46eed49d4

+ 3 - 0
configure.ac

@@ -969,6 +969,8 @@ AC_OUTPUT([doc/version.ent
            tests/system/ixfr/common_tests.sh
            tests/system/ixfr/in-1/setup.sh
            tests/system/ixfr/in-1/nsx2/b10-config.db
+           tests/system/ixfr/in-2/setup.sh
+           tests/system/ixfr/in-2/nsx2/b10-config.db
           ], [
            chmod +x src/bin/cmdctl/run_b10-cmdctl.sh
            chmod +x src/bin/xfrin/run_b10-xfrin.sh
@@ -1001,6 +1003,7 @@ AC_OUTPUT([doc/version.ent
            chmod +x tests/system/ixfr/ixfr_init.sh
            chmod +x tests/system/ixfr/common_tests.sh
            chmod +x tests/system/ixfr/in-1/setup.sh
+           chmod +x tests/system/ixfr/in-2/setup.sh
           ])
 AC_OUTPUT
 

+ 1 - 1
tests/system/cleanall.sh

@@ -27,7 +27,7 @@ find . -type f \( \
 
 status=0
 
-for d in `find . -type d -maxdepth 1 -mindepth 1 -print`
+for d in `find . -maxdepth 2 -mindepth 1 -type d -print`
 do
    test ! -f $d/clean.sh || ( cd $d && sh clean.sh )
 done

+ 1 - 1
tests/system/conf.sh.in

@@ -51,7 +51,7 @@ export RNDC=$BIND9_TOP/bin/rndc/rndc
 export TESTSOCK=$BIND9_TOP/bin/tests/system/testsock.pl
 export DIGCOMP=$BIND9_TOP/bin/tests/system/digcomp.pl
 
-export SUBDIRS="bindctl glue ixfr/in-1"
+export SUBDIRS="bindctl glue ixfr/in-1 ixfr/in-2"
 #SUBDIRS="dnssec masterfile xfer"
 
 # PERL will be an empty string if no perl interpreter was found.  A similar

+ 10 - 0
tests/system/ixfr/README

@@ -0,0 +1,10 @@
+The directories in-1 to in-4 implement the following tests:
+
+in-1: Check that BIND 10 can receive IXFR in a single UDP packet.
+in-2: Check that BIND 10 can receive IXFR via TCP.
+in-3: Check that BIND 10 will request AXFR if the server does not support IXFR.
+in-4: Check that BIND 10 will request IXFR when its SOA refresh times out
+
+The tests are described more fully in the document:
+
+http://bind10.isc.org/wiki/IxfrSystemTests

+ 4 - 4
tests/system/ixfr/common_tests.sh.in

@@ -56,12 +56,12 @@ status=0
 
 # Store the SOA serial number of the BIND 10 client for later use.
 old_client_serial=`$DIG_SOA @$CLIENT_IP | $AWK '{print $3}'`
-echo "I:SOA serial of IXFR client is $old_client_serial"
+echo "I:SOA serial of IXFR client $CLIENT_NAME is $old_client_serial"
 
 # 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"
+echo "I:updating IXFR-server $SERVER_NAME for ixfr-in tests"
 update_server_zone $SERVER_NAME $SERVER_IP $IXFR_TOP/largezone_n-2.db
 if [ $? != 0 ];
 then
@@ -82,7 +82,7 @@ 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"
+echo "I:notifying IXFR-client $CLIENT_NAME of presence of new version of zone"
 cp ns1/named_notify.conf ns1/named.conf
 
 do_rndc $SERVER_NAME $SERVER_IP reconfig
@@ -110,7 +110,7 @@ client_serial=`$DIG_SOA @$CLIENT_IP | $AWK '{print $3}'`
 server_serial=`$DIG_SOA @$SERVER_IP | $AWK '{print $3}'`
 if [ "$client_serial" != "$server_serial" ];
 then
-    echo "R:FAIL client serial not same as server serial after update"
+    echo "R:FAIL client serial $client_serial not same as server serial $server_serial after update"
     status=1
 fi
 

+ 1 - 4
tests/system/ixfr/in-1/clean.sh

@@ -15,14 +15,11 @@
 # 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/bind10.run
 rm -f nsx2/zone.sqlite3

+ 1 - 1
tests/system/ixfr/in-1/setup.sh.in

@@ -28,4 +28,4 @@ cp -f $IXFR_TOP/largezone_n-4.db ns1/zone.db
 
 # Set up the IXFR client - load the same version of the zone.
 
-${B10_LOADZONE} -o . -d @builddir@/nsx2/zone.sqlite3 $IXFR_TOP/largezone_n-4.db
+${B10_LOADZONE} -o . -d @builddir@/nsx2/zone.sqlite3 $IXFR_TOP/largezone_n-6.db

+ 25 - 0
tests/system/ixfr/in-2/clean.sh

@@ -0,0 +1,25 @@
+#!/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.
+
+# Clean up after zone transfer tests.
+
+rm -f ns1/named.conf
+rm -f ns1/largezone.db
+rm -f ns1/named.memstats
+
+rm -f nsx2/bind10.run
+rm -f nsx2/zone.sqlite3

+ 39 - 0
tests/system/ixfr/in-2/ns1/named_nonotify.conf

@@ -0,0 +1,39 @@
+/*
+ * 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";
+};

+ 40 - 0
tests/system/ixfr/in-2/ns1/named_notify.conf

@@ -0,0 +1,40 @@
+/*
+ * 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";
+};

+ 6 - 0
tests/system/ixfr/in-2/nsx2/b10-config.db.in

@@ -0,0 +1,6 @@
+{"version": 2,
+ "Auth": {
+   "listen_on": [{"address": "10.53.0.2", "port": 53210}],
+   "database_file": "@abs_builddir@/zone.sqlite3"
+ }
+}

+ 31 - 0
tests/system/ixfr/in-2/setup.sh

@@ -0,0 +1,31 @@
+#!/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.
+
+. /home/stephen/bind10/tests/system/conf.sh
+
+# Clean up from last time
+
+sh clean.sh
+
+# Set up the initial version of 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 - load the same version of the zone.
+
+${B10_LOADZONE} -o . -d ./nsx2/zone.sqlite3 $IXFR_TOP/largezone_n-4.db

+ 31 - 0
tests/system/ixfr/in-2/setup.sh.in

@@ -0,0 +1,31 @@
+#!/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 initial version of 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 - load the same version of the zone.
+
+${B10_LOADZONE} -o . -d @builddir@/nsx2/zone.sqlite3 $IXFR_TOP/largezone_n-4.db

+ 37 - 0
tests/system/ixfr/in-2/tests.sh

@@ -0,0 +1,37 @@
+#!/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.
+
+# \file
+# 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 pre-requisites for this test are the same as for the common tests, so
+# we can execute that directly.
+
+. ../common_tests.sh
+status=$?
+
+# TODO: Check the BIND 10 log, looking for the IXFR messages that indicate that
+# it has initiated an IXFR and that it received the update via TCP.
+
+echo "I:exit status: $status"
+exit $status