queries.feature 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  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. # make sure Auth module replied to the command
  65. And wait for new bind10 stderr message CC_REPLY
  66. # make sure the response is for 'getstats'
  67. And wait for new bind10 stderr message v4
  68. Then I query statistics zones of bind10 module Auth
  69. And last bindctl output should not contain "error"
  70. The statistics counters are 0 in category .Auth.zones._SERVER_
  71. A query for www.example.org should have rcode NOERROR
  72. The last query response should have flags qr aa rd
  73. The last query response should have ancount 1
  74. The last query response should have nscount 2
  75. The last query response should have adcount 2
  76. The answer section of the last query response should be
  77. """
  78. www.example.org. 3600 IN A 192.0.2.1
  79. """
  80. The authority section of the last query response should be
  81. """
  82. example.org. 3600 IN NS ns1.example.org.
  83. example.org. 3600 IN NS ns2.example.org.
  84. """
  85. The additional section of the last query response should be
  86. """
  87. ns1.example.org. 3600 IN A 192.0.2.3
  88. ns2.example.org. 3600 IN A 192.0.2.4
  89. """
  90. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  91. # make sure Auth module receives a command
  92. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  93. # make sure Auth module replied to the command
  94. And wait for new bind10 stderr message CC_REPLY
  95. # make sure the response is for 'getstats'
  96. And wait for new bind10 stderr message v4
  97. Then I query statistics zones of bind10 module Auth
  98. And last bindctl output should not contain "error"
  99. The statistics counters are 0 in category .Auth.zones._SERVER_ except for the following items
  100. | item_name | item_value |
  101. | request.v4 | 1 |
  102. | request.udp | 1 |
  103. | opcode.query | 1 |
  104. | responses | 1 |
  105. | qrysuccess | 1 |
  106. | qryauthans | 1 |
  107. | rcode.noerror | 1 |
  108. # Repeat of the above
  109. A query for www.example.org should have rcode NOERROR
  110. The last query response should have flags qr aa rd
  111. The last query response should have ancount 1
  112. The last query response should have nscount 2
  113. The last query response should have adcount 2
  114. The answer section of the last query response should be
  115. """
  116. www.example.org. 3600 IN A 192.0.2.1
  117. """
  118. The authority section of the last query response should be
  119. """
  120. example.org. 3600 IN NS ns1.example.org.
  121. example.org. 3600 IN NS ns2.example.org.
  122. """
  123. The additional section of the last query response should be
  124. """
  125. ns1.example.org. 3600 IN A 192.0.2.3
  126. ns2.example.org. 3600 IN A 192.0.2.4
  127. """
  128. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  129. # make sure Auth module receives a command
  130. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  131. # make sure Auth module replied to the command
  132. And wait for new bind10 stderr message CC_REPLY
  133. # make sure the response is for 'getstats'
  134. And wait for new bind10 stderr message v4
  135. Then I query statistics zones of bind10 module Auth
  136. And last bindctl output should not contain "error"
  137. The statistics counters are 0 in category .Auth.zones._SERVER_ except for the following items
  138. | item_name | item_value |
  139. | request.v4 | 2 |
  140. | request.udp | 2 |
  141. | opcode.query | 2 |
  142. | responses | 2 |
  143. | qrysuccess | 2 |
  144. | qryauthans | 2 |
  145. | rcode.noerror | 2 |
  146. # And now query something completely different
  147. A query for nosuchname.example.org should have rcode NXDOMAIN
  148. The last query response should have flags qr aa rd
  149. The last query response should have ancount 0
  150. The last query response should have nscount 1
  151. The last query response should have adcount 0
  152. The authority section of the last query response should be
  153. """
  154. example.org. 3600 IN SOA ns1.example.org. admin.example.org. 1234 3600 1800 2419200 7200
  155. """
  156. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  157. # make sure Auth module receives a command
  158. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  159. # make sure Auth module replied to the command
  160. And wait for new bind10 stderr message CC_REPLY
  161. # make sure the response is for 'getstats'
  162. And wait for new bind10 stderr message v4
  163. Then I query statistics zones of bind10 module Auth
  164. And last bindctl output should not contain "error"
  165. The statistics counters are 0 in category .Auth.zones._SERVER_ except for the following items
  166. | item_name | item_value |
  167. | request.v4 | 3 |
  168. | request.udp | 3 |
  169. | opcode.query | 3 |
  170. | responses | 3 |
  171. | qrysuccess | 2 |
  172. | qryauthans | 3 |
  173. | rcode.noerror | 2 |
  174. | rcode.nxdomain | 1 |
  175. Scenario: ANY query
  176. Given I have bind10 running with configuration example.org.inmem.config
  177. And wait for bind10 stderr message BIND10_STARTED_CC
  178. And wait for bind10 stderr message CMDCTL_STARTED
  179. And wait for bind10 stderr message AUTH_SERVER_STARTED
  180. bind10 module Auth should be running
  181. And bind10 module Stats should be running
  182. And bind10 module Resolver should not be running
  183. And bind10 module Xfrout should not be running
  184. And bind10 module Zonemgr should not be running
  185. And bind10 module Xfrin should not be running
  186. And bind10 module StatsHttpd should not be running
  187. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  188. # make sure Auth module receives a command
  189. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  190. # make sure Auth module replied to the command
  191. And wait for new bind10 stderr message CC_REPLY
  192. # make sure the response is for 'getstats'
  193. And wait for new bind10 stderr message v4
  194. Then I query statistics zones of bind10 module Auth
  195. And last bindctl output should not contain "error"
  196. The statistics counters are 0 in category .Auth.zones._SERVER_
  197. A query for example.org type ANY should have rcode NOERROR
  198. The last query response should have flags qr aa rd
  199. The last query response should have ancount 4
  200. The last query response should have nscount 0
  201. The last query response should have adcount 3
  202. The answer section of the last query response should be
  203. """
  204. example.org. 3600 IN NS ns1.example.org.
  205. example.org. 3600 IN NS ns2.example.org.
  206. example.org. 3600 IN SOA ns1.example.org. admin.example.org. 1234 3600 1800 2419200 7200
  207. example.org. 3600 IN MX 10 mail.example.org.
  208. """
  209. The additional section of the last query response should be
  210. """
  211. ns1.example.org. 3600 IN A 192.0.2.3
  212. ns2.example.org. 3600 IN A 192.0.2.4
  213. mail.example.org. 3600 IN A 192.0.2.10
  214. """
  215. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  216. # make sure Auth module receives a command
  217. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  218. # make sure Auth module replied to the command
  219. And wait for new bind10 stderr message CC_REPLY
  220. # make sure the response is for 'getstats'
  221. And wait for new bind10 stderr message v4
  222. Then I query statistics zones of bind10 module Auth
  223. And last bindctl output should not contain "error"
  224. The statistics counters are 0 in category .Auth.zones._SERVER_ except for the following items
  225. | item_name | item_value |
  226. | request.v4 | 1 |
  227. | request.udp | 1 |
  228. | opcode.query | 1 |
  229. | responses | 1 |
  230. | qrysuccess | 1 |
  231. | qryauthans | 1 |
  232. | rcode.noerror | 1 |
  233. Scenario: Delegation query for unsigned child zone
  234. Given I have bind10 running with configuration example.org.inmem.config
  235. And wait for bind10 stderr message BIND10_STARTED_CC
  236. And wait for bind10 stderr message CMDCTL_STARTED
  237. And wait for bind10 stderr message AUTH_SERVER_STARTED
  238. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  239. # make sure Auth module receives a command
  240. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  241. # make sure Auth module replied to the command
  242. And wait for new bind10 stderr message CC_REPLY
  243. # make sure the response is for 'getstats'
  244. And wait for new bind10 stderr message v4
  245. Then I query statistics zones of bind10 module Auth
  246. And last bindctl output should not contain "error"
  247. The statistics counters are 0 in category .Auth.zones._SERVER_
  248. A dnssec query for www.sub.example.org type AAAA should have rcode NOERROR
  249. The last query response should have flags qr rd
  250. The last query response should have edns_flags do
  251. The last query response should have ancount 0
  252. The last query response should have nscount 1
  253. The last query response should have adcount 2
  254. The authority section of the last query response should be
  255. """
  256. sub.example.org. 3600 IN NS ns.sub.example.org.
  257. """
  258. The additional section of the last query response should be
  259. """
  260. ns.sub.example.org. 3600 IN A 192.0.2.101
  261. """
  262. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  263. # make sure Auth module receives a command
  264. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  265. # make sure Auth module replied to the command
  266. And wait for new bind10 stderr message CC_REPLY
  267. # make sure the response is for 'getstats'
  268. And wait for new bind10 stderr message v4
  269. Then I query statistics zones of bind10 module Auth
  270. And last bindctl output should not contain "error"
  271. The statistics counters are 0 in category .Auth.zones._SERVER_ except for the following items
  272. | item_name | item_value |
  273. | request.v4 | 1 |
  274. | request.udp | 1 |
  275. | request.edns0 | 1 |
  276. | request.dnssec_ok | 1 |
  277. | opcode.query | 1 |
  278. | responses | 1 |
  279. | response.edns0 | 1 |
  280. | qrynoauthans | 1 |
  281. | qryreferral | 1 |
  282. | rcode.noerror | 1 |
  283. Scenario: SSHFP query
  284. # We are testing one more RR type for a normal successful case
  285. Given I have bind10 running with configuration example.org.inmem.config
  286. And wait for bind10 stderr message BIND10_STARTED_CC
  287. And wait for bind10 stderr message CMDCTL_STARTED
  288. And wait for bind10 stderr message AUTH_SERVER_STARTED
  289. bind10 module Auth should be running
  290. And bind10 module Stats should be running
  291. And bind10 module Resolver should not be running
  292. And bind10 module Xfrout should not be running
  293. And bind10 module Zonemgr should not be running
  294. And bind10 module Xfrin should not be running
  295. And bind10 module StatsHttpd should not be running
  296. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  297. # make sure Auth module receives a command
  298. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  299. # make sure Auth module replied to the command
  300. And wait for new bind10 stderr message CC_REPLY
  301. # make sure the response is for 'getstats'
  302. And wait for new bind10 stderr message v4
  303. Then I query statistics zones of bind10 module Auth
  304. And last bindctl output should not contain "error"
  305. The statistics counters are 0 in category .Auth.zones._SERVER_
  306. A query for example.org type SSHFP should have rcode NOERROR
  307. The last query response should have ancount 0
  308. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  309. # make sure Auth module receives a command
  310. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  311. # make sure Auth module replied to the command
  312. And wait for new bind10 stderr message CC_REPLY
  313. # make sure the response is for 'getstats'
  314. And wait for new bind10 stderr message v4
  315. Then I query statistics zones of bind10 module Auth
  316. And last bindctl output should not contain "error"
  317. The statistics counters are 0 in category .Auth.zones._SERVER_ except for the following items
  318. | item_name | item_value |
  319. | request.v4 | 1 |
  320. | request.udp | 1 |
  321. | opcode.query | 1 |
  322. | responses | 1 |
  323. | qryauthans | 1 |
  324. | qrynxrrset | 1 |
  325. | rcode.noerror | 1 |
  326. A query for shell.example.org type SSHFP should have rcode NOERROR
  327. The last query response should have ancount 1
  328. The answer section of the last query response should be
  329. """
  330. shell.example.org. 3600 IN SSHFP 2 1 123456789abcdef67890123456789abcdef67890
  331. """
  332. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  333. # make sure Auth module receives a command
  334. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  335. # make sure Auth module replied to the command
  336. And wait for new bind10 stderr message CC_REPLY
  337. # make sure the response is for 'getstats'
  338. And wait for new bind10 stderr message v4
  339. Then I query statistics zones of bind10 module Auth
  340. And last bindctl output should not contain "error"
  341. The statistics counters are 0 in category .Auth.zones._SERVER_ except for the following items
  342. | item_name | item_value |
  343. | request.v4 | 2 |
  344. | request.udp | 2 |
  345. | opcode.query | 2 |
  346. | responses | 2 |
  347. | qrysuccess | 1 |
  348. | qryauthans | 2 |
  349. | qrynxrrset | 1 |
  350. | rcode.noerror | 2 |