queries.feature 19 KB

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