xfrin_notify_handling.feature 18 KB

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