queries.feature 19 KB

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