tests.sh 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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 first IXFR-IN test. A BIND 9 nameserver (the
  18. # "server") contains a version of the zone (version N) and three previous
  19. # versions, N-2, N-4 and N-6. A BIND 10 nameserver (the "client") is loaded
  20. # with version N-6 of the zone. A NOTIFY is sent to it, and it is expected that
  21. # it will send an IXFR to the server and update itself with the latest version
  22. # of the zone. (The changes are such that the update will have to take place
  23. # over TCP.)
  24. . ../ixfr_init.sh
  25. # On entry, the IXFR server is at version N-6. The common tests assume that
  26. # it is an N-4, so update it.
  27. echo "I:$SERVER_NAME updating IXFR-server to suitable start version"
  28. update_server_zone $SERVER_NAME $SERVER_IP $IXFR_TOP/db.example.n4
  29. if [ $? -ne 0 ];
  30. then
  31. exit 1
  32. fi
  33. # The pre-requisites for this test are the same as for the common tests, so
  34. # we can execute that directly.
  35. . ../common_tests.sh
  36. if [ $? -ne 0 ];
  37. then
  38. exit 1
  39. fi
  40. # TEMPORARY: at the time of writing (October 2011) BIND 10 does not attempt
  41. # a UDP transfer first. Therefore just check for TCP transfer.
  42. # Check that the client initiated and completed an IXFR. Use a simple grep as
  43. # the syntax and capabilities of egrep may vary between systems.
  44. grep XFRIN_XFR_TRANSFER_STARTED nsx2/bind10.run | grep IXFR > /dev/null
  45. if [ $? -ne 0 ];
  46. then
  47. echo "R:$CLIENT_NAME FAIL no 'IXFR started' message in the BIND 10 log"
  48. exit 1
  49. fi
  50. grep XFRIN_IXFR_TRANSFER_SUCCESS nsx2/bind10.run | grep IXFR > /dev/null
  51. if [ $? -ne 0 ];
  52. then
  53. echo "R:$CLIENT_NAME FAIL no 'IXFR successful' message in the BIND 10 log"
  54. exit 1
  55. fi
  56. # Look in the named log file to see if a TCP IXFR was requested. Again use a
  57. # simple grep.
  58. grep "transfer of" ns1/named.run | grep "sending TCP message" > /dev/null
  59. if [ $? -ne 0 ];
  60. then
  61. echo "R:$SERVER_NAME FAIL no 'sending TCP' message in the BIND 9 log"
  62. exit 1
  63. fi
  64. grep "IXFR ended" ns1/named.run > /dev/null
  65. if [ $? -ne 0 ];
  66. then
  67. echo "R:$SERVER_NAME FAIL no 'IXFR ended' message in the BIND 9 log"
  68. exit 1
  69. fi
  70. echo "I:exit status: 0"
  71. exit 0