BIND 10 trac1213, updated. 6c2de9d212bbb3193304a1ae4fd54ca9137262ff [1213] Force git to keep nsx2 directories in the build tree

BIND 10 source code commits bind10-changes at lists.isc.org
Mon Oct 10 18:30:53 UTC 2011


The branch, trac1213 has been updated
       via  6c2de9d212bbb3193304a1ae4fd54ca9137262ff (commit)
       via  a95e95882763d10fac105a93826d79d5ebe4a449 (commit)
      from  19722a540a20a2dc5370df4d8f1f0bb326175001 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 6c2de9d212bbb3193304a1ae4fd54ca9137262ff
Author: Stephen Morris <stephen at isc.org>
Date:   Mon Oct 10 18:57:58 2011 +0100

    [1213] Force git to keep nsx2 directories in the build tree

commit a95e95882763d10fac105a93826d79d5ebe4a449
Author: Stephen Morris <stephen at isc.org>
Date:   Mon Oct 10 18:44:13 2011 +0100

    [1213] Changes to get BIND 10 to perform IXFR
    
    At the time of commit, BIND 10 can only do IXFR if requested through
    the "Xfrin retransfer" command.  Also, it only does IXFRs over TCP.
    It does not do IXFRs over UDP, not can it respond to NOTIFYs or send
    an IXFR request when the refresh timer expires.
    
    In these changes:
    
    1) Only test in-2 is finished.  (Even then, not fully: BIND 10 does
    not attempt a UDP IXFR before reverting to TCP, it initiates a TCP
    session immediately.) The remaining tests test features that have not
    been implemented yet.
    
    2) The BIND 10 configuration database is now copied to the nsx2
    directories before each test (so there is now only one copy of it).
    The zone.sqlite3 database now resides in the "ixfr" test directory.

-----------------------------------------------------------------------

Summary of changes:
 configure.ac                                     |    5 +--
 tests/system/conf.sh.in                          |    4 +-
 tests/system/ixfr/b10-config.db.in               |   22 ++++++++++
 tests/system/ixfr/clean.sh                       |    2 +-
 tests/system/ixfr/common_tests.sh.in             |   20 ++++-----
 tests/system/ixfr/db.example.n4.in               |    2 +-
 tests/system/ixfr/db.example.n6.in               |    2 +-
 tests/system/ixfr/in-1/{ns1 => nsx2}/README      |    0 
 tests/system/ixfr/in-1/nsx2/b10-config.db.in     |    6 ---
 tests/system/ixfr/in-1/setup.sh.in               |    3 +-
 tests/system/ixfr/{in-1/ns1 => in-2/nsx2}/README |    0 
 tests/system/ixfr/in-2/nsx2/b10-config.db.in     |    6 ---
 tests/system/ixfr/in-2/setup.sh.in               |    3 +-
 tests/system/ixfr/in-2/tests.sh                  |   50 +++++++++++++++++++---
 tests/system/ixfr/{in-1/ns1 => in-3/nsx2}/README |    0 
 tests/system/ixfr/in-3/nsx2/b10-config.db.in     |    6 ---
 tests/system/ixfr/in-3/setup.sh.in               |    3 +-
 tests/system/ixfr/{in-1/ns1 => in-4/nsx2}/README |    0 
 tests/system/ixfr/in-4/nsx2/b10-config.db.in     |    6 ---
 tests/system/ixfr/in-4/setup.sh.in               |    3 +-
 tests/system/ixfr/ixfr_init.sh.in                |   14 ++++---
 21 files changed, 95 insertions(+), 62 deletions(-)
 create mode 100644 tests/system/ixfr/b10-config.db.in
 copy tests/system/ixfr/in-1/{ns1 => nsx2}/README (100%)
 delete mode 100644 tests/system/ixfr/in-1/nsx2/b10-config.db.in
 copy tests/system/ixfr/{in-1/ns1 => in-2/nsx2}/README (100%)
 delete mode 100644 tests/system/ixfr/in-2/nsx2/b10-config.db.in
 copy tests/system/ixfr/{in-1/ns1 => in-3/nsx2}/README (100%)
 delete mode 100644 tests/system/ixfr/in-3/nsx2/b10-config.db.in
 copy tests/system/ixfr/{in-1/ns1 => in-4/nsx2}/README (100%)
 delete mode 100644 tests/system/ixfr/in-4/nsx2/b10-config.db.in

-----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 2b538ea..b5b9256 100644
--- a/configure.ac
+++ b/configure.ac
@@ -971,15 +971,12 @@ AC_OUTPUT([doc/version.ent
            tests/system/ixfr/db.example.n4
            tests/system/ixfr/db.example.n6
            tests/system/ixfr/ixfr_init.sh
+           tests/system/ixfr/b10-config.db
            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
            tests/system/ixfr/in-3/setup.sh
-           tests/system/ixfr/in-3/nsx2/b10-config.db
            tests/system/ixfr/in-4/setup.sh
-           tests/system/ixfr/in-4/nsx2/b10-config.db
           ], [
            chmod +x src/bin/cmdctl/run_b10-cmdctl.sh
            chmod +x src/bin/xfrin/run_b10-xfrin.sh
diff --git a/tests/system/conf.sh.in b/tests/system/conf.sh.in
index 37483e8..92f72fa 100755
--- a/tests/system/conf.sh.in
+++ b/tests/system/conf.sh.in
@@ -51,10 +51,10 @@ 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"
+export SUBDIRS="bindctl glue ixfr/in-2"
 # Add appropriate subdirectories to the above statement as the tests become
 # available.
-#SUBDIRS="dnssec masterfile ixfr/in-1 ixfr/in-2 ixfr/in-2 ixfr/in-4"
+#SUBDIRS="dnssec masterfile ixfr/in-1 ixfr/in-2 ixfr/in-4"
 
 # PERL will be an empty string if no perl interpreter was found.  A similar
 # comment applies to AWK.
diff --git a/tests/system/ixfr/b10-config.db.in b/tests/system/ixfr/b10-config.db.in
new file mode 100644
index 0000000..f83a672
--- /dev/null
+++ b/tests/system/ixfr/b10-config.db.in
@@ -0,0 +1,22 @@
+{"version": 2,
+    "Xfrin": {
+        "zones": [{
+            "master_addr": "10.53.0.1",
+            "master_port": 53210,
+            "name": "example."
+        }]
+    },
+    "Auth": {
+        "listen_on": [{
+            "address": "10.53.0.2",
+            "port": 53210
+        }],
+        "database_file": "@abs_builddir@/zone.sqlite3"
+    },
+    "Zonemgr": {
+        "secondary_zones": [{
+            "name": "example.",
+            "class": "IN"
+        }]
+    }
+}
diff --git a/tests/system/ixfr/clean.sh b/tests/system/ixfr/clean.sh
index aaa1a12..16c305c 100644
--- a/tests/system/ixfr/clean.sh
+++ b/tests/system/ixfr/clean.sh
@@ -22,7 +22,7 @@ rm -f ns1/db.example
 rm -f ns1/named.memstats
 
 rm -f nsx2/bind10.run
-rm -f nsx2/zone.sqlite3
+rm -f ../zone.sqlite3
 
 rm -f client.dig
 rm -f server.dig
diff --git a/tests/system/ixfr/common_tests.sh.in b/tests/system/ixfr/common_tests.sh.in
index 99f6a4d..fc04c15 100644
--- a/tests/system/ixfr/common_tests.sh.in
+++ b/tests/system/ixfr/common_tests.sh.in
@@ -51,12 +51,12 @@ set -e
 
 # 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 $CLIENT_NAME is $old_client_serial"
+echo "I:$CLIENT_NAME SOA serial of IXFR client 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 $SERVER_NAME for ixfr-in tests"
+echo "I:$SERVER_NAME updating IXFR-server for ixfr-in tests"
 update_server_zone $SERVER_NAME $SERVER_IP $IXFR_TOP/db.example.n2
 
 # Wait a bit - it seems that if two updates are loaded in quick succession,
@@ -64,16 +64,10 @@ update_server_zone $SERVER_NAME $SERVER_IP $IXFR_TOP/db.example.n2
 sleep 5
 update_server_zone $SERVER_NAME $SERVER_IP $IXFR_TOP/db.example.n0
 
-# TODO: Need to alter configuration of BIND 10 server such that it accepts
-# NOTIFYs from and sends IXFR requests to the BIND 9 master.
-
-# If required, 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 $CLIENT_NAME of presence of new version of zone"
-cp $IXFR_TOP/named_notify.conf ns1/named.conf
-do_rndc $SERVER_NAME $SERVER_IP reconfig
-do_rndc $SERVER_NAME $SERVER_IP notify example
+echo "I:$CLIENT_NAME forcing IXFR client to retrieve new version of the zone"
+$RUN_BINDCTL << .
+Xfrin retransfer zone_name="example"
+.
 
 # Wait for the client to update itself.
 wait_for_update $CLIENT_NAME $CLIENT_IP $old_client_serial
@@ -81,3 +75,5 @@ wait_for_update $CLIENT_NAME $CLIENT_IP $old_client_serial
 # Has updated, compare the client and server's versions of the zone s- they
 # should be the same.
 compare_zones $SERVER_NAME $SERVER_IP $CLIENT_NAME $CLIENT_IP
+
+set +e
diff --git a/tests/system/ixfr/db.example.n4.in b/tests/system/ixfr/db.example.n4.in
index ed48927..ae15a54 100644
--- a/tests/system/ixfr/db.example.n4.in
+++ b/tests/system/ixfr/db.example.n4.in
@@ -15,7 +15,7 @@
 $ORIGIN example.
 $TTL 3600
 
-@       IN	SOA	ns1.example. hostmaster.example. 100 3600 900 7200 300
+@       IN	SOA	ns1.example. hostmaster.example. 96 3600 900 7200 300
 
         IN	NS	ns1.example.
         IN	NS	ns2.example.
diff --git a/tests/system/ixfr/db.example.n6.in b/tests/system/ixfr/db.example.n6.in
index 9e5d1c7..33a82a0 100644
--- a/tests/system/ixfr/db.example.n6.in
+++ b/tests/system/ixfr/db.example.n6.in
@@ -15,7 +15,7 @@
 $ORIGIN example.
 $TTL 3600
 
-@       IN	SOA	ns1.example. hostmaster.example. 100 3600 900 7200 300
+@       IN	SOA	ns1.example. hostmaster.example. 94 3600 900 7200 300
 
         IN	NS	ns1.example.
         IN	NS	ns2.example.
diff --git a/tests/system/ixfr/in-1/nsx2/README b/tests/system/ixfr/in-1/nsx2/README
new file mode 100644
index 0000000..aaa8a31
--- /dev/null
+++ b/tests/system/ixfr/in-1/nsx2/README
@@ -0,0 +1,3 @@
+This directory should be empty. A README file is placed here to ensure git
+notes the directory's presence.  It can be removed if other files are placed
+here.
diff --git a/tests/system/ixfr/in-1/nsx2/b10-config.db.in b/tests/system/ixfr/in-1/nsx2/b10-config.db.in
deleted file mode 100644
index abd2674..0000000
--- a/tests/system/ixfr/in-1/nsx2/b10-config.db.in
+++ /dev/null
@@ -1,6 +0,0 @@
-{"version": 2,
- "Auth": {
-   "listen_on": [{"address": "10.53.0.2", "port": 53210}],
-   "database_file": "@abs_builddir@/zone.sqlite3"
- }
-}
diff --git a/tests/system/ixfr/in-1/setup.sh.in b/tests/system/ixfr/in-1/setup.sh.in
index eaeedf8..d4c3978 100644
--- a/tests/system/ixfr/in-1/setup.sh.in
+++ b/tests/system/ixfr/in-1/setup.sh.in
@@ -26,4 +26,5 @@ cp -f $IXFR_TOP/named_nonotify.conf ns1/named.conf
 cp -f $IXFR_TOP/db.example.n4 ns1/db.example
 
 # Set up the IXFR client - load the same version of the zone.
-${B10_LOADZONE} -o . -d @builddir@/nsx2/zone.sqlite3 $IXFR_TOP/db.example.n4
+cp -f $IXFR_TOP/b10-config.db nsx2/b10-config.db
+${B10_LOADZONE} -o . -d $IXFR_TOP/zone.sqlite3 $IXFR_TOP/db.example.n4
diff --git a/tests/system/ixfr/in-2/nsx2/README b/tests/system/ixfr/in-2/nsx2/README
new file mode 100644
index 0000000..aaa8a31
--- /dev/null
+++ b/tests/system/ixfr/in-2/nsx2/README
@@ -0,0 +1,3 @@
+This directory should be empty. A README file is placed here to ensure git
+notes the directory's presence.  It can be removed if other files are placed
+here.
diff --git a/tests/system/ixfr/in-2/nsx2/b10-config.db.in b/tests/system/ixfr/in-2/nsx2/b10-config.db.in
deleted file mode 100644
index abd2674..0000000
--- a/tests/system/ixfr/in-2/nsx2/b10-config.db.in
+++ /dev/null
@@ -1,6 +0,0 @@
-{"version": 2,
- "Auth": {
-   "listen_on": [{"address": "10.53.0.2", "port": 53210}],
-   "database_file": "@abs_builddir@/zone.sqlite3"
- }
-}
diff --git a/tests/system/ixfr/in-2/setup.sh.in b/tests/system/ixfr/in-2/setup.sh.in
index 7f153c5..485b193 100644
--- a/tests/system/ixfr/in-2/setup.sh.in
+++ b/tests/system/ixfr/in-2/setup.sh.in
@@ -26,4 +26,5 @@ cp -f $IXFR_TOP/named_nonotify.conf ns1/named.conf
 cp -f $IXFR_TOP/db.example.n6 ns1/db.example
 
 # Set up the IXFR client - load an earlier version of the zone
-${B10_LOADZONE} -o . -d @builddir@/nsx2/zone.sqlite3 $IXFR_TOP/db.example.n6
+cp -f $IXFR_TOP/b10-config.db nsx2/b10-config.db
+${B10_LOADZONE} -o . -d $IXFR_TOP/zone.sqlite3 $IXFR_TOP/db.example.n6
diff --git a/tests/system/ixfr/in-2/tests.sh b/tests/system/ixfr/in-2/tests.sh
index 30dc199..65ff067 100644
--- a/tests/system/ixfr/in-2/tests.sh
+++ b/tests/system/ixfr/in-2/tests.sh
@@ -1,4 +1,3 @@
-
 #!/bin/sh
 #
 # Copyright (C) 2011  Internet Systems Consortium, Inc. ("ISC")
@@ -28,18 +27,55 @@
 
 # On entry, the IXFR server is at version N-6.  The common tests assume that
 # it is an N-4, so update it.
-echo "I:updating IXFR-server $SERVER_NAME to suitable start version"
+echo "I:$SERVER_NAME updating IXFR-server to suitable start version"
 update_server_zone $SERVER_NAME $SERVER_IP $IXFR_TOP/db.example.n4
-status=$?
+if [ $? -ne 0 ];
+then
+    return $status
+fi
 
 # The pre-requisites for this test are the same as for the common tests, so
 # we can execute that directly.
-
 . ../common_tests.sh
-status=`expr $status + $?`
+if [ $? -ne 0 ];
+then
+    return $status
+fi
+
+# TEMPORARY: at the time of writing (October 2011) BIND 10 does not attempt
+# a UDP transfer first.  Therefore just check for TCP transfer.
+
+# Check that the client initiated and completed an IXFR.  Use a simple grep as
+# the syntax and capabilities of egrep may vary between systems.
+grep XFRIN_XFR_TRANSFER_STARTED nsx2/bind10.run | grep IXFR > /dev/null
+if [ $? -ne 0 ];
+then
+    echo "R:$CLIENT_NAME FAIL no 'IXFR started' message in the BIND 10 log"
+    return 1
+fi
+
+grep XFRIN_XFR_TRANSFER_SUCCESS | grep IXFR > /dev/null
+if [ $? -ne 0 ];
+then
+    echo "R:$CLIENT_NAME FAIL no 'IXFR successful' message in the BIND 10 log"
+    return 1
+fi
+
+# Look in the named log file to see if a TCP IXFR was requested.  Again use a
+# simple grep.
+grep "transfer of" ns1/named.run | grep "sending TCP message" > /dev/null
+if [ $? -ne 0 ];
+then
+    echo "R:$SERVER_NAME FAIL no 'sending TCP' message in the BIND 9 log"
+    return 1
+fi
 
-# 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.
+grep "IXFR ended" ns1/named.run > /dev/null
+if [ $? -ne 0 ];
+then
+    echo "R:$SERVER_NAME FAIL no 'IXFR ended' message in the BIND 9 log"
+    return 1
+fi
 
 echo "I:exit status: $status"
 exit $status
diff --git a/tests/system/ixfr/in-3/nsx2/README b/tests/system/ixfr/in-3/nsx2/README
new file mode 100644
index 0000000..aaa8a31
--- /dev/null
+++ b/tests/system/ixfr/in-3/nsx2/README
@@ -0,0 +1,3 @@
+This directory should be empty. A README file is placed here to ensure git
+notes the directory's presence.  It can be removed if other files are placed
+here.
diff --git a/tests/system/ixfr/in-3/nsx2/b10-config.db.in b/tests/system/ixfr/in-3/nsx2/b10-config.db.in
deleted file mode 100644
index abd2674..0000000
--- a/tests/system/ixfr/in-3/nsx2/b10-config.db.in
+++ /dev/null
@@ -1,6 +0,0 @@
-{"version": 2,
- "Auth": {
-   "listen_on": [{"address": "10.53.0.2", "port": 53210}],
-   "database_file": "@abs_builddir@/zone.sqlite3"
- }
-}
diff --git a/tests/system/ixfr/in-3/setup.sh.in b/tests/system/ixfr/in-3/setup.sh.in
index 51ad9a8..9f10942 100644
--- a/tests/system/ixfr/in-3/setup.sh.in
+++ b/tests/system/ixfr/in-3/setup.sh.in
@@ -26,4 +26,5 @@ cp -f $IXFR_TOP/named_noixfr.conf ns1/named.conf
 cp -f $IXFR_TOP/db.example.n0 ns1/db.example
 
 # Set up the IXFR client - load a previous version of the zone.
-${B10_LOADZONE} -o . -d @builddir@/nsx2/zone.sqlite3 $IXFR_TOP/db.example.n2
+cp -f $IXFR_TOP/b10-config.db nsx2/b10-config.db
+${B10_LOADZONE} -o . -d $IXFR_TOP/zone.sqlite3 $IXFR_TOP/db.example.n2
diff --git a/tests/system/ixfr/in-4/nsx2/README b/tests/system/ixfr/in-4/nsx2/README
new file mode 100644
index 0000000..aaa8a31
--- /dev/null
+++ b/tests/system/ixfr/in-4/nsx2/README
@@ -0,0 +1,3 @@
+This directory should be empty. A README file is placed here to ensure git
+notes the directory's presence.  It can be removed if other files are placed
+here.
diff --git a/tests/system/ixfr/in-4/nsx2/b10-config.db.in b/tests/system/ixfr/in-4/nsx2/b10-config.db.in
deleted file mode 100644
index abd2674..0000000
--- a/tests/system/ixfr/in-4/nsx2/b10-config.db.in
+++ /dev/null
@@ -1,6 +0,0 @@
-{"version": 2,
- "Auth": {
-   "listen_on": [{"address": "10.53.0.2", "port": 53210}],
-   "database_file": "@abs_builddir@/zone.sqlite3"
- }
-}
diff --git a/tests/system/ixfr/in-4/setup.sh.in b/tests/system/ixfr/in-4/setup.sh.in
index 4456ba3..0c0ea45 100644
--- a/tests/system/ixfr/in-4/setup.sh.in
+++ b/tests/system/ixfr/in-4/setup.sh.in
@@ -27,4 +27,5 @@ cp -f $IXFR_TOP/db.example.n2.refresh ns1/db.example
 
 # Set up the IXFR client - load a previous version of the zone with a short
 # refresh time.
-${B10_LOADZONE} -o . -d @builddir@/nsx2/zone.sqlite3 $IXFR_TOP/db.example.n2.refresh
+cp -f $IXFR_TOP/b10-config.db nsx2/b10-config.db
+${B10_LOADZONE} -o . -d $IXFR_TOP/zone.sqlite3 $IXFR_TOP/db.example.n2.refresh
diff --git a/tests/system/ixfr/ixfr_init.sh.in b/tests/system/ixfr/ixfr_init.sh.in
index 715b8af..6a0f0e4 100644
--- a/tests/system/ixfr/ixfr_init.sh.in
+++ b/tests/system/ixfr/ixfr_init.sh.in
@@ -136,7 +136,7 @@ wait_for_update() {
 
     # Now poll the server looking for the new serial number
 
-    echo "I:waiting for SOA serial of $name to change from $serial"
+    echo "I:$name waiting for SOA serial to change from $serial"
     for i in `seq 1 12`
     do
         if [ $i -gt 1 ];
@@ -147,6 +147,7 @@ wait_for_update() {
         new_serial=`$DIG_SOA @$ip | $AWK '{print $3}'`
         if [ "$new_serial" != "$serial" ];
         then
+            echo "I:$name SOA serial was at $serial, now at $new_serial"
             return 0
         fi
     done
@@ -215,9 +216,8 @@ update_server_zone() {
         echo "R:$name FAIL IXFR server did not update zone after reload"
         return 1
     fi
-
     new_serial=`$DIG_SOA @$ip | $AWK '{print $3}'`
-    echo "I:$name was at serial $old_serial, now at $new_serial"
+
     return 0
 }
 
@@ -313,13 +313,15 @@ compare_zones() {
     client_ip=$1
     shift
 
-    $DIG @$client_ip example. axfr | grep -v '^;' | grep -v '^$' \
+    $DIG @$client_ip -p $DNS_PORT example. axfr | grep -v '^;' | grep -v '^$' \
          | sed -e 's/ //g' -e 's/\t//g' > client.dig
-    $DIG @$server_ip example. axfr | grep -v '^;' | grep -v '^$' \
+    $DIG @$server_ip -p $DNS_PORT example. axfr | grep -v '^;' | grep -v '^$' \
          | sed -e 's/ //g' -e 's/\t//g' > server.dig
     diff client.dig server.dig
-    if [ $? -ne 0 ];
+    if [ $? -eq 0 ];
     then
+        echo "I: client and server zones identical"
+    else
         echo "R:FAIL client $client_name zone not same as server $server_name zone"
         return 1
     fi




More information about the bind10-changes mailing list