xfrin_notify_handling.feature 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  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. # wait until the last stats requesting is finished
  103. wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  104. wait for new bind10 stderr message XFRIN_RECEIVED_GETSTATS_COMMAND
  105. When I query statistics zones of bind10 module Xfrin with cmdctl
  106. last bindctl output should not contain "error"
  107. Then the statistics counter soaoutv4 for the zone _SERVER_ should be 0
  108. Then the statistics counter soaoutv4 for the zone example.org. should be 0
  109. Then the statistics counter soaoutv6 for the zone _SERVER_ should be 1
  110. Then the statistics counter soaoutv6 for the zone example.org. should be 1
  111. Then the statistics counter axfrreqv4 for the zone _SERVER_ should be 0
  112. Then the statistics counter axfrreqv4 for the zone example.org. should be 0
  113. Then the statistics counter axfrreqv6 for the zone _SERVER_ should be 1
  114. Then the statistics counter axfrreqv6 for the zone example.org. should be 1
  115. Then the statistics counter ixfrreqv4 for the zone _SERVER_ should be 0
  116. Then the statistics counter ixfrreqv4 for the zone example.org. should be 0
  117. Then the statistics counter ixfrreqv6 for the zone _SERVER_ should be 0
  118. Then the statistics counter ixfrreqv6 for the zone example.org. should be 0
  119. Then the statistics counter xfrsuccess for the zone _SERVER_ should be 1
  120. Then the statistics counter xfrsuccess for the zone example.org. should be 1
  121. Then the statistics counter xfrfail for the zone _SERVER_ should be 0
  122. Then the statistics counter xfrfail for the zone example.org. should be 0
  123. Then the statistics counter time_to_ixfr for the zone _SERVER_ should be 0.0
  124. Then the statistics counter time_to_ixfr for the zone example.org. should be 0.0
  125. Then the statistics counter time_to_axfr for the zone _SERVER_ should be greater than 0.0
  126. Then the statistics counter time_to_axfr for the zone example.org. should be greater than 0.0
  127. #
  128. # Test for Xfr request rejected
  129. #
  130. Scenario: Handle incoming notify (XFR request rejected)
  131. Given I have bind10 running with configuration xfrin/retransfer_master.conf with cmdctl port 47804 as master
  132. And wait for master stderr message BIND10_STARTED_CC
  133. And wait for master stderr message CMDCTL_STARTED
  134. And wait for master stderr message AUTH_SERVER_STARTED
  135. And wait for master stderr message XFROUT_STARTED
  136. And wait for master stderr message ZONEMGR_STARTED
  137. And wait for master stderr message STATS_STARTING
  138. And I have bind10 running with configuration xfrin/retransfer_slave_notify.conf
  139. And wait for bind10 stderr message BIND10_STARTED_CC
  140. And wait for bind10 stderr message CMDCTL_STARTED
  141. And wait for bind10 stderr message AUTH_SERVER_STARTED
  142. And wait for bind10 stderr message XFRIN_STARTED
  143. And wait for bind10 stderr message ZONEMGR_STARTED
  144. A query for www.example.org to [::1]:47806 should have rcode NXDOMAIN
  145. #
  146. # Test5 for Xfrout statistics
  147. #
  148. # check initial statistics
  149. #
  150. When I query statistics zones of bind10 module Xfrout with cmdctl port 47804
  151. last bindctl output should not contain "error"
  152. last bindctl output should not contain "example.org."
  153. Then the statistics counter notifyoutv4 for the zone _SERVER_ should be 0
  154. Then the statistics counter notifyoutv6 for the zone _SERVER_ should be 0
  155. Then the statistics counter xfrrej for the zone _SERVER_ should be 0
  156. Then the statistics counter xfrreqdone for the zone _SERVER_ should be 0
  157. When I query statistics ixfr_running of bind10 module Xfrout with cmdctl port 47804
  158. Then the statistics counter ixfr_running should be 0
  159. When I query statistics axfr_running of bind10 module Xfrout with cmdctl port 47804
  160. Then the statistics counter axfr_running should be 0
  161. When I query statistics socket of bind10 module Xfrout with cmdctl port 47804
  162. Then the statistics counter open should be between 0 and 1
  163. Then the statistics counter openfail should be 0
  164. Then the statistics counter close should be 0
  165. Then the statistics counter bindfail should be 0
  166. Then the statistics counter acceptfail should be 0
  167. Then the statistics counter accept should be 0
  168. Then the statistics counter senderr should be 0
  169. Then the statistics counter recverr should be 0
  170. #
  171. # Test6 for Xfrin statistics
  172. #
  173. # check initial statistics
  174. #
  175. When I query statistics zones of bind10 module Xfrin with cmdctl
  176. last bindctl output should not contain "error"
  177. Then the statistics counter soaoutv4 for the zone _SERVER_ should be 0
  178. Then the statistics counter soaoutv6 for the zone _SERVER_ should be 0
  179. Then the statistics counter axfrreqv4 for the zone _SERVER_ should be 0
  180. Then the statistics counter axfrreqv6 for the zone _SERVER_ should be 0
  181. Then the statistics counter ixfrreqv4 for the zone _SERVER_ should be 0
  182. Then the statistics counter ixfrreqv6 for the zone _SERVER_ should be 0
  183. Then the statistics counter xfrsuccess for the zone _SERVER_ should be 0
  184. Then the statistics counter xfrfail for the zone _SERVER_ should be 0
  185. Then the statistics counter time_to_ixfr for the zone _SERVER_ should be 0.0
  186. Then the statistics counter time_to_axfr for the zone _SERVER_ should be 0.0
  187. #
  188. # set transfer_acl rejection
  189. # Local xfr requests from Xfrin module would be rejected here.
  190. #
  191. When I send bind10 the following commands with cmdctl port 47804
  192. """
  193. config set Xfrout/zone_config[0]/transfer_acl [{"action": "REJECT", "from": "::1"}]
  194. config commit
  195. """
  196. last bindctl output should not contain Error
  197. When I send bind10 with cmdctl port 47804 the command Xfrout notify example.org IN
  198. Then wait for new master stderr message XFROUT_NOTIFY_COMMAND
  199. Then wait for new bind10 stderr message AUTH_RECEIVED_NOTIFY
  200. Then wait for new bind10 stderr message ZONEMGR_RECEIVE_NOTIFY
  201. Then wait for new bind10 stderr message XFRIN_XFR_TRANSFER_STARTED
  202. Then wait for new bind10 stderr message XFRIN_XFR_TRANSFER_PROTOCOL_VIOLATION not XFRIN_XFR_TRANSFER_STARTED
  203. Then wait for new bind10 stderr message ZONEMGR_RECEIVE_XFRIN_FAILED not ZONEMGR_RECEIVE_XFRIN_SUCCESS
  204. Then wait 5 times for new master stderr message NOTIFY_OUT_SENDING_NOTIFY
  205. Then wait for new master stderr message NOTIFY_OUT_RETRY_EXCEEDED
  206. A query for www.example.org to [::1]:47806 should have rcode NXDOMAIN
  207. #
  208. # Test7 for Xfrout statistics
  209. #
  210. # check statistics change
  211. #
  212. # wait until the last stats requesting is finished
  213. wait for new master stderr message STATS_SEND_STATISTICS_REQUEST
  214. wait for new master stderr message XFROUT_RECEIVED_GETSTATS_COMMAND
  215. When I query statistics zones of bind10 module Xfrout with cmdctl port 47804
  216. last bindctl output should not contain "error"
  217. Then the statistics counter notifyoutv4 for the zone _SERVER_ should be 0
  218. Then the statistics counter notifyoutv4 for the zone example.org. should be 0
  219. Then the statistics counter notifyoutv6 for the zone _SERVER_ should be 5
  220. Then the statistics counter notifyoutv6 for the zone example.org. should be 5
  221. # The counts of rejection would be between 1 and 2. They are not
  222. # fixed. It would depend on timing or the platform.
  223. Then the statistics counter xfrrej for the zone _SERVER_ should be greater than 0
  224. Then the statistics counter xfrrej for the zone example.org. should be greater than 0
  225. Then the statistics counter xfrreqdone for the zone _SERVER_ should be 0
  226. Then the statistics counter xfrreqdone for the zone example.org. should be 0
  227. When I query statistics socket of bind10 module Xfrout with cmdctl port 47804
  228. Then the statistics counter open should be 1
  229. Then the statistics counter openfail should be 0
  230. Then the statistics counter close should be 0
  231. Then the statistics counter bindfail should be 0
  232. Then the statistics counter acceptfail should be 0
  233. Then the statistics counter accept should be 1
  234. Then the statistics counter senderr should be 0
  235. Then the statistics counter recverr should be 0
  236. #
  237. # Test8 for Xfrin statistics
  238. #
  239. # check statistics change
  240. #
  241. # wait until the last stats requesting is finished
  242. wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  243. wait for new bind10 stderr message XFRIN_RECEIVED_GETSTATS_COMMAND
  244. When I query statistics zones of bind10 module Xfrin with cmdctl
  245. last bindctl output should not contain "error"
  246. Then the statistics counter soaoutv4 for the zone _SERVER_ should be 0
  247. Then the statistics counter soaoutv4 for the zone example.org. should be 0
  248. Then the statistics counter soaoutv6 for the zone _SERVER_ should be greater than 0
  249. Then the statistics counter soaoutv6 for the zone example.org. should be greater than 0
  250. Then the statistics counter axfrreqv4 for the zone _SERVER_ should be 0
  251. Then the statistics counter axfrreqv4 for the zone example.org. should be 0
  252. Then the statistics counter axfrreqv6 for the zone _SERVER_ should be greater than 0
  253. Then the statistics counter axfrreqv6 for the zone example.org. should be greater than 0
  254. Then the statistics counter ixfrreqv4 for the zone _SERVER_ should be 0
  255. Then the statistics counter ixfrreqv4 for the zone example.org. should be 0
  256. Then the statistics counter ixfrreqv6 for the zone _SERVER_ should be 0
  257. Then the statistics counter ixfrreqv6 for the zone example.org. should be 0
  258. Then the statistics counter xfrsuccess for the zone _SERVER_ should be 0
  259. Then the statistics counter xfrsuccess for the zone example.org. should be 0
  260. Then the statistics counter xfrfail for the zone _SERVER_ should be greater than 0
  261. Then the statistics counter xfrfail for the zone example.org. should be greater than 0
  262. Then the statistics counter time_to_ixfr for the zone _SERVER_ should be 0.0
  263. Then the statistics counter time_to_ixfr for the zone example.org. should be 0.0
  264. Then the statistics counter time_to_axfr for the zone _SERVER_ should be 0.0
  265. Then the statistics counter time_to_axfr for the zone example.org. should be 0.0
  266. #
  267. # Test for unreachable slave
  268. #
  269. Scenario: Handle incoming notify (unreachable slave)
  270. Given I have bind10 running with configuration xfrin/retransfer_master.conf with cmdctl port 47804 as master
  271. And wait for master stderr message BIND10_STARTED_CC
  272. And wait for master stderr message CMDCTL_STARTED
  273. And wait for master stderr message AUTH_SERVER_STARTED
  274. And wait for master stderr message XFROUT_STARTED
  275. And wait for master stderr message ZONEMGR_STARTED
  276. And wait for master stderr message STATS_STARTING
  277. When I send bind10 with cmdctl port 47804 the command Xfrout notify example.org IN
  278. Then wait for new master stderr message XFROUT_NOTIFY_COMMAND
  279. Then wait for new master stderr message NOTIFY_OUT_SENDING_NOTIFY
  280. Then wait for new master stderr message NOTIFY_OUT_TIMEOUT
  281. #
  282. # Test9 for Xfrout statistics
  283. #
  284. # check statistics change
  285. #
  286. # wait until the last stats requesting is finished
  287. wait for new master stderr message STATS_SEND_STATISTICS_REQUEST
  288. wait for new master stderr message XFROUT_RECEIVED_GETSTATS_COMMAND
  289. When I query statistics zones of bind10 module Xfrout with cmdctl port 47804
  290. last bindctl output should not contain "error"
  291. Then the statistics counter notifyoutv4 for the zone _SERVER_ should be 0
  292. Then the statistics counter notifyoutv4 for the zone example.org. should be 0
  293. Then the statistics counter notifyoutv6 for the zone _SERVER_ should be greater than 0
  294. Then the statistics counter notifyoutv6 for the zone example.org. should be greater than 0
  295. Then the statistics counter xfrrej for the zone _SERVER_ should be 0
  296. Then the statistics counter xfrrej for the zone example.org. should be 0
  297. Then the statistics counter xfrreqdone for the zone _SERVER_ should be 0
  298. Then the statistics counter xfrreqdone for the zone example.org. should be 0
  299. When I query statistics socket of bind10 module Xfrout with cmdctl port 47804
  300. Then the statistics counter open should be 1
  301. Then the statistics counter openfail should be 0
  302. Then the statistics counter close should be 0
  303. Then the statistics counter bindfail should be 0
  304. Then the statistics counter acceptfail should be 0
  305. Then the statistics counter accept should be 0
  306. Then the statistics counter senderr should be 0
  307. Then the statistics counter recverr should be 0