Browse Source

[1280] address review comments

fix systest
rename 'axfr' message and use both for AXFR and AXFR-style IXFR
Jelte Jansen 13 years ago
parent
commit
ee3042d8a9

+ 5 - 3
src/bin/xfrin/xfrin.py.in

@@ -889,8 +889,9 @@ class XfrinConnection(asyncore.dispatcher):
             self._send_query(self._request_type)
             self._send_query(self._request_type)
             self.__state = XfrinInitialSOA()
             self.__state = XfrinInitialSOA()
             self._handle_xfrin_responses()
             self._handle_xfrin_responses()
-            # Depending on the transfer type, we log different status reports
+            # Depending what data was found, we log different status reports
-            if request_type == RRType.IXFR():
+            # (In case of an AXFR-style IXFR, print the 'AXFR' message)
+            if self._transfer_stats.axfr_rr_count == 0:
                 logger.info(XFRIN_IXFR_TRANSFER_SUCCESS,
                 logger.info(XFRIN_IXFR_TRANSFER_SUCCESS,
                             self.zone_str(),
                             self.zone_str(),
                             self._transfer_stats.message_count,
                             self._transfer_stats.message_count,
@@ -902,7 +903,8 @@ class XfrinConnection(asyncore.dispatcher):
                             "%.f" % self._transfer_stats.get_bytes_per_second()
                             "%.f" % self._transfer_stats.get_bytes_per_second()
                            )
                            )
             else:
             else:
-                logger.info(XFRIN_AXFR_TRANSFER_SUCCESS,
+                logger.info(XFRIN_TRANSFER_SUCCESS,
+                            req_str,
                             self.zone_str(),
                             self.zone_str(),
                             self._transfer_stats.message_count,
                             self._transfer_stats.message_count,
                             self._transfer_stats.axfr_rr_count,
                             self._transfer_stats.axfr_rr_count,

+ 16 - 17
src/bin/xfrin/xfrin_messages.mes

@@ -31,22 +31,6 @@ turns out to happen with a real world primary server implementation
 and that server actually feeds broken data (e.g. mixed versions of
 and that server actually feeds broken data (e.g. mixed versions of
 zone), we can consider a stricter action.
 zone), we can consider a stricter action.
 
 
-% XFRIN_AXFR_TRANSFER_SUCCESS full transfer of zone %1 succeeded (messages: %2, records: %3, bytes: %4, run time: %5 seconds, %6 bytes/second)
-The AXFR transfer of the given zone was successful.
-The provided information contains the following values:
-
-messages: Number of overhead DNS messages in the transfer
-
-records: Number of Resource Records in the full transfer, excluding the
-final SOA record that marks the end of the AXFR.
-
-bytes: Full size of the transfer data on the wire.
-
-run time: Time (in seconds) the complete axfr took
-
-bytes/second: Transfer speed
-
-
 % XFRIN_BAD_MASTER_ADDR_FORMAT bad format for master address: %1
 % XFRIN_BAD_MASTER_ADDR_FORMAT bad format for master address: %1
 The given master address is not a valid IP address.
 The given master address is not a valid IP address.
 
 
@@ -89,7 +73,7 @@ is not equal to the requested SOA serial.
 There was an error importing the python DNS module pydnspp. The most
 There was an error importing the python DNS module pydnspp. The most
 likely cause is a PYTHONPATH problem.
 likely cause is a PYTHONPATH problem.
 
 
-% XFRIN_IXFR_TRANSFER_SUCCESS incremental transfer of zone %1 succeeded (messages: %2, changesets: %3, deletions: %4, additions: %5, bytes: %6, run time: %7 seconds, %8 bytes/second)
+% XFRIN_IXFR_TRANSFER_SUCCESS incremental IXFR transfer of zone %1 succeeded (messages: %2, changesets: %3, deletions: %4, additions: %5, bytes: %6, run time: %7 seconds, %8 bytes/second)
 The IXFR transfer for the given zone was successful.
 The IXFR transfer for the given zone was successful.
 The provided information contains the following values:
 The provided information contains the following values:
 
 
@@ -152,6 +136,21 @@ An informational message, this is output when the resolver starts up.
 There was a keyboard interrupt signal to stop the xfrin daemon. The
 There was a keyboard interrupt signal to stop the xfrin daemon. The
 daemon will now shut down.
 daemon will now shut down.
 
 
+% XFRIN_TRANSFER_SUCCESS full %1 transfer of zone %2 succeeded (messages: %3, records: %4, bytes: %5, run time: %6 seconds, %7 bytes/second)
+The AXFR transfer of the given zone was successful.
+The provided information contains the following values:
+
+messages: Number of overhead DNS messages in the transfer
+
+records: Number of Resource Records in the full transfer, excluding the
+final SOA record that marks the end of the AXFR.
+
+bytes: Full size of the transfer data on the wire.
+
+run time: Time (in seconds) the complete axfr took
+
+bytes/second: Transfer speed
+
 % XFRIN_UNKNOWN_ERROR unknown error: %1
 % XFRIN_UNKNOWN_ERROR unknown error: %1
 An uncaught exception was raised while running the xfrin daemon. The
 An uncaught exception was raised while running the xfrin daemon. The
 exception message is printed in the log message.
 exception message is printed in the log message.

+ 1 - 1
tests/lettuce/features/xfrin_bind10.feature

@@ -7,5 +7,5 @@ Feature: Xfrin
     A query for www.example.org should have rcode REFUSED
     A query for www.example.org should have rcode REFUSED
     Wait for bind10 stderr message CMDCTL_STARTED
     Wait for bind10 stderr message CMDCTL_STARTED
     When I send bind10 the command Xfrin retransfer example.org IN 127.0.0.1 47807
     When I send bind10 the command Xfrin retransfer example.org IN 127.0.0.1 47807
-    Then wait for new bind10 stderr message XFRIN_AXFR_TRANSFER_SUCCESS not XFRIN_XFR_PROCESS_FAILURE
+    Then wait for new bind10 stderr message XFRIN_TRANSFER_SUCCESS not XFRIN_XFR_PROCESS_FAILURE
     A query for www.example.org should have rcode NOERROR
     A query for www.example.org should have rcode NOERROR

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

@@ -54,7 +54,7 @@ then
     exit 1
     exit 1
 fi
 fi
 
 
-grep XFRIN_XFR_TRANSFER_SUCCESS nsx2/bind10.run | grep IXFR > /dev/null
+grep XFRIN_IXFR_TRANSFER_SUCCESS nsx2/bind10.run | grep IXFR > /dev/null
 if [ $? -ne 0 ];
 if [ $? -ne 0 ];
 then
 then
     echo "R:$CLIENT_NAME FAIL no 'IXFR successful' message in the BIND 10 log"
     echo "R:$CLIENT_NAME FAIL no 'IXFR successful' message in the BIND 10 log"