|
@@ -40,20 +40,18 @@
|
|
#
|
|
#
|
|
# After this test has finished, it is up to the caller to check the logs
|
|
# After this test has finished, it is up to the caller to check the logs
|
|
# to see if they report the expected behavior.
|
|
# to see if they report the expected behavior.
|
|
|
|
+#
|
|
|
|
+# \arg $1 If present (and set to "yes"), after updating the IXFR server,
|
|
|
|
+# ensure that NOTIFYs are enabled and send a NOTIFY to the slave.
|
|
|
|
+#
|
|
|
|
+# \return 0 if the script executed successfully, non-zero otherwise
|
|
|
|
|
|
# Set up variables etc.
|
|
# Set up variables etc.
|
|
. @abs_top_builddir@/tests/system/conf.sh
|
|
. @abs_top_builddir@/tests/system/conf.sh
|
|
. $IXFR_TOP/ixfr_init.sh
|
|
. $IXFR_TOP/ixfr_init.sh
|
|
|
|
|
|
-SERVER_NAME=ns1
|
|
|
|
-SERVER_IP=10.53.0.1 # BIND 9
|
|
|
|
-
|
|
|
|
-CLIENT_NAME=nsx2
|
|
|
|
-CLIENT_IP=10.53.0.2 # BIND 10
|
|
|
|
-
|
|
|
|
status=0
|
|
status=0
|
|
|
|
|
|
-
|
|
|
|
# Store the SOA serial number of the BIND 10 client for later use.
|
|
# Store the SOA serial number of the BIND 10 client for later use.
|
|
old_client_serial=`$DIG_SOA @$CLIENT_IP | $AWK '{print $3}'`
|
|
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:SOA serial of IXFR client $CLIENT_NAME is $old_client_serial"
|
|
@@ -63,55 +61,36 @@ echo "I:SOA serial of IXFR client $CLIENT_NAME is $old_client_serial"
|
|
# generate the differences between them.
|
|
# generate the differences between them.
|
|
echo "I:updating IXFR-server $SERVER_NAME 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
|
|
update_server_zone $SERVER_NAME $SERVER_IP $IXFR_TOP/largezone_n-2.db
|
|
-if [ $? != 0 ];
|
|
+status=`expr $status + $?`
|
|
-then
|
|
|
|
- status=1
|
|
|
|
-fi
|
|
|
|
|
|
|
|
# Wait a bit - it seems that if two updates are loaded in quick succession,
|
|
# Wait a bit - it seems that if two updates are loaded in quick succession,
|
|
# the second sometimes gets lost.
|
|
# the second sometimes gets lost.
|
|
sleep 5
|
|
sleep 5
|
|
update_server_zone $SERVER_NAME $SERVER_IP $IXFR_TOP/largezone_n-0.db
|
|
update_server_zone $SERVER_NAME $SERVER_IP $IXFR_TOP/largezone_n-0.db
|
|
-if [ $? != 0 ];
|
|
+status=`expr $status + $?`
|
|
-then
|
|
|
|
- status=1
|
|
|
|
-fi
|
|
|
|
|
|
|
|
# TODO: Need to alter configuration of BIND 10 server such that it accepts
|
|
# TODO: Need to alter configuration of BIND 10 server such that it accepts
|
|
# NOTIFYs from and sends IXFR requests to the BIND 9 master.
|
|
# NOTIFYs from and sends IXFR requests to the BIND 9 master.
|
|
|
|
|
|
-# Get the IXFR server to notify the slave server of the new zone. Do this by
|
|
+# If required, get the IXFR server to notify the slave server of the new zone.
|
|
-# allowing notifies and then triggering a re-notification of the server.
|
|
+# 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"
|
|
echo "I:notifying IXFR-client $CLIENT_NAME of presence of new version of zone"
|
|
cp ns1/named_notify.conf ns1/named.conf
|
|
cp ns1/named_notify.conf ns1/named.conf
|
|
|
|
|
|
do_rndc $SERVER_NAME $SERVER_IP reconfig
|
|
do_rndc $SERVER_NAME $SERVER_IP reconfig
|
|
-if [ $? != 0 ];
|
|
+status=`expr $status + $?`
|
|
-then
|
|
|
|
- status=1
|
|
|
|
-fi
|
|
|
|
|
|
|
|
do_rndc $SERVER_NAME $SERVER_IP notify example
|
|
do_rndc $SERVER_NAME $SERVER_IP notify example
|
|
-if [ $? != 0 ];
|
|
+status=`expr $status + $?`
|
|
-then
|
|
|
|
- status=1
|
|
|
|
-fi
|
|
|
|
|
|
|
|
# Wait for the client to update itself.
|
|
# Wait for the client to update itself.
|
|
wait_for_update $CLIENT_NAME $CLIENT_IP $old_client_serial
|
|
wait_for_update $CLIENT_NAME $CLIENT_IP $old_client_serial
|
|
-if [ $? != 0 ];
|
|
+status=`expr $status + $?`
|
|
-then
|
|
|
|
- status=1
|
|
|
|
-fi
|
|
|
|
|
|
|
|
# Has updated, get the latest serial of the client and server - they
|
|
# Has updated, get the latest serial of the client and server - they
|
|
# should be the same.
|
|
# should be the same.
|
|
-client_serial=`$DIG_SOA @$CLIENT_IP | $AWK '{print $3}'`
|
|
+compare_soa $SERVER_NAME $SERVER_IP $CLIENT_NAME $CLIENT_IP
|
|
-server_serial=`$DIG_SOA @$SERVER_IP | $AWK '{print $3}'`
|
|
+status=`expr $status + $?`
|
|
-if [ "$client_serial" != "$server_serial" ];
|
|
|
|
-then
|
|
|
|
- echo "R:FAIL client serial $client_serial not same as server serial $server_serial after update"
|
|
|
|
- status=1
|
|
|
|
-fi
|
|
|
|
|
|
|
|
exit $status
|
|
exit $status
|