xfrin_notify_handling.feature 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. Feature: Xfrin incoming notify handling
  2. Tests for Xfrin incoming notify handling.
  3. Scenario: Handle incoming notify
  4. Given I have bind10 running with configuration xfrin/retransfer_master.conf with cmdctl port 47804 as master
  5. And wait for master stderr message BIND10_STARTED_CC
  6. And wait for master stderr message CMDCTL_STARTED
  7. And wait for master stderr message AUTH_SERVER_STARTED
  8. And wait for master stderr message XFROUT_STARTED
  9. And wait for master stderr message ZONEMGR_STARTED
  10. And wait for master stderr message STATS_STARTING
  11. And I have bind10 running with configuration xfrin/retransfer_slave_notify.conf
  12. And wait for bind10 stderr message BIND10_STARTED_CC
  13. And wait for bind10 stderr message CMDCTL_STARTED
  14. And wait for bind10 stderr message AUTH_SERVER_STARTED
  15. And wait for bind10 stderr message XFRIN_STARTED
  16. And wait for bind10 stderr message ZONEMGR_STARTED
  17. A query for www.example.org to [::1]:47806 should have rcode NXDOMAIN
  18. #
  19. # Test for statistics
  20. #
  21. # check for initial statistics
  22. #
  23. When I query statistics zones of bind10 module Xfrout with cmdctl port 47804
  24. last bindctl output should not contain "error"
  25. last bindctl output should not contain "example.org."
  26. Then the statistics counter notifyoutv4 for the zone _SERVER_ should be 0
  27. Then the statistics counter notifyoutv6 for the zone _SERVER_ should be 0
  28. Then the statistics counter xfrrej for the zone _SERVER_ should be 0
  29. Then the statistics counter xfrreqdone for the zone _SERVER_ should be 0
  30. When I query statistics ixfr_running of bind10 module Xfrout with cmdctl port 47804
  31. Then the statistics counter ixfr_running should be 0
  32. Then the statistics counter ixfr_running should be 0
  33. When I query statistics axfr_running of bind10 module Xfrout with cmdctl port 47804
  34. Then the statistics counter axfr_running should be 0
  35. Then the statistics counter axfr_running should be 0
  36. When I send bind10 with cmdctl port 47804 the command Xfrout notify example.org IN
  37. Then wait for new master stderr message XFROUT_NOTIFY_COMMAND
  38. Then wait for new bind10 stderr message AUTH_RECEIVED_NOTIFY
  39. Then wait for new bind10 stderr message ZONEMGR_RECEIVE_NOTIFY
  40. Then wait for new bind10 stderr message XFRIN_XFR_TRANSFER_STARTED
  41. And when I query statistics axfr_running of bind10 module Xfrout with cmdctl port 47804
  42. # The counter may or may not have been incremented. Whatever the
  43. # server likes. This test should have been actually effective but
  44. # the axfr transfering is mostly done in real short time. it is
  45. # hardly to observe 'axfr_running' incremented to one.
  46. Then the statistics counter axfr_running should be between 0 and 1
  47. Then wait for new bind10 stderr message XFRIN_TRANSFER_SUCCESS not XFRIN_XFR_PROCESS_FAILURE
  48. Then wait for new bind10 stderr message ZONEMGR_RECEIVE_XFRIN_SUCCESS
  49. Then wait 5 times for new master stderr message NOTIFY_OUT_SENDING_NOTIFY
  50. Then wait for new master stderr message NOTIFY_OUT_RETRY_EXCEEDED
  51. A query for www.example.org to [::1]:47806 should have rcode NOERROR
  52. #
  53. # Test for statistics
  54. #
  55. # check for statistics change
  56. #
  57. # wait until the last stats requesting is finished
  58. wait for new master stderr message STATS_SEND_STATISTICS_REQUEST
  59. wait for new master stderr message XFROUT_RECEIVED_GETSTATS_COMMAND
  60. When I query statistics zones of bind10 module Xfrout with cmdctl port 47804
  61. last bindctl output should not contain "error"
  62. Then the statistics counter notifyoutv4 for the zone _SERVER_ should be 0
  63. Then the statistics counter notifyoutv4 for the zone example.org. should be 0
  64. Then the statistics counter notifyoutv6 for the zone _SERVER_ should be 5
  65. Then the statistics counter notifyoutv6 for the zone example.org. should be 5
  66. Then the statistics counter xfrrej for the zone _SERVER_ should be 0
  67. Then the statistics counter xfrrej for the zone example.org. should be 0
  68. Then the statistics counter xfrreqdone for the zone _SERVER_ should be 1
  69. Then the statistics counter xfrreqdone for the zone example.org. should be 1
  70. #
  71. # Test for Xfr request rejected
  72. #
  73. Scenario: Handle incoming notify (XFR request rejected)
  74. Given I have bind10 running with configuration xfrin/retransfer_master.conf with cmdctl port 47804 as master
  75. And wait for master stderr message BIND10_STARTED_CC
  76. And wait for master stderr message CMDCTL_STARTED
  77. And wait for master stderr message AUTH_SERVER_STARTED
  78. And wait for master stderr message XFROUT_STARTED
  79. And wait for master stderr message ZONEMGR_STARTED
  80. And wait for master stderr message STATS_STARTING
  81. And I have bind10 running with configuration xfrin/retransfer_slave_notify.conf
  82. And wait for bind10 stderr message BIND10_STARTED_CC
  83. And wait for bind10 stderr message CMDCTL_STARTED
  84. And wait for bind10 stderr message AUTH_SERVER_STARTED
  85. And wait for bind10 stderr message XFRIN_STARTED
  86. And wait for bind10 stderr message ZONEMGR_STARTED
  87. A query for www.example.org to [::1]:47806 should have rcode NXDOMAIN
  88. #
  89. # Test1 for statistics
  90. #
  91. # check for initial statistics
  92. #
  93. When I query statistics zones of bind10 module Xfrout with cmdctl port 47804
  94. last bindctl output should not contain "error"
  95. last bindctl output should not contain "example.org."
  96. Then the statistics counter notifyoutv4 for the zone _SERVER_ should be 0
  97. Then the statistics counter notifyoutv6 for the zone _SERVER_ should be 0
  98. Then the statistics counter xfrrej for the zone _SERVER_ should be 0
  99. Then the statistics counter xfrreqdone for the zone _SERVER_ should be 0
  100. #
  101. # set transfer_acl rejection
  102. # Local xfr requests from Xfrin module would be rejected here.
  103. #
  104. When I send bind10 the following commands with cmdctl port 47804
  105. """
  106. config set Xfrout/zone_config[0]/transfer_acl [{"action": "REJECT", "from": "::1"}]
  107. config commit
  108. """
  109. last bindctl output should not contain Error
  110. When I send bind10 with cmdctl port 47804 the command Xfrout notify example.org IN
  111. Then wait for new master stderr message XFROUT_NOTIFY_COMMAND
  112. Then wait for new bind10 stderr message AUTH_RECEIVED_NOTIFY
  113. Then wait for new bind10 stderr message ZONEMGR_RECEIVE_NOTIFY
  114. Then wait for new bind10 stderr message XFRIN_XFR_TRANSFER_STARTED
  115. Then wait for new bind10 stderr message XFRIN_XFR_TRANSFER_PROTOCOL_ERROR not XFRIN_XFR_TRANSFER_STARTED
  116. Then wait for new bind10 stderr message ZONEMGR_RECEIVE_XFRIN_FAILED not ZONEMGR_RECEIVE_XFRIN_SUCCESS
  117. Then wait 5 times for new master stderr message NOTIFY_OUT_SENDING_NOTIFY
  118. Then wait for new master stderr message NOTIFY_OUT_RETRY_EXCEEDED
  119. A query for www.example.org to [::1]:47806 should have rcode NXDOMAIN
  120. #
  121. # Test2 for statistics
  122. #
  123. # check for statistics change
  124. #
  125. # wait until the last stats requesting is finished
  126. wait for new master stderr message STATS_SEND_STATISTICS_REQUEST
  127. wait for new master stderr message XFROUT_RECEIVED_GETSTATS_COMMAND
  128. When I query statistics zones of bind10 module Xfrout with cmdctl port 47804
  129. last bindctl output should not contain "error"
  130. Then the statistics counter notifyoutv4 for the zone _SERVER_ should be 0
  131. Then the statistics counter notifyoutv4 for the zone example.org. should be 0
  132. Then the statistics counter notifyoutv6 for the zone _SERVER_ should be 5
  133. Then the statistics counter notifyoutv6 for the zone example.org. should be 5
  134. # The counts of rejection would be between 1 and 2. They are not
  135. # fixed. It would depend on timing or the platform.
  136. Then the statistics counter xfrrej for the zone _SERVER_ should be greater than 0
  137. Then the statistics counter xfrrej for the zone example.org. should be greater than 0
  138. Then the statistics counter xfrreqdone for the zone _SERVER_ should be 0
  139. Then the statistics counter xfrreqdone for the zone example.org. should be 0