queries.feature 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  1. Feature: Querying feature
  2. This feature is a collection of non-specific querying tests;
  3. for instance whether multiple queries in a row return consistent
  4. answers.
  5. Scenario: Repeated queries
  6. Given I have bind10 running with configuration example.org.inmem.config
  7. And wait for bind10 stderr message BIND10_STARTED_CC
  8. And wait for bind10 stderr message CMDCTL_STARTED
  9. And wait for bind10 stderr message AUTH_SERVER_STARTED
  10. And wait for bind10 stderr message STATS_STARTING
  11. bind10 module Auth should be running
  12. And bind10 module Stats should be running
  13. And bind10 module Resolver should not be running
  14. And bind10 module Xfrout should not be running
  15. And bind10 module Zonemgr should not be running
  16. And bind10 module Xfrin should not be running
  17. And bind10 module StatsHttpd should not be running
  18. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  19. # make sure Auth module receives a command
  20. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  21. # make sure Auth module replied to the command
  22. And wait for new bind10 stderr message CC_REPLY
  23. # make sure the response is for 'getstats'
  24. And wait for new bind10 stderr message v4
  25. Then I query statistics zones of bind10 module Auth
  26. And last bindctl output should not contain "error"
  27. The statistics counters are 0 in category .Auth.zones._SERVER_
  28. A query for www.example.org should have rcode NOERROR
  29. The last query response should have flags qr aa rd
  30. The last query response should have ancount 1
  31. The last query response should have nscount 2
  32. The last query response should have adcount 2
  33. The answer section of the last query response should be
  34. """
  35. www.example.org. 3600 IN A 192.0.2.1
  36. """
  37. The authority section of the last query response should be
  38. """
  39. example.org. 3600 IN NS ns1.example.org.
  40. example.org. 3600 IN NS ns2.example.org.
  41. """
  42. The additional section of the last query response should be
  43. """
  44. ns1.example.org. 3600 IN A 192.0.2.3
  45. ns2.example.org. 3600 IN A 192.0.2.4
  46. """
  47. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  48. # make sure Auth module receives a command
  49. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  50. # make sure Auth module replied to the command
  51. And wait for new bind10 stderr message CC_REPLY
  52. # make sure the response is for 'getstats'
  53. And wait for new bind10 stderr message v4
  54. Then I query statistics zones of bind10 module Auth
  55. And last bindctl output should not contain "error"
  56. The statistics counters are 0 in category .Auth.zones._SERVER_ except for the following items
  57. | item_name | item_value |
  58. | request.v4 | 1 |
  59. | request.udp | 1 |
  60. | opcode.query | 1 |
  61. | responses | 1 |
  62. | qrysuccess | 1 |
  63. | qryauthans | 1 |
  64. | rcode.noerror | 1 |
  65. # Repeat of the above
  66. A query for www.example.org should have rcode NOERROR
  67. The last query response should have flags qr aa rd
  68. The last query response should have ancount 1
  69. The last query response should have nscount 2
  70. The last query response should have adcount 2
  71. The answer section of the last query response should be
  72. """
  73. www.example.org. 3600 IN A 192.0.2.1
  74. """
  75. The authority section of the last query response should be
  76. """
  77. example.org. 3600 IN NS ns1.example.org.
  78. example.org. 3600 IN NS ns2.example.org.
  79. """
  80. The additional section of the last query response should be
  81. """
  82. ns1.example.org. 3600 IN A 192.0.2.3
  83. ns2.example.org. 3600 IN A 192.0.2.4
  84. """
  85. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  86. # make sure Auth module receives a command
  87. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  88. # make sure Auth module replied to the command
  89. And wait for new bind10 stderr message CC_REPLY
  90. # make sure the response is for 'getstats'
  91. And wait for new bind10 stderr message v4
  92. Then I query statistics zones of bind10 module Auth
  93. And last bindctl output should not contain "error"
  94. The statistics counters are 0 in category .Auth.zones._SERVER_ except for the following items
  95. | item_name | item_value |
  96. | request.v4 | 2 |
  97. | request.udp | 2 |
  98. | opcode.query | 2 |
  99. | responses | 2 |
  100. | qrysuccess | 2 |
  101. | qryauthans | 2 |
  102. | rcode.noerror | 2 |
  103. # And now query something completely different
  104. A query for nosuchname.example.org should have rcode NXDOMAIN
  105. The last query response should have flags qr aa rd
  106. The last query response should have ancount 0
  107. The last query response should have nscount 1
  108. The last query response should have adcount 0
  109. The authority section of the last query response should be
  110. """
  111. example.org. 3600 IN SOA ns1.example.org. admin.example.org. 1234 3600 1800 2419200 7200
  112. """
  113. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  114. # make sure Auth module receives a command
  115. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  116. # make sure Auth module replied to the command
  117. And wait for new bind10 stderr message CC_REPLY
  118. # make sure the response is for 'getstats'
  119. And wait for new bind10 stderr message v4
  120. Then I query statistics zones of bind10 module Auth
  121. And last bindctl output should not contain "error"
  122. The statistics counters are 0 in category .Auth.zones._SERVER_ except for the following items
  123. | item_name | item_value |
  124. | request.v4 | 3 |
  125. | request.udp | 3 |
  126. | opcode.query | 3 |
  127. | responses | 3 |
  128. | qrysuccess | 2 |
  129. | qryauthans | 3 |
  130. | rcode.noerror | 2 |
  131. | rcode.nxdomain | 1 |
  132. Scenario: ANY query
  133. Given I have bind10 running with configuration example.org.inmem.config
  134. And wait for bind10 stderr message BIND10_STARTED_CC
  135. And wait for bind10 stderr message CMDCTL_STARTED
  136. And wait for bind10 stderr message AUTH_SERVER_STARTED
  137. bind10 module Auth should be running
  138. And bind10 module Stats should be running
  139. And bind10 module Resolver should not be running
  140. And bind10 module Xfrout should not be running
  141. And bind10 module Zonemgr should not be running
  142. And bind10 module Xfrin should not be running
  143. And bind10 module StatsHttpd should not be running
  144. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  145. # make sure Auth module receives a command
  146. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  147. # make sure Auth module replied to the command
  148. And wait for new bind10 stderr message CC_REPLY
  149. # make sure the response is for 'getstats'
  150. And wait for new bind10 stderr message v4
  151. Then I query statistics zones of bind10 module Auth
  152. And last bindctl output should not contain "error"
  153. The statistics counters are 0 in category .Auth.zones._SERVER_
  154. A query for example.org type ANY should have rcode NOERROR
  155. The last query response should have flags qr aa rd
  156. The last query response should have ancount 4
  157. The last query response should have nscount 0
  158. The last query response should have adcount 3
  159. The answer section of the last query response should be
  160. """
  161. example.org. 3600 IN NS ns1.example.org.
  162. example.org. 3600 IN NS ns2.example.org.
  163. example.org. 3600 IN SOA ns1.example.org. admin.example.org. 1234 3600 1800 2419200 7200
  164. example.org. 3600 IN MX 10 mail.example.org.
  165. """
  166. The additional section of the last query response should be
  167. """
  168. ns1.example.org. 3600 IN A 192.0.2.3
  169. ns2.example.org. 3600 IN A 192.0.2.4
  170. mail.example.org. 3600 IN A 192.0.2.10
  171. """
  172. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  173. # make sure Auth module receives a command
  174. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  175. # make sure Auth module replied to the command
  176. And wait for new bind10 stderr message CC_REPLY
  177. # make sure the response is for 'getstats'
  178. And wait for new bind10 stderr message v4
  179. Then I query statistics zones of bind10 module Auth
  180. And last bindctl output should not contain "error"
  181. The statistics counters are 0 in category .Auth.zones._SERVER_ except for the following items
  182. | item_name | item_value |
  183. | request.v4 | 1 |
  184. | request.udp | 1 |
  185. | opcode.query | 1 |
  186. | responses | 1 |
  187. | qrysuccess | 1 |
  188. | qryauthans | 1 |
  189. | rcode.noerror | 1 |
  190. Scenario: Delegation query for unsigned child zone
  191. Given I have bind10 running with configuration example.org.inmem.config
  192. And wait for bind10 stderr message BIND10_STARTED_CC
  193. And wait for bind10 stderr message CMDCTL_STARTED
  194. And wait for bind10 stderr message AUTH_SERVER_STARTED
  195. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  196. # make sure Auth module receives a command
  197. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  198. # make sure Auth module replied to the command
  199. And wait for new bind10 stderr message CC_REPLY
  200. # make sure the response is for 'getstats'
  201. And wait for new bind10 stderr message v4
  202. Then I query statistics zones of bind10 module Auth
  203. And last bindctl output should not contain "error"
  204. The statistics counters are 0 in category .Auth.zones._SERVER_
  205. A dnssec query for www.sub.example.org type AAAA should have rcode NOERROR
  206. The last query response should have flags qr rd
  207. The last query response should have edns_flags do
  208. The last query response should have ancount 0
  209. The last query response should have nscount 1
  210. The last query response should have adcount 2
  211. The authority section of the last query response should be
  212. """
  213. sub.example.org. 3600 IN NS ns.sub.example.org.
  214. """
  215. The additional section of the last query response should be
  216. """
  217. ns.sub.example.org. 3600 IN A 192.0.2.101
  218. """
  219. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  220. # make sure Auth module receives a command
  221. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  222. # make sure Auth module replied to the command
  223. And wait for new bind10 stderr message CC_REPLY
  224. # make sure the response is for 'getstats'
  225. And wait for new bind10 stderr message v4
  226. Then I query statistics zones of bind10 module Auth
  227. And last bindctl output should not contain "error"
  228. The statistics counters are 0 in category .Auth.zones._SERVER_ except for the following items
  229. | item_name | item_value |
  230. | request.v4 | 1 |
  231. | request.udp | 1 |
  232. | request.edns0 | 1 |
  233. | request.dnssec_ok | 1 |
  234. | opcode.query | 1 |
  235. | responses | 1 |
  236. | response.edns0 | 1 |
  237. | qrynoauthans | 1 |
  238. | qryreferral | 1 |
  239. | rcode.noerror | 1 |
  240. Scenario: SSHFP query
  241. # We are testing one more RR type for a normal successful case
  242. Given I have bind10 running with configuration example.org.inmem.config
  243. And wait for bind10 stderr message BIND10_STARTED_CC
  244. And wait for bind10 stderr message CMDCTL_STARTED
  245. And wait for bind10 stderr message AUTH_SERVER_STARTED
  246. bind10 module Auth should be running
  247. And bind10 module Stats should be running
  248. And bind10 module Resolver should not be running
  249. And bind10 module Xfrout should not be running
  250. And bind10 module Zonemgr should not be running
  251. And bind10 module Xfrin should not be running
  252. And bind10 module StatsHttpd should not be running
  253. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  254. # make sure Auth module receives a command
  255. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  256. # make sure Auth module replied to the command
  257. And wait for new bind10 stderr message CC_REPLY
  258. # make sure the response is for 'getstats'
  259. And wait for new bind10 stderr message v4
  260. Then I query statistics zones of bind10 module Auth
  261. And last bindctl output should not contain "error"
  262. The statistics counters are 0 in category .Auth.zones._SERVER_
  263. A query for example.org type SSHFP should have rcode NOERROR
  264. The last query response should have ancount 0
  265. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  266. # make sure Auth module receives a command
  267. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  268. # make sure Auth module replied to the command
  269. And wait for new bind10 stderr message CC_REPLY
  270. # make sure the response is for 'getstats'
  271. And wait for new bind10 stderr message v4
  272. Then I query statistics zones of bind10 module Auth
  273. And last bindctl output should not contain "error"
  274. The statistics counters are 0 in category .Auth.zones._SERVER_ except for the following items
  275. | item_name | item_value |
  276. | request.v4 | 1 |
  277. | request.udp | 1 |
  278. | opcode.query | 1 |
  279. | responses | 1 |
  280. | qryauthans | 1 |
  281. | qrynxrrset | 1 |
  282. | rcode.noerror | 1 |
  283. A query for shell.example.org type SSHFP should have rcode NOERROR
  284. The last query response should have ancount 1
  285. The answer section of the last query response should be
  286. """
  287. shell.example.org. 3600 IN SSHFP 2 1 123456789abcdef67890123456789abcdef67890
  288. """
  289. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  290. # make sure Auth module receives a command
  291. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  292. # make sure Auth module replied to the command
  293. And wait for new bind10 stderr message CC_REPLY
  294. # make sure the response is for 'getstats'
  295. And wait for new bind10 stderr message v4
  296. Then I query statistics zones of bind10 module Auth
  297. And last bindctl output should not contain "error"
  298. The statistics counters are 0 in category .Auth.zones._SERVER_ except for the following items
  299. | item_name | item_value |
  300. | request.v4 | 2 |
  301. | request.udp | 2 |
  302. | opcode.query | 2 |
  303. | responses | 2 |
  304. | qrysuccess | 1 |
  305. | qryauthans | 2 |
  306. | qrynxrrset | 1 |
  307. | rcode.noerror | 2 |