tests.sh 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/bin/sh
  2. #
  3. # Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC")
  4. #
  5. # Permission to use, copy, modify, and/or distribute this software for any
  6. # purpose with or without fee is hereby granted, provided that the above
  7. # copyright notice and this permission notice appear in all copies.
  8. #
  9. # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
  10. # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  11. # AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
  12. # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  13. # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  14. # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. # PERFORMANCE OF THIS SOFTWARE.
  16. # \file
  17. # This script performs the third IXFR-IN test. A BIND 9 nameserver (the
  18. # "server") contains a version of the zone (version N) and has IXFRs disabled.
  19. # A BIND 10 nameserver (the "client") is loaded with version N-2 of the zone.
  20. # A NOTIFY is sent to it, and it is expected that it will send an IXFR to the
  21. # server; the server should not respond to the request, so the client should
  22. # then send an AXFR request and receive the latest copy of the zone.
  23. . ../ixfr_init.sh
  24. status=$?
  25. # Store the SOA serial number of the BIND 10 client for later use.
  26. old_client_serial=`$DIG_SOA @$CLIENT_IP | $AWK '{print $3}'`
  27. echo "I:SOA serial of IXFR client $CLIENT_NAME is $old_client_serial"
  28. # TODO: Need to alter configuration of BIND 10 server such that it accepts
  29. # NOTIFYs from and sends IXFR requests to the BIND 9 master.
  30. # If required, get the IXFR server to notify the IXFR client of the new zone.
  31. # Do this by allowing notifies and then triggering a re-notification of the
  32. # server.
  33. echo "I:notifying IXFR-client $CLIENT_NAME of presence of new version of zone"
  34. do_rndc $SERVER_NAME $SERVER_IP notify example
  35. status=`expr $status + $?`
  36. # Wait for the client to update itself.
  37. wait_for_update $CLIENT_NAME $CLIENT_IP $old_client_serial
  38. status=`expr $status + $?`
  39. # Has updated, get the latest serial of the client and server - they
  40. # should be the same.
  41. compare_soa $SERVER_NAME $SERVER_IP $CLIENT_NAME $CLIENT_IP
  42. status=`expr $status + $?`
  43. # TODO: Check the BIND 10 log, looking for the IXFR messages that indicate that
  44. # it has initiated an IXFR and then an AXFR.
  45. echo "I:exit status: $status"
  46. exit $status