xfrin_notify_handling.feature 8.4 KB

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