queries.feature 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494
  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: RRSIG query
  304. # Directly querying for RRSIGs should result in rcode=REFUSED.
  305. Given I have bind10 running with configuration nsec3/nsec3_auth.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 Resolver should not be running
  311. And bind10 module Xfrout should not be running
  312. And bind10 module Zonemgr should not be running
  313. And bind10 module Xfrin should not be running
  314. And bind10 module Stats should not be running
  315. And bind10 module StatsHttpd should not be running
  316. A dnssec query for example. type RRSIG should have rcode REFUSED
  317. The last query response should have flags qr aa
  318. The last query response should have edns_flags do
  319. The last query response should have ancount 0
  320. The last query response should have nscount 0
  321. The last query response should have adcount 1
  322. Scenario: SSHFP query
  323. # We are testing one more RR type for a normal successful case
  324. Given I have bind10 running with configuration example.org.inmem.config
  325. And wait for bind10 stderr message BIND10_STARTED_CC
  326. And wait for bind10 stderr message CMDCTL_STARTED
  327. And wait for bind10 stderr message AUTH_SERVER_STARTED
  328. bind10 module Auth should be running
  329. And bind10 module Stats should be running
  330. And bind10 module Resolver should not be running
  331. And bind10 module Xfrout should not be running
  332. And bind10 module Zonemgr should not be running
  333. And bind10 module Xfrin should not be running
  334. And bind10 module StatsHttpd should not be running
  335. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  336. # make sure Auth module receives a command
  337. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  338. # make sure Auth module replied to the command
  339. And wait for new bind10 stderr message CC_REPLY
  340. # make sure the response is for 'getstats'
  341. And wait for new bind10 stderr message v4
  342. Then I query statistics zones of bind10 module Auth
  343. And last bindctl output should not contain "error"
  344. The statistics counters are 0 in category .Auth.zones._SERVER_
  345. A query for example.org type SSHFP should have rcode NOERROR
  346. The last query response should have ancount 0
  347. # Make sure handling statistics command handling checked below is
  348. # after this query
  349. And wait for bind10 stderr message AUTH_SEND_NORMAL_RESPONSE
  350. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  351. # make sure Auth module receives a command
  352. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  353. # make sure Auth module replied to the command
  354. And wait for new bind10 stderr message CC_REPLY
  355. # make sure the response is for 'getstats'
  356. And wait for new bind10 stderr message v4
  357. Then I query statistics zones of bind10 module Auth
  358. And last bindctl output should not contain "error"
  359. The statistics counters are 0 in category .Auth.zones._SERVER_ except for the following items
  360. | item_name | item_value |
  361. | request.v4 | 1 |
  362. | request.udp | 1 |
  363. | opcode.query | 1 |
  364. | responses | 1 |
  365. | qryauthans | 1 |
  366. | qrynxrrset | 1 |
  367. | rcode.noerror | 1 |
  368. A query for shell.example.org type SSHFP should have rcode NOERROR
  369. The last query response should have ancount 1
  370. The answer section of the last query response should be
  371. """
  372. shell.example.org. 3600 IN SSHFP 2 1 123456789abcdef67890123456789abcdef67890
  373. """
  374. # Make sure handling statistics command handling checked below is
  375. # after this query
  376. And wait for bind10 stderr message AUTH_SEND_NORMAL_RESPONSE
  377. When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
  378. # make sure Auth module receives a command
  379. And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
  380. # make sure Auth module replied to the command
  381. And wait for new bind10 stderr message CC_REPLY
  382. # make sure the response is for 'getstats'
  383. And wait for new bind10 stderr message v4
  384. Then I query statistics zones of bind10 module Auth
  385. And last bindctl output should not contain "error"
  386. The statistics counters are 0 in category .Auth.zones._SERVER_ except for the following items
  387. | item_name | item_value |
  388. | request.v4 | 2 |
  389. | request.udp | 2 |
  390. | opcode.query | 2 |
  391. | responses | 2 |
  392. | qrysuccess | 1 |
  393. | qryauthans | 2 |
  394. | qrynxrrset | 1 |
  395. | rcode.noerror | 2 |
  396. Scenario: Querying non-existing name in root zone from sqlite3 should work
  397. Given I have bind10 running with configuration root.config
  398. And wait for bind10 stderr message BIND10_STARTED_CC
  399. And wait for bind10 stderr message CMDCTL_STARTED
  400. And wait for bind10 stderr message AUTH_SERVER_STARTED
  401. bind10 module Auth should be running
  402. And bind10 module Stats should be running
  403. And bind10 module Resolver should not be running
  404. And bind10 module Xfrout should not be running
  405. And bind10 module Zonemgr should not be running
  406. And bind10 module Xfrin should not be running
  407. And bind10 module StatsHttpd should not be running
  408. A query for . type SOA should have rcode NOERROR
  409. A query for nonexistent. type A should have rcode NXDOMAIN
  410. Then wait for bind10 stderr message AUTH_SEND_NORMAL_RESPONSE not AUTH_PROCESS_FAIL
  411. Scenario: CH class static zone query
  412. # We are testing one more RR type for a normal successful case
  413. Given I have bind10 running with configuration static.config
  414. And wait for bind10 stderr message BIND10_STARTED_CC
  415. And wait for bind10 stderr message CMDCTL_STARTED
  416. And wait for bind10 stderr message AUTH_SERVER_STARTED
  417. bind10 module Auth should be running
  418. And bind10 module Stats should be running
  419. And bind10 module Resolver should not be running
  420. And bind10 module Xfrout should not be running
  421. And bind10 module Zonemgr should not be running
  422. And bind10 module Xfrin should not be running
  423. And bind10 module StatsHttpd should not be running
  424. A query for version.bind. type TXT class CH should have rcode REFUSED
  425. When I send bind10 the following commands
  426. """
  427. config add data_sources/classes/CH
  428. config set data_sources/classes/CH[0]/type MasterFiles
  429. config set data_sources/classes/CH[0]/cache-enable true
  430. config set data_sources/classes/CH[0]/params {"BIND": "data/static.zone"}
  431. config commit
  432. """
  433. And wait for new bind10 stderr message AUTH_DATASRC_CLIENTS_BUILDER_RECONFIGURE_SUCCESS
  434. A query for version.bind. type TXT class CH should have rcode NOERROR
  435. The last query response should have ancount 1
  436. # NOTE: The double double-quote characters trailing 10 in the
  437. # response below are required due to a lettuce bug in reading
  438. # multi-line strings with embedded double-quotes.
  439. The answer section of the last query response should be
  440. """
  441. version.bind. 3600 CH TXT "10""
  442. """