xfrin_notify_handling.feature 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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. # xfering might not be started yet.
  43. Then the statistics counter axfr_running should be between 0 and 1
  44. Then wait for new bind10 stderr message XFRIN_TRANSFER_SUCCESS not XFRIN_XFR_PROCESS_FAILURE
  45. Then wait for new bind10 stderr message ZONEMGR_RECEIVE_XFRIN_SUCCESS
  46. Then wait 5 times for new master stderr message NOTIFY_OUT_SENDING_NOTIFY
  47. Then wait for new master stderr message NOTIFY_OUT_RETRY_EXCEEDED
  48. A query for www.example.org to [::1]:47806 should have rcode NOERROR
  49. #
  50. # Test for statistics
  51. #
  52. # check for statistics change
  53. #
  54. # wait until the last stats requesting is finished
  55. wait for new master stderr message STATS_SEND_STATISTICS_REQUEST
  56. wait for new master stderr message XFROUT_RECEIVED_GETSTATS_COMMAND
  57. When I query statistics zones of bind10 module Xfrout with cmdctl port 47804
  58. last bindctl output should not contain "error"
  59. Then the statistics counter notifyoutv4 for the zone _SERVER_ should be 0
  60. Then the statistics counter notifyoutv4 for the zone example.org. should be 0
  61. Then the statistics counter notifyoutv6 for the zone _SERVER_ should be 5
  62. Then the statistics counter notifyoutv6 for the zone example.org. should be 5
  63. Then the statistics counter xfrrej for the zone _SERVER_ should be 0
  64. Then the statistics counter xfrrej for the zone example.org. should be 0
  65. Then the statistics counter xfrreqdone for the zone _SERVER_ should be 1
  66. Then the statistics counter xfrreqdone for the zone example.org. should be 1
  67. #
  68. # Test for Xfr request rejected
  69. #
  70. Scenario: Handle incoming notify (XFR request rejected)
  71. Given I have bind10 running with configuration xfrin/retransfer_master.conf with cmdctl port 47804 as master
  72. And wait for master stderr message BIND10_STARTED_CC
  73. And wait for master stderr message CMDCTL_STARTED
  74. And wait for master stderr message AUTH_SERVER_STARTED
  75. And wait for master stderr message XFROUT_STARTED
  76. And wait for master stderr message ZONEMGR_STARTED
  77. And wait for master stderr message STATS_STARTING
  78. And I have bind10 running with configuration xfrin/retransfer_slave_notify.conf
  79. And wait for bind10 stderr message BIND10_STARTED_CC
  80. And wait for bind10 stderr message CMDCTL_STARTED
  81. And wait for bind10 stderr message AUTH_SERVER_STARTED
  82. And wait for bind10 stderr message XFRIN_STARTED
  83. And wait for bind10 stderr message ZONEMGR_STARTED
  84. A query for www.example.org to [::1]:47806 should have rcode NXDOMAIN
  85. #
  86. # Test1 for statistics
  87. #
  88. # check for initial statistics
  89. #
  90. When I query statistics zones of bind10 module Xfrout with cmdctl port 47804
  91. last bindctl output should not contain "error"
  92. last bindctl output should not contain "example.org."
  93. Then the statistics counter notifyoutv4 for the zone _SERVER_ should be 0
  94. Then the statistics counter notifyoutv6 for the zone _SERVER_ should be 0
  95. Then the statistics counter xfrrej for the zone _SERVER_ should be 0
  96. Then the statistics counter xfrreqdone for the zone _SERVER_ should be 0
  97. #
  98. # set transfer_acl rejection
  99. # Local xfr requests from Xfrin module would be rejected here.
  100. #
  101. When I send bind10 the following commands with cmdctl port 47804
  102. """
  103. config set Xfrout/zone_config[0]/transfer_acl [{"action": "REJECT", "from": "::1"}]
  104. config commit
  105. """
  106. last bindctl output should not contain Error
  107. When I send bind10 with cmdctl port 47804 the command Xfrout notify example.org IN
  108. Then wait for new master stderr message XFROUT_NOTIFY_COMMAND
  109. Then wait for new bind10 stderr message AUTH_RECEIVED_NOTIFY
  110. Then wait for new bind10 stderr message ZONEMGR_RECEIVE_NOTIFY
  111. Then wait for new bind10 stderr message XFRIN_XFR_TRANSFER_STARTED
  112. Then wait for new bind10 stderr message XFRIN_XFR_TRANSFER_PROTOCOL_ERROR not XFRIN_XFR_TRANSFER_STARTED
  113. Then wait for new bind10 stderr message ZONEMGR_RECEIVE_XFRIN_FAILED not ZONEMGR_RECEIVE_XFRIN_SUCCESS
  114. Then wait 5 times for new master stderr message NOTIFY_OUT_SENDING_NOTIFY
  115. Then wait for new master stderr message NOTIFY_OUT_RETRY_EXCEEDED
  116. A query for www.example.org to [::1]:47806 should have rcode NXDOMAIN
  117. #
  118. # Test2 for statistics
  119. #
  120. # check for statistics change
  121. #
  122. # wait until the last stats requesting is finished
  123. wait for new master stderr message STATS_SEND_STATISTICS_REQUEST
  124. wait for new master stderr message XFROUT_RECEIVED_GETSTATS_COMMAND
  125. When I query statistics zones of bind10 module Xfrout with cmdctl port 47804
  126. last bindctl output should not contain "error"
  127. Then the statistics counter notifyoutv4 for the zone _SERVER_ should be 0
  128. Then the statistics counter notifyoutv4 for the zone example.org. should be 0
  129. Then the statistics counter notifyoutv6 for the zone _SERVER_ should be 5
  130. Then the statistics counter notifyoutv6 for the zone example.org. should be 5
  131. # The counts of rejection would be between 1 and 2. They are not
  132. # fixed. It would depend on timing or the platform.
  133. Then the statistics counter xfrrej for the zone _SERVER_ should be greater than 0
  134. Then the statistics counter xfrrej for the zone example.org. should be greater than 0
  135. Then the statistics counter xfrreqdone for the zone _SERVER_ should be 0
  136. Then the statistics counter xfrreqdone for the zone example.org. should be 0