xfrin_notify_handling.feature 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  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 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. 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. # From this point we can't reliably 'wait for new' because the ordering
  47. # of logs from different processes is unpredictable. But these
  48. # should be okay in this case.
  49. Then wait for bind10 stderr message ZONEMGR_RECEIVE_NOTIFY
  50. Then wait for bind10 stderr message XFRIN_XFR_TRANSFER_STARTED
  51. Then wait for bind10 stderr message XFRIN_TRANSFER_SUCCESS not XFRIN_XFR_PROCESS_FAILURE
  52. Then wait for bind10 stderr message ZONEMGR_RECEIVE_XFRIN_SUCCESS
  53. Then wait for master stderr message NOTIFY_OUT_REPLY_RECEIVED
  54. A query for www.example.org to [::1]:47806 should have rcode NOERROR
  55. # Make sure handling statistics command handling checked below is
  56. # after this query
  57. And wait for bind10 stderr message AUTH_SEND_NORMAL_RESPONSE
  58. #
  59. # Test for statistics
  60. #
  61. # check for statistics change
  62. #
  63. # wait until the last stats requesting is finished
  64. # note that this does not 100% guarantee the stats updated Xfrout
  65. # statistics. But there doesn't seem to be a better log message that
  66. # suggests this event.
  67. wait for new master stderr message XFROUT_RECEIVED_GETSTATS_COMMAND
  68. When I query statistics zones of bind10 module Xfrout with cmdctl port 47804
  69. last bindctl output should not contain "error"
  70. Then the statistics counter notifyoutv4 for the zone _SERVER_ should be 0
  71. Then the statistics counter notifyoutv4 for the zone example.org. should be 0
  72. Then the statistics counter notifyoutv6 for the zone _SERVER_ should be 5
  73. Then the statistics counter notifyoutv6 for the zone example.org. should be 5
  74. Then the statistics counter xfrrej for the zone _SERVER_ should be 0
  75. Then the statistics counter xfrrej for the zone example.org. should be 0
  76. Then the statistics counter xfrreqdone for the zone _SERVER_ should be 1
  77. Then the statistics counter xfrreqdone for the zone example.org. should be 1
  78. When I query statistics socket of bind10 module Xfrout with cmdctl port 47804
  79. Then the statistics counter open should be 1
  80. Then the statistics counter openfail should be 0
  81. Then the statistics counter close should be 0
  82. Then the statistics counter bindfail should be 0
  83. Then the statistics counter acceptfail should be 0
  84. Then the statistics counter accept should be 1
  85. Then the statistics counter senderr should be 0
  86. Then the statistics counter recverr should be 0
  87. #
  88. # Test for Xfr request rejected
  89. #
  90. Scenario: Handle incoming notify (XFR request rejected)
  91. Given I have bind10 running with configuration xfrin/retransfer_master.conf with cmdctl port 47804 as master
  92. And wait for master stderr message BIND10_STARTED_CC
  93. And wait for master stderr message CMDCTL_STARTED
  94. And wait for master stderr message AUTH_SERVER_STARTED
  95. And wait for master stderr message XFROUT_STARTED
  96. And wait for master stderr message ZONEMGR_STARTED
  97. And wait for master stderr message STATS_STARTING
  98. And I have bind10 running with configuration xfrin/retransfer_slave_notify.conf
  99. And wait for bind10 stderr message BIND10_STARTED_CC
  100. And wait for bind10 stderr message CMDCTL_STARTED
  101. And wait for bind10 stderr message AUTH_SERVER_STARTED
  102. And wait for bind10 stderr message XFRIN_STARTED
  103. And wait for bind10 stderr message ZONEMGR_STARTED
  104. A query for www.example.org to [::1]:47806 should have rcode NXDOMAIN
  105. #
  106. # Test1 for statistics
  107. #
  108. # check for initial statistics
  109. #
  110. When I query statistics zones of bind10 module Xfrout with cmdctl port 47804
  111. last bindctl output should not contain "error"
  112. last bindctl output should not contain "example.org."
  113. Then the statistics counter notifyoutv4 for the zone _SERVER_ should be 0
  114. Then the statistics counter notifyoutv6 for the zone _SERVER_ should be 0
  115. Then the statistics counter xfrrej for the zone _SERVER_ should be 0
  116. Then the statistics counter xfrreqdone for the zone _SERVER_ should be 0
  117. When I query statistics ixfr_running of bind10 module Xfrout with cmdctl port 47804
  118. Then the statistics counter ixfr_running should be 0
  119. When I query statistics axfr_running of bind10 module Xfrout with cmdctl port 47804
  120. Then the statistics counter axfr_running should be 0
  121. When I query statistics socket of bind10 module Xfrout with cmdctl port 47804
  122. Then the statistics counter open should be between 0 and 1
  123. Then the statistics counter openfail should be 0
  124. Then the statistics counter close should be 0
  125. Then the statistics counter bindfail should be 0
  126. Then the statistics counter acceptfail should be 0
  127. Then the statistics counter accept should be 0
  128. Then the statistics counter senderr should be 0
  129. Then the statistics counter recverr should be 0
  130. #
  131. # set transfer_acl rejection
  132. # Local xfr requests from Xfrin module would be rejected here.
  133. #
  134. When I send bind10 the following commands with cmdctl port 47804
  135. """
  136. config set Xfrout/zone_config[0]/transfer_acl [{"action": "REJECT", "from": "::1"}]
  137. config commit
  138. """
  139. last bindctl output should not contain Error
  140. When I send bind10 with cmdctl port 47804 the command Xfrout notify example.org IN
  141. Then wait for new master stderr message XFROUT_NOTIFY_COMMAND
  142. Then wait for new bind10 stderr message AUTH_RECEIVED_NOTIFY
  143. # can't use 'wait for new' below.
  144. Then wait for bind10 stderr message ZONEMGR_RECEIVE_NOTIFY
  145. Then wait for bind10 stderr message XFRIN_XFR_TRANSFER_STARTED
  146. Then wait for bind10 stderr message XFRIN_XFR_TRANSFER_PROTOCOL_VIOLATION not XFRIN_XFR_TRANSFER_STARTED
  147. Then wait for bind10 stderr message ZONEMGR_RECEIVE_XFRIN_FAILED not ZONEMGR_RECEIVE_XFRIN_SUCCESS
  148. Then wait for master stderr message NOTIFY_OUT_REPLY_RECEIVED
  149. A query for www.example.org to [::1]:47806 should have rcode NXDOMAIN
  150. #
  151. # Test2 for statistics
  152. #
  153. # check for statistics change
  154. #
  155. # wait until stats request at least after NOTIFY_OUT_REPLY_RECEIVED
  156. wait for new master stderr message XFROUT_RECEIVED_GETSTATS_COMMAND
  157. When I query statistics zones of bind10 module Xfrout with cmdctl port 47804
  158. last bindctl output should not contain "error"
  159. Then the statistics counter notifyoutv4 for the zone _SERVER_ should be 0
  160. Then the statistics counter notifyoutv4 for the zone example.org. should be 0
  161. Then the statistics counter notifyoutv6 for the zone _SERVER_ should be 5
  162. Then the statistics counter notifyoutv6 for the zone example.org. should be 5
  163. # The counts of rejection would be between 1 and 2. They are not
  164. # fixed. It would depend on timing or the platform.
  165. Then the statistics counter xfrrej for the zone _SERVER_ should be greater than 0
  166. Then the statistics counter xfrrej for the zone example.org. should be greater than 0
  167. Then the statistics counter xfrreqdone for the zone _SERVER_ should be 0
  168. Then the statistics counter xfrreqdone for the zone example.org. should be 0
  169. When I query statistics socket of bind10 module Xfrout with cmdctl port 47804
  170. Then the statistics counter open should be 1
  171. Then the statistics counter openfail should be 0
  172. Then the statistics counter close should be 0
  173. Then the statistics counter bindfail should be 0
  174. Then the statistics counter acceptfail should be 0
  175. Then the statistics counter accept should be 1
  176. Then the statistics counter senderr should be 0
  177. Then the statistics counter recverr should be 0
  178. #
  179. # Test for unreachable slave
  180. #
  181. Scenario: Handle incoming notify (unreachable slave)
  182. Given I have bind10 running with configuration xfrin/retransfer_master.conf with cmdctl port 47804 as master
  183. And wait for master stderr message BIND10_STARTED_CC
  184. And wait for master stderr message CMDCTL_STARTED
  185. And wait for master stderr message AUTH_SERVER_STARTED
  186. And wait for master stderr message XFROUT_STARTED
  187. And wait for master stderr message ZONEMGR_STARTED
  188. And wait for master stderr message STATS_STARTING
  189. When I send bind10 with cmdctl port 47804 the command Xfrout notify example.org IN
  190. Then wait for new master stderr message XFROUT_NOTIFY_COMMAND
  191. Then wait for new master stderr message NOTIFY_OUT_SENDING_NOTIFY
  192. Then wait for new master stderr message NOTIFY_OUT_TIMEOUT
  193. #
  194. # Test1 for Xfrout statistics
  195. #
  196. # check statistics change
  197. #
  198. # wait until stats request at least after NOTIFY_OUT_TIMEOUT
  199. wait for new master stderr message XFROUT_RECEIVED_GETSTATS_COMMAND
  200. When I query statistics zones of bind10 module Xfrout with cmdctl port 47804
  201. last bindctl output should not contain "error"
  202. Then the statistics counter notifyoutv4 for the zone _SERVER_ should be 0
  203. Then the statistics counter notifyoutv4 for the zone example.org. should be 0
  204. Then the statistics counter notifyoutv6 for the zone _SERVER_ should be greater than 0
  205. Then the statistics counter notifyoutv6 for the zone example.org. should be greater than 0
  206. Then the statistics counter xfrrej for the zone _SERVER_ should be 0
  207. Then the statistics counter xfrrej for the zone example.org. should be 0
  208. Then the statistics counter xfrreqdone for the zone _SERVER_ should be 0
  209. Then the statistics counter xfrreqdone for the zone example.org. should be 0
  210. When I query statistics socket of bind10 module Xfrout with cmdctl port 47804
  211. Then the statistics counter open should be 1
  212. Then the statistics counter openfail should be 0
  213. Then the statistics counter close should be 0
  214. Then the statistics counter bindfail should be 0
  215. Then the statistics counter acceptfail should be 0
  216. Then the statistics counter accept should be 0
  217. Then the statistics counter senderr should be 0
  218. Then the statistics counter recverr should be 0
  219. #
  220. # Test for NOTIFY that would result in NOTAUTH
  221. #
  222. Scenario: Handle incoming notify that does match authoritative zones
  223. Given I have bind10 running with configuration xfrin/retransfer_master.conf with cmdctl port 47804 as master
  224. And wait for master stderr message BIND10_STARTED_CC
  225. And wait for master stderr message CMDCTL_STARTED
  226. And wait for master stderr message AUTH_SERVER_STARTED
  227. And wait for master stderr message XFROUT_STARTED
  228. And wait for master stderr message ZONEMGR_STARTED
  229. And wait for master stderr message STATS_STARTING
  230. And I have bind10 running with configuration xfrin/retransfer_slave_notify.conf
  231. And wait for bind10 stderr message BIND10_STARTED_CC
  232. And wait for bind10 stderr message CMDCTL_STARTED
  233. And wait for bind10 stderr message AUTH_SERVER_STARTED
  234. And wait for bind10 stderr message XFRIN_STARTED
  235. And wait for bind10 stderr message ZONEMGR_STARTED
  236. #
  237. # replace master's data source with unmatched zone for slave's zone.
  238. # we restart Xfrout to make it sure.
  239. #
  240. When I send bind10 the following commands with cmdctl port 47804
  241. """
  242. config set data_sources/classes/IN[0]/params/database_file data/ixfr-out/zones.sqlite3
  243. config set Auth/database_file data/ixfr-out/zones.sqlite3
  244. config set Xfrout/zone_config[0]/origin example.com
  245. config commit
  246. Xfrout shutdown
  247. """
  248. last bindctl output should not contain "error"
  249. And wait for new master stderr message XFROUT_STARTED
  250. A query for www.example.com to [::1]:47806 should have rcode REFUSED
  251. When I send bind10 with cmdctl port 47804 the command Xfrout notify example.com IN
  252. Then wait for new master stderr message XFROUT_NOTIFY_COMMAND
  253. Then wait for new bind10 stderr message AUTH_RECEIVED_NOTIFY_NOTAUTH
  254. Then wait for new master stderr message NOTIFY_OUT_REPLY_RECEIVED
  255. A query for www.example.com to [::1]:47806 should have rcode REFUSED
  256. #
  257. # Test for NOTIFY that's not in the secondaries list
  258. #
  259. Scenario: Handle incoming notify that is not in the secondaries list
  260. Given I have bind10 running with configuration xfrin/retransfer_master.conf with cmdctl port 47804 as master
  261. And wait for master stderr message BIND10_STARTED_CC
  262. And wait for master stderr message CMDCTL_STARTED
  263. And wait for master stderr message AUTH_SERVER_STARTED
  264. And wait for master stderr message XFROUT_STARTED
  265. And wait for master stderr message ZONEMGR_STARTED
  266. And wait for master stderr message STATS_STARTING
  267. And I have bind10 running with configuration xfrin/retransfer_slave_notify.conf
  268. And wait for bind10 stderr message BIND10_STARTED_CC
  269. And wait for bind10 stderr message CMDCTL_STARTED
  270. And wait for bind10 stderr message AUTH_SERVER_STARTED
  271. And wait for bind10 stderr message XFRIN_STARTED
  272. And wait for bind10 stderr message ZONEMGR_STARTED
  273. #
  274. # Empty slave's secondaries list, and restart zonemgr to make it sure
  275. #
  276. When I send bind10 the following commands with cmdctl
  277. """
  278. config remove Zonemgr/secondary_zones[0]
  279. config commit
  280. Zonemgr shutdown
  281. """
  282. last bindctl output should not contain "error"
  283. And wait for new bind10 stderr message ZONEMGR_STARTED
  284. A query for www.example.org to [::1]:47806 should have rcode NXDOMAIN
  285. When I send bind10 with cmdctl port 47804 the command Xfrout notify example.org IN
  286. Then wait for new master stderr message XFROUT_NOTIFY_COMMAND
  287. Then wait for new bind10 stderr message AUTH_RECEIVED_NOTIFY
  288. Then wait for new bind10 stderr message ZONEMGR_RECEIVE_NOTIFY
  289. Then wait for new bind10 stderr message ZONEMGR_ZONE_NOTIFY_NOT_SECONDARY
  290. Then wait for new master stderr message NOTIFY_OUT_REPLY_RECEIVED
  291. A query for www.example.org to [::1]:47806 should have rcode NXDOMAIN