queries.feature 20 KB

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