xfrin_notify_handling.feature 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  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. # Test1 for Xfrout statistics
  20. #
  21. # check 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 between 0 and 1
  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. #
  44. # Test2 for Xfrin statistics
  45. #
  46. # check initial statistics
  47. #
  48. When I query statistics zones of bind10 module Xfrin with cmdctl
  49. last bindctl output should not contain "error"
  50. Then the statistics counter soaoutv4 for the zone _SERVER_ should be 0
  51. Then the statistics counter soaoutv6 for the zone _SERVER_ should be 0
  52. Then the statistics counter axfrreqv4 for the zone _SERVER_ should be 0
  53. Then the statistics counter axfrreqv6 for the zone _SERVER_ should be 0
  54. Then the statistics counter ixfrreqv4 for the zone _SERVER_ should be 0
  55. Then the statistics counter ixfrreqv6 for the zone _SERVER_ should be 0
  56. Then the statistics counter xfrsuccess for the zone _SERVER_ should be 0
  57. Then the statistics counter xfrfail for the zone _SERVER_ should be 0
  58. Then the statistics counter time_to_ixfr for the zone _SERVER_ should be 0.0
  59. Then the statistics counter time_to_axfr for the zone _SERVER_ should be 0.0
  60. When I send bind10 with cmdctl port 47804 the command Xfrout notify example.org IN
  61. Then wait for new master stderr message XFROUT_NOTIFY_COMMAND
  62. Then wait for new bind10 stderr message AUTH_RECEIVED_NOTIFY
  63. Then wait for new bind10 stderr message ZONEMGR_RECEIVE_NOTIFY
  64. Then wait for new bind10 stderr message XFRIN_XFR_TRANSFER_STARTED
  65. Then wait for new bind10 stderr message XFRIN_TRANSFER_SUCCESS not XFRIN_XFR_PROCESS_FAILURE
  66. Then wait for new bind10 stderr message ZONEMGR_RECEIVE_XFRIN_SUCCESS
  67. Then wait 5 times for new master stderr message NOTIFY_OUT_SENDING_NOTIFY
  68. Then wait for new master stderr message NOTIFY_OUT_RETRY_EXCEEDED
  69. A query for www.example.org to [::1]:47806 should have rcode NOERROR
  70. #
  71. # Test3 for Xfrout statistics
  72. #
  73. # check statistics change
  74. #
  75. # wait until the last stats requesting is finished
  76. wait for new master stderr message STATS_SEND_STATISTICS_REQUEST
  77. wait for new master stderr message XFROUT_RECEIVED_GETSTATS_COMMAND
  78. When I query statistics zones of bind10 module Xfrout with cmdctl port 47804
  79. last bindctl output should not contain "error"
  80. Then the statistics counter notifyoutv4 for the zone _SERVER_ should be 0
  81. Then the statistics counter notifyoutv4 for the zone example.org. should be 0
  82. Then the statistics counter notifyoutv6 for the zone _SERVER_ should be 5
  83. Then the statistics counter notifyoutv6 for the zone example.org. should be 5
  84. Then the statistics counter xfrrej for the zone _SERVER_ should be 0
  85. Then the statistics counter xfrrej for the zone example.org. should be 0
  86. Then the statistics counter xfrreqdone for the zone _SERVER_ should be 1
  87. Then the statistics counter xfrreqdone for the zone example.org. should be 1
  88. When I query statistics socket of bind10 module Xfrout with cmdctl port 47804
  89. Then the statistics counter open should be 1
  90. Then the statistics counter openfail should be 0
  91. Then the statistics counter close should be 0
  92. Then the statistics counter bindfail should be 0
  93. Then the statistics counter acceptfail should be 0
  94. Then the statistics counter accept should be 1
  95. Then the statistics counter senderr should be 0
  96. Then the statistics counter recverr should be 0
  97. #
  98. # Test4 for Xfrin statistics
  99. #
  100. # check statistics change
  101. #
  102. When I query statistics zones of bind10 module Xfrin with cmdctl
  103. Then wait for new bind10 stderr message XFRIN_RECEIVED_GETSTATS_COMMAND
  104. last bindctl output should not contain "error"
  105. Then the statistics counter soaoutv4 for the zone _SERVER_ should be 0
  106. Then the statistics counter soaoutv4 for the zone example.org. should be 0
  107. Then the statistics counter soaoutv6 for the zone _SERVER_ should be 1
  108. Then the statistics counter soaoutv6 for the zone example.org. should be 1
  109. Then the statistics counter axfrreqv4 for the zone _SERVER_ should be 0
  110. Then the statistics counter axfrreqv4 for the zone example.org. should be 0
  111. Then the statistics counter axfrreqv6 for the zone _SERVER_ should be 1
  112. Then the statistics counter axfrreqv6 for the zone example.org. should be 1
  113. Then the statistics counter ixfrreqv4 for the zone _SERVER_ should be 0
  114. Then the statistics counter ixfrreqv4 for the zone example.org. should be 0
  115. Then the statistics counter ixfrreqv6 for the zone _SERVER_ should be 0
  116. Then the statistics counter ixfrreqv6 for the zone example.org. should be 0
  117. Then the statistics counter xfrsuccess for the zone _SERVER_ should be 1
  118. Then the statistics counter xfrsuccess for the zone example.org. should be 1
  119. Then the statistics counter xfrfail for the zone _SERVER_ should be 0
  120. Then the statistics counter xfrfail for the zone example.org. should be 0
  121. Then the statistics counter time_to_ixfr for the zone _SERVER_ should be 0.0
  122. Then the statistics counter time_to_ixfr for the zone example.org. should be 0.0
  123. Then the statistics counter time_to_axfr for the zone _SERVER_ should be greater than 0.0
  124. Then the statistics counter time_to_axfr for the zone example.org. should be greater than 0.0
  125. #
  126. # Test for Xfr request rejected
  127. #
  128. Scenario: Handle incoming notify (XFR request rejected)
  129. Given I have bind10 running with configuration xfrin/retransfer_master.conf with cmdctl port 47804 as master
  130. And wait for master stderr message BIND10_STARTED_CC
  131. And wait for master stderr message CMDCTL_STARTED
  132. And wait for master stderr message AUTH_SERVER_STARTED
  133. And wait for master stderr message XFROUT_STARTED
  134. And wait for master stderr message ZONEMGR_STARTED
  135. And wait for master stderr message STATS_STARTING
  136. And I have bind10 running with configuration xfrin/retransfer_slave_notify.conf
  137. And wait for bind10 stderr message BIND10_STARTED_CC
  138. And wait for bind10 stderr message CMDCTL_STARTED
  139. And wait for bind10 stderr message AUTH_SERVER_STARTED
  140. And wait for bind10 stderr message XFRIN_STARTED
  141. And wait for bind10 stderr message ZONEMGR_STARTED
  142. A query for www.example.org to [::1]:47806 should have rcode NXDOMAIN
  143. #
  144. # Test5 for Xfrout statistics
  145. #
  146. # check initial statistics
  147. #
  148. When I query statistics zones of bind10 module Xfrout with cmdctl port 47804
  149. last bindctl output should not contain "error"
  150. last bindctl output should not contain "example.org."
  151. Then the statistics counter notifyoutv4 for the zone _SERVER_ should be 0
  152. Then the statistics counter notifyoutv6 for the zone _SERVER_ should be 0
  153. Then the statistics counter xfrrej for the zone _SERVER_ should be 0
  154. Then the statistics counter xfrreqdone for the zone _SERVER_ should be 0
  155. When I query statistics ixfr_running of bind10 module Xfrout with cmdctl port 47804
  156. Then the statistics counter ixfr_running should be 0
  157. When I query statistics axfr_running of bind10 module Xfrout with cmdctl port 47804
  158. Then the statistics counter axfr_running should be 0
  159. When I query statistics socket of bind10 module Xfrout with cmdctl port 47804
  160. Then the statistics counter open should be between 0 and 1
  161. Then the statistics counter openfail should be 0
  162. Then the statistics counter close should be 0
  163. Then the statistics counter bindfail should be 0
  164. Then the statistics counter acceptfail should be 0
  165. Then the statistics counter accept should be 0
  166. Then the statistics counter senderr should be 0
  167. Then the statistics counter recverr should be 0
  168. #
  169. # Test6 for Xfrin statistics
  170. #
  171. # check initial statistics
  172. #
  173. When I query statistics zones of bind10 module Xfrin with cmdctl
  174. last bindctl output should not contain "error"
  175. Then the statistics counter soaoutv4 for the zone _SERVER_ should be 0
  176. Then the statistics counter soaoutv6 for the zone _SERVER_ should be 0
  177. Then the statistics counter axfrreqv4 for the zone _SERVER_ should be 0
  178. Then the statistics counter axfrreqv6 for the zone _SERVER_ should be 0
  179. Then the statistics counter ixfrreqv4 for the zone _SERVER_ should be 0
  180. Then the statistics counter ixfrreqv6 for the zone _SERVER_ should be 0
  181. Then the statistics counter xfrsuccess for the zone _SERVER_ should be 0
  182. Then the statistics counter xfrfail for the zone _SERVER_ should be 0
  183. Then the statistics counter time_to_ixfr for the zone _SERVER_ should be 0.0
  184. Then the statistics counter time_to_axfr for the zone _SERVER_ should be 0.0
  185. #
  186. # set transfer_acl rejection
  187. # Local xfr requests from Xfrin module would be rejected here.
  188. #
  189. When I send bind10 the following commands with cmdctl port 47804
  190. """
  191. config set Xfrout/zone_config[0]/transfer_acl [{"action": "REJECT", "from": "::1"}]
  192. config commit
  193. """
  194. last bindctl output should not contain Error
  195. When I send bind10 with cmdctl port 47804 the command Xfrout notify example.org IN
  196. Then wait for new master stderr message XFROUT_NOTIFY_COMMAND
  197. Then wait for new bind10 stderr message AUTH_RECEIVED_NOTIFY
  198. Then wait for new bind10 stderr message ZONEMGR_RECEIVE_NOTIFY
  199. Then wait for new bind10 stderr message XFRIN_XFR_TRANSFER_STARTED
  200. Then wait for new bind10 stderr message XFRIN_XFR_TRANSFER_PROTOCOL_VIOLATION not XFRIN_XFR_TRANSFER_STARTED
  201. Then wait for new bind10 stderr message ZONEMGR_RECEIVE_XFRIN_FAILED not ZONEMGR_RECEIVE_XFRIN_SUCCESS
  202. Then wait 5 times for new master stderr message NOTIFY_OUT_SENDING_NOTIFY
  203. Then wait for new master stderr message NOTIFY_OUT_RETRY_EXCEEDED
  204. A query for www.example.org to [::1]:47806 should have rcode NXDOMAIN
  205. #
  206. # Test7 for Xfrout statistics
  207. #
  208. # check statistics change
  209. #
  210. # wait until the last stats requesting is finished
  211. wait for new master stderr message STATS_SEND_STATISTICS_REQUEST
  212. wait for new master stderr message XFROUT_RECEIVED_GETSTATS_COMMAND
  213. When I query statistics zones of bind10 module Xfrout with cmdctl port 47804
  214. last bindctl output should not contain "error"
  215. Then the statistics counter notifyoutv4 for the zone _SERVER_ should be 0
  216. Then the statistics counter notifyoutv4 for the zone example.org. should be 0
  217. Then the statistics counter notifyoutv6 for the zone _SERVER_ should be 5
  218. Then the statistics counter notifyoutv6 for the zone example.org. should be 5
  219. # The counts of rejection would be between 1 and 2. They are not
  220. # fixed. It would depend on timing or the platform.
  221. Then the statistics counter xfrrej for the zone _SERVER_ should be greater than 0
  222. Then the statistics counter xfrrej for the zone example.org. should be greater than 0
  223. Then the statistics counter xfrreqdone for the zone _SERVER_ should be 0
  224. Then the statistics counter xfrreqdone for the zone example.org. should be 0
  225. When I query statistics socket of bind10 module Xfrout with cmdctl port 47804
  226. Then the statistics counter open should be 1
  227. Then the statistics counter openfail should be 0
  228. Then the statistics counter close should be 0
  229. Then the statistics counter bindfail should be 0
  230. Then the statistics counter acceptfail should be 0
  231. Then the statistics counter accept should be 1
  232. Then the statistics counter senderr should be 0
  233. Then the statistics counter recverr should be 0
  234. #
  235. # Test for unreachable slave
  236. #
  237. Scenario: Handle incoming notify (unreachable slave)
  238. Given I have bind10 running with configuration xfrin/retransfer_master.conf with cmdctl port 47804 as master
  239. And wait for master stderr message BIND10_STARTED_CC
  240. And wait for master stderr message CMDCTL_STARTED
  241. And wait for master stderr message AUTH_SERVER_STARTED
  242. And wait for master stderr message XFROUT_STARTED
  243. And wait for master stderr message ZONEMGR_STARTED
  244. And wait for master stderr message STATS_STARTING
  245. When I send bind10 with cmdctl port 47804 the command Xfrout notify example.org IN
  246. Then wait for new master stderr message XFROUT_NOTIFY_COMMAND
  247. Then wait for new master stderr message NOTIFY_OUT_SENDING_NOTIFY
  248. Then wait for new master stderr message NOTIFY_OUT_TIMEOUT
  249. #
  250. # Test1 for Xfrout statistics
  251. #
  252. # check statistics change
  253. #
  254. # wait until the last stats requesting is finished
  255. wait for new master stderr message STATS_SEND_STATISTICS_REQUEST
  256. wait for new master stderr message XFROUT_RECEIVED_GETSTATS_COMMAND
  257. When I query statistics zones of bind10 module Xfrout with cmdctl port 47804
  258. last bindctl output should not contain "error"
  259. Then the statistics counter notifyoutv4 for the zone _SERVER_ should be 0
  260. Then the statistics counter notifyoutv4 for the zone example.org. should be 0
  261. Then the statistics counter notifyoutv6 for the zone _SERVER_ should be greater than 0
  262. Then the statistics counter notifyoutv6 for the zone example.org. should be greater than 0
  263. Then the statistics counter xfrrej for the zone _SERVER_ should be 0
  264. Then the statistics counter xfrrej for the zone example.org. should be 0
  265. Then the statistics counter xfrreqdone for the zone _SERVER_ should be 0
  266. Then the statistics counter xfrreqdone for the zone example.org. should be 0
  267. When I query statistics socket of bind10 module Xfrout with cmdctl port 47804
  268. Then the statistics counter open should be 1
  269. Then the statistics counter openfail should be 0
  270. Then the statistics counter close should be 0
  271. Then the statistics counter bindfail should be 0
  272. Then the statistics counter acceptfail should be 0
  273. Then the statistics counter accept should be 0
  274. Then the statistics counter senderr should be 0
  275. Then the statistics counter recverr should be 0