queries.feature 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408
  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
  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
  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 recursive 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. | qryrecursion | 1 |
  183. | rcode.noerror | 2 |
  184. | rcode.nxdomain | 1 |
  185. Scenario: ANY query
  186. Given I have bind10 running with configuration example.org.inmem.config
  187. And wait for bind10 stderr message BIND10_STARTED_CC
  188. And wait for bind10 stderr message CMDCTL_STARTED
  189. And wait for bind10 stderr message AUTH_SERVER_STARTED
  190. bind10 module Auth should be running
  191. And bind10 module Stats should be running
  192. And bind10 module Resolver should not be running
  193. And bind10 module Xfrout should not be running
  194. And bind10 module Zonemgr should not be running
  195. And bind10 module Xfrin should not be running
  196. And bind10 module StatsHttpd should not be running
  197. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  198. # make sure Auth module receives a command
  199. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  200. # make sure Auth module replied to the command
  201. And wait for new bind10 stderr message CC_REPLY
  202. # make sure the response is for 'getstats'
  203. And wait for new bind10 stderr message v4
  204. Then I query statistics zones of bind10 module Auth
  205. And last bindctl output should not contain "error"
  206. The statistics counters are 0 in category .Auth.zones._SERVER_
  207. A query for example.org type ANY should have rcode NOERROR
  208. The last query response should have flags qr aa
  209. The last query response should have ancount 4
  210. The last query response should have nscount 0
  211. The last query response should have adcount 3
  212. The answer section of the last query response should be
  213. """
  214. example.org. 3600 IN NS ns1.example.org.
  215. example.org. 3600 IN NS ns2.example.org.
  216. example.org. 3600 IN SOA ns1.example.org. admin.example.org. 1234 3600 1800 2419200 7200
  217. example.org. 3600 IN MX 10 mail.example.org.
  218. """
  219. The additional section of the last query response should be
  220. """
  221. ns1.example.org. 3600 IN A 192.0.2.3
  222. ns2.example.org. 3600 IN A 192.0.2.4
  223. mail.example.org. 3600 IN A 192.0.2.10
  224. """
  225. # Make sure handling statistics command handling checked below is
  226. # after this query
  227. And wait for bind10 stderr message AUTH_SEND_NORMAL_RESPONSE
  228. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  229. # make sure Auth module receives a command
  230. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  231. # make sure Auth module replied to the command
  232. And wait for new bind10 stderr message CC_REPLY
  233. # make sure the response is for 'getstats'
  234. And wait for new bind10 stderr message v4
  235. Then I query statistics zones of bind10 module Auth
  236. And last bindctl output should not contain "error"
  237. The statistics counters are 0 in category .Auth.zones._SERVER_ except for the following items
  238. | item_name | item_value |
  239. | request.v4 | 1 |
  240. | request.udp | 1 |
  241. | opcode.query | 1 |
  242. | responses | 1 |
  243. | qrysuccess | 1 |
  244. | qryauthans | 1 |
  245. | rcode.noerror | 1 |
  246. Scenario: Delegation query for unsigned child zone
  247. Given I have bind10 running with configuration example.org.inmem.config
  248. And wait for bind10 stderr message BIND10_STARTED_CC
  249. And wait for bind10 stderr message CMDCTL_STARTED
  250. And wait for bind10 stderr message AUTH_SERVER_STARTED
  251. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  252. # make sure Auth module receives a command
  253. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  254. # make sure Auth module replied to the command
  255. And wait for new bind10 stderr message CC_REPLY
  256. # make sure the response is for 'getstats'
  257. And wait for new bind10 stderr message v4
  258. Then I query statistics zones of bind10 module Auth
  259. And last bindctl output should not contain "error"
  260. The statistics counters are 0 in category .Auth.zones._SERVER_
  261. A dnssec query for www.sub.example.org type AAAA should have rcode NOERROR
  262. The last query response should have flags qr
  263. The last query response should have edns_flags do
  264. The last query response should have ancount 0
  265. The last query response should have nscount 1
  266. The last query response should have adcount 2
  267. The authority section of the last query response should be
  268. """
  269. sub.example.org. 3600 IN NS ns.sub.example.org.
  270. """
  271. The additional section of the last query response should be
  272. """
  273. ns.sub.example.org. 3600 IN A 192.0.2.101
  274. """
  275. # Make sure handling statistics command handling checked below is
  276. # after this query
  277. And wait for bind10 stderr message AUTH_SEND_NORMAL_RESPONSE
  278. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  279. # make sure Auth module receives a command
  280. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  281. # make sure Auth module replied to the command
  282. And wait for new bind10 stderr message CC_REPLY
  283. # make sure the response is for 'getstats'
  284. And wait for new bind10 stderr message v4
  285. Then I query statistics zones of bind10 module Auth
  286. And last bindctl output should not contain "error"
  287. The statistics counters are 0 in category .Auth.zones._SERVER_ except for the following items
  288. | item_name | item_value |
  289. | request.v4 | 1 |
  290. | request.udp | 1 |
  291. | request.edns0 | 1 |
  292. | request.dnssec_ok | 1 |
  293. | opcode.query | 1 |
  294. | responses | 1 |
  295. | response.edns0 | 1 |
  296. | qrynoauthans | 1 |
  297. | qryreferral | 1 |
  298. | rcode.noerror | 1 |
  299. Scenario: SSHFP query
  300. # We are testing one more RR type for a normal successful case
  301. Given I have bind10 running with configuration example.org.inmem.config
  302. And wait for bind10 stderr message BIND10_STARTED_CC
  303. And wait for bind10 stderr message CMDCTL_STARTED
  304. And wait for bind10 stderr message AUTH_SERVER_STARTED
  305. bind10 module Auth should be running
  306. And bind10 module Stats should be running
  307. And bind10 module Resolver should not be running
  308. And bind10 module Xfrout should not be running
  309. And bind10 module Zonemgr should not be running
  310. And bind10 module Xfrin should not be running
  311. And bind10 module StatsHttpd should not be running
  312. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  313. # make sure Auth module receives a command
  314. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  315. # make sure Auth module replied to the command
  316. And wait for new bind10 stderr message CC_REPLY
  317. # make sure the response is for 'getstats'
  318. And wait for new bind10 stderr message v4
  319. Then I query statistics zones of bind10 module Auth
  320. And last bindctl output should not contain "error"
  321. The statistics counters are 0 in category .Auth.zones._SERVER_
  322. A query for example.org type SSHFP should have rcode NOERROR
  323. The last query response should have ancount 0
  324. # Make sure handling statistics command handling checked below is
  325. # after this query
  326. And wait for bind10 stderr message AUTH_SEND_NORMAL_RESPONSE
  327. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  328. # make sure Auth module receives a command
  329. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  330. # make sure Auth module replied to the command
  331. And wait for new bind10 stderr message CC_REPLY
  332. # make sure the response is for 'getstats'
  333. And wait for new bind10 stderr message v4
  334. Then I query statistics zones of bind10 module Auth
  335. And last bindctl output should not contain "error"
  336. The statistics counters are 0 in category .Auth.zones._SERVER_ except for the following items
  337. | item_name | item_value |
  338. | request.v4 | 1 |
  339. | request.udp | 1 |
  340. | opcode.query | 1 |
  341. | responses | 1 |
  342. | qryauthans | 1 |
  343. | qrynxrrset | 1 |
  344. | rcode.noerror | 1 |
  345. A query for shell.example.org type SSHFP should have rcode NOERROR
  346. The last query response should have ancount 1
  347. The answer section of the last query response should be
  348. """
  349. shell.example.org. 3600 IN SSHFP 2 1 123456789abcdef67890123456789abcdef67890
  350. """
  351. # Make sure handling statistics command handling checked below is
  352. # after this query
  353. And wait for bind10 stderr message AUTH_SEND_NORMAL_RESPONSE
  354. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  355. # make sure Auth module receives a command
  356. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  357. # make sure Auth module replied to the command
  358. And wait for new bind10 stderr message CC_REPLY
  359. # make sure the response is for 'getstats'
  360. And wait for new bind10 stderr message v4
  361. Then I query statistics zones of bind10 module Auth
  362. And last bindctl output should not contain "error"
  363. The statistics counters are 0 in category .Auth.zones._SERVER_ except for the following items
  364. | item_name | item_value |
  365. | request.v4 | 2 |
  366. | request.udp | 2 |
  367. | opcode.query | 2 |
  368. | responses | 2 |
  369. | qrysuccess | 1 |
  370. | qryauthans | 2 |
  371. | qrynxrrset | 1 |
  372. | rcode.noerror | 2 |