queries.feature 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364
  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: Glue
  6. # Check the auth server returns the correct glue when asked for it.
  7. Given I have bind10 running with configuration glue.config
  8. And wait for bind10 stderr message BIND10_STARTED_CC
  9. And wait for bind10 stderr message CMDCTL_STARTED
  10. And wait for bind10 stderr message AUTH_SERVER_STARTED
  11. # This query should result in a delegation with two NS; one in the
  12. # delegated zone and one in a so called out-of-bailiwick zone for which
  13. # the auth server has authority, too. For the former, the server
  14. # should return glue in the parent zone. For the latter, BIND 9 and
  15. # BIND 10 behave differently; BIND 9 uses "glue" in the parent zone
  16. # (since this is the root zone everything can be considered a valid
  17. # glue). BIND 10 (using sqlite3 data source) searches the other zone
  18. # and uses the authoritative data in that zone (which is intentionally
  19. # different from the glue in the root zone).
  20. A query for foo.bar.example type A should have rcode NOERROR
  21. The answer section of the last query response should be
  22. """
  23. """
  24. The authority section of the last query response should be
  25. """
  26. example. 172800 IN NS NS1.example.COM.
  27. example. 172800 IN NS NS.example.
  28. """
  29. The additional section of the last query response should be
  30. """
  31. NS.example. 172800 IN A 192.0.2.1
  32. NS.example. 172800 IN A 192.0.2.2
  33. NS1.example.COM. 172800 IN A 192.0.2.3
  34. """
  35. # Test we don't get out-of-zone glue
  36. A query for example.net type A should have rcode NOERROR
  37. The answer section of the last query response should be
  38. """
  39. """
  40. The authority section of the last query response should be
  41. """
  42. example.net. 300 IN NS ns2.example.info.
  43. example.net. 300 IN NS ns1.example.info.
  44. """
  45. The additional section of the last query response should be
  46. """
  47. """
  48. Scenario: Repeated queries
  49. Given I have bind10 running with configuration example.org.inmem.config
  50. And wait for bind10 stderr message BIND10_STARTED_CC
  51. And wait for bind10 stderr message CMDCTL_STARTED
  52. And wait for bind10 stderr message AUTH_SERVER_STARTED
  53. And wait for bind10 stderr message STATS_STARTING
  54. bind10 module Auth should be running
  55. And bind10 module Stats should be running
  56. And bind10 module Resolver should not be running
  57. And bind10 module Xfrout should not be running
  58. And bind10 module Zonemgr should not be running
  59. And bind10 module Xfrin should not be running
  60. And bind10 module StatsHttpd should not be running
  61. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  62. # make sure Auth module receives a command
  63. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  64. Then I query statistics zones of bind10 module Auth
  65. And last bindctl output should not contain "error"
  66. The statistics counters are 0 in category .Auth.zones._SERVER_
  67. A query for www.example.org should have rcode NOERROR
  68. The last query response should have flags qr aa
  69. The last query response should have ancount 1
  70. The last query response should have nscount 2
  71. The last query response should have adcount 2
  72. The answer section of the last query response should be
  73. """
  74. www.example.org. 3600 IN A 192.0.2.1
  75. """
  76. The authority section of the last query response should be
  77. """
  78. example.org. 3600 IN NS ns1.example.org.
  79. example.org. 3600 IN NS ns2.example.org.
  80. """
  81. The additional section of the last query response should be
  82. """
  83. ns1.example.org. 3600 IN A 192.0.2.3
  84. ns2.example.org. 3600 IN A 192.0.2.4
  85. """
  86. # Make sure handling statistics command handling checked below is
  87. # after this query
  88. And wait for bind10 stderr message AUTH_SEND_NORMAL_RESPONSE
  89. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  90. # make sure Auth module receives a command
  91. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  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 | 1 |
  97. | request.udp | 1 |
  98. | opcode.query | 1 |
  99. | responses | 1 |
  100. | qrysuccess | 1 |
  101. | qryauthans | 1 |
  102. | rcode.noerror | 1 |
  103. # Repeat of the above
  104. A query for www.example.org should have rcode NOERROR
  105. The last query response should have flags qr aa
  106. The last query response should have ancount 1
  107. The last query response should have nscount 2
  108. The last query response should have adcount 2
  109. The answer section of the last query response should be
  110. """
  111. www.example.org. 3600 IN A 192.0.2.1
  112. """
  113. The authority section of the last query response should be
  114. """
  115. example.org. 3600 IN NS ns1.example.org.
  116. example.org. 3600 IN NS ns2.example.org.
  117. """
  118. The additional section of the last query response should be
  119. """
  120. ns1.example.org. 3600 IN A 192.0.2.3
  121. ns2.example.org. 3600 IN A 192.0.2.4
  122. """
  123. # Make sure handling statistics command handling checked below is
  124. # after this query
  125. And wait for new bind10 stderr message AUTH_SEND_NORMAL_RESPONSE
  126. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  127. # make sure Auth module receives a command
  128. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  129. Then I query statistics zones of bind10 module Auth
  130. And last bindctl output should not contain "error"
  131. The statistics counters are 0 in category .Auth.zones._SERVER_ except for the following items
  132. | item_name | item_value |
  133. | request.v4 | 2 |
  134. | request.udp | 2 |
  135. | opcode.query | 2 |
  136. | responses | 2 |
  137. | qrysuccess | 2 |
  138. | qryauthans | 2 |
  139. | rcode.noerror | 2 |
  140. # And now query something completely different
  141. A recursive query for nosuchname.example.org should have rcode NXDOMAIN
  142. The last query response should have flags qr aa rd
  143. The last query response should have ancount 0
  144. The last query response should have nscount 1
  145. The last query response should have adcount 0
  146. The authority section of the last query response should be
  147. """
  148. example.org. 3600 IN SOA ns1.example.org. admin.example.org. 1234 3600 1800 2419200 7200
  149. """
  150. # Make sure handling statistics command handling checked below is
  151. # after this query
  152. And wait for new bind10 stderr message AUTH_SEND_NORMAL_RESPONSE
  153. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  154. # make sure Auth module receives a command
  155. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  156. Then I query statistics zones of bind10 module Auth
  157. And last bindctl output should not contain "error"
  158. The statistics counters are 0 in category .Auth.zones._SERVER_ except for the following items
  159. | item_name | item_value |
  160. | request.v4 | 3 |
  161. | request.udp | 3 |
  162. | opcode.query | 3 |
  163. | responses | 3 |
  164. | qrysuccess | 2 |
  165. | qryauthans | 3 |
  166. | qryrecursion | 1 |
  167. | rcode.noerror | 2 |
  168. | rcode.nxdomain | 1 |
  169. Scenario: ANY query
  170. Given I have bind10 running with configuration example.org.inmem.config
  171. And wait for bind10 stderr message BIND10_STARTED_CC
  172. And wait for bind10 stderr message CMDCTL_STARTED
  173. And wait for bind10 stderr message AUTH_SERVER_STARTED
  174. bind10 module Auth should be running
  175. And bind10 module Stats should be running
  176. And bind10 module Resolver should not be running
  177. And bind10 module Xfrout should not be running
  178. And bind10 module Zonemgr should not be running
  179. And bind10 module Xfrin should not be running
  180. And bind10 module StatsHttpd should not be running
  181. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  182. # make sure Auth module receives a command
  183. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  184. Then I query statistics zones of bind10 module Auth
  185. And last bindctl output should not contain "error"
  186. The statistics counters are 0 in category .Auth.zones._SERVER_
  187. A query for example.org type ANY should have rcode NOERROR
  188. The last query response should have flags qr aa
  189. The last query response should have ancount 4
  190. The last query response should have nscount 0
  191. The last query response should have adcount 3
  192. The answer section of the last query response should be
  193. """
  194. example.org. 3600 IN NS ns1.example.org.
  195. example.org. 3600 IN NS ns2.example.org.
  196. example.org. 3600 IN SOA ns1.example.org. admin.example.org. 1234 3600 1800 2419200 7200
  197. example.org. 3600 IN MX 10 mail.example.org.
  198. """
  199. The additional section of the last query response should be
  200. """
  201. ns1.example.org. 3600 IN A 192.0.2.3
  202. ns2.example.org. 3600 IN A 192.0.2.4
  203. mail.example.org. 3600 IN A 192.0.2.10
  204. """
  205. # Make sure handling statistics command handling checked below is
  206. # after this query
  207. And wait for bind10 stderr message AUTH_SEND_NORMAL_RESPONSE
  208. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  209. # make sure Auth module receives a command
  210. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  211. Then I query statistics zones of bind10 module Auth
  212. And last bindctl output should not contain "error"
  213. The statistics counters are 0 in category .Auth.zones._SERVER_ except for the following items
  214. | item_name | item_value |
  215. | request.v4 | 1 |
  216. | request.udp | 1 |
  217. | opcode.query | 1 |
  218. | responses | 1 |
  219. | qrysuccess | 1 |
  220. | qryauthans | 1 |
  221. | rcode.noerror | 1 |
  222. Scenario: Delegation query for unsigned child zone
  223. Given I have bind10 running with configuration example.org.inmem.config
  224. And wait for bind10 stderr message BIND10_STARTED_CC
  225. And wait for bind10 stderr message CMDCTL_STARTED
  226. And wait for bind10 stderr message AUTH_SERVER_STARTED
  227. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  228. # make sure Auth module receives a command
  229. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  230. Then I query statistics zones of bind10 module Auth
  231. And last bindctl output should not contain "error"
  232. The statistics counters are 0 in category .Auth.zones._SERVER_
  233. A dnssec query for www.sub.example.org type AAAA should have rcode NOERROR
  234. The last query response should have flags qr
  235. The last query response should have edns_flags do
  236. The last query response should have ancount 0
  237. The last query response should have nscount 1
  238. The last query response should have adcount 2
  239. The authority section of the last query response should be
  240. """
  241. sub.example.org. 3600 IN NS ns.sub.example.org.
  242. """
  243. The additional section of the last query response should be
  244. """
  245. ns.sub.example.org. 3600 IN A 192.0.2.101
  246. """
  247. # Make sure handling statistics command handling checked below is
  248. # after this query
  249. And wait for bind10 stderr message AUTH_SEND_NORMAL_RESPONSE
  250. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  251. # make sure Auth module receives a command
  252. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  253. Then I query statistics zones of bind10 module Auth
  254. And last bindctl output should not contain "error"
  255. The statistics counters are 0 in category .Auth.zones._SERVER_ except for the following items
  256. | item_name | item_value |
  257. | request.v4 | 1 |
  258. | request.udp | 1 |
  259. | request.edns0 | 1 |
  260. | request.dnssec_ok | 1 |
  261. | opcode.query | 1 |
  262. | responses | 1 |
  263. | response.edns0 | 1 |
  264. | qrynoauthans | 1 |
  265. | qryreferral | 1 |
  266. | rcode.noerror | 1 |
  267. Scenario: SSHFP query
  268. # We are testing one more RR type for a normal successful case
  269. Given I have bind10 running with configuration example.org.inmem.config
  270. And wait for bind10 stderr message BIND10_STARTED_CC
  271. And wait for bind10 stderr message CMDCTL_STARTED
  272. And wait for bind10 stderr message AUTH_SERVER_STARTED
  273. bind10 module Auth should be running
  274. And bind10 module Stats should be running
  275. And bind10 module Resolver should not be running
  276. And bind10 module Xfrout should not be running
  277. And bind10 module Zonemgr should not be running
  278. And bind10 module Xfrin should not be running
  279. And bind10 module StatsHttpd should not be running
  280. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  281. # make sure Auth module receives a command
  282. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  283. Then I query statistics zones of bind10 module Auth
  284. And last bindctl output should not contain "error"
  285. The statistics counters are 0 in category .Auth.zones._SERVER_
  286. A query for example.org type SSHFP should have rcode NOERROR
  287. The last query response should have ancount 0
  288. # Make sure handling statistics command handling checked below is
  289. # after this query
  290. And wait for bind10 stderr message AUTH_SEND_NORMAL_RESPONSE
  291. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  292. # make sure Auth module receives a command
  293. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  294. Then I query statistics zones of bind10 module Auth
  295. And last bindctl output should not contain "error"
  296. The statistics counters are 0 in category .Auth.zones._SERVER_ except for the following items
  297. | item_name | item_value |
  298. | request.v4 | 1 |
  299. | request.udp | 1 |
  300. | opcode.query | 1 |
  301. | responses | 1 |
  302. | qryauthans | 1 |
  303. | qrynxrrset | 1 |
  304. | rcode.noerror | 1 |
  305. A query for shell.example.org type SSHFP should have rcode NOERROR
  306. The last query response should have ancount 1
  307. The answer section of the last query response should be
  308. """
  309. shell.example.org. 3600 IN SSHFP 2 1 123456789abcdef67890123456789abcdef67890
  310. """
  311. # Make sure handling statistics command handling checked below is
  312. # after this query
  313. And wait for bind10 stderr message AUTH_SEND_NORMAL_RESPONSE
  314. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  315. # make sure Auth module receives a command
  316. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  317. Then I query statistics zones of bind10 module Auth
  318. And last bindctl output should not contain "error"
  319. The statistics counters are 0 in category .Auth.zones._SERVER_ except for the following items
  320. | item_name | item_value |
  321. | request.v4 | 2 |
  322. | request.udp | 2 |
  323. | opcode.query | 2 |
  324. | responses | 2 |
  325. | qrysuccess | 1 |
  326. | qryauthans | 2 |
  327. | qrynxrrset | 1 |
  328. | rcode.noerror | 2 |