zone_finder_context_unittest.cc 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459
  1. // Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC")
  2. //
  3. // Permission to use, copy, modify, and/or distribute this software for any
  4. // purpose with or without fee is hereby granted, provided that the above
  5. // copyright notice and this permission notice appear in all copies.
  6. //
  7. // THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
  8. // REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  9. // AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
  10. // INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  11. // LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  12. // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  13. // PERFORMANCE OF THIS SOFTWARE.
  14. #include <exceptions/exceptions.h>
  15. #include <dns/masterload.h>
  16. #include <dns/name.h>
  17. #include <dns/rrclass.h>
  18. #include <datasrc/zone.h>
  19. #include <datasrc/memory/memory_client.h>
  20. #include <datasrc/memory/zone_table_segment.h>
  21. #include <datasrc/database.h>
  22. #include <datasrc/sqlite3_accessor.h>
  23. #include "test_client.h"
  24. #include <testutils/dnsmessage_test.h>
  25. #include <gtest/gtest.h>
  26. #include <boost/bind.hpp>
  27. #include <boost/foreach.hpp>
  28. #include <boost/shared_ptr.hpp>
  29. #include <fstream>
  30. #include <sstream>
  31. #include <vector>
  32. using namespace std;
  33. using boost::shared_ptr;
  34. using namespace isc::data;
  35. using namespace isc::util;
  36. using namespace isc::dns;
  37. using namespace isc::datasrc;
  38. using isc::datasrc::memory::InMemoryClient;
  39. using isc::datasrc::memory::ZoneTableSegment;
  40. using namespace isc::testutils;
  41. namespace {
  42. // Commonly used test zone file.
  43. const char* const TEST_ZONE_FILE = TEST_DATA_DIR "/contexttest.zone";
  44. // Convenient shortcut
  45. typedef shared_ptr<DataSourceClient> DataSourceClientPtr;
  46. // This is the type used as the test parameter. Note that this is
  47. // intentionally a plain old type (i.e. a function pointer), not a class;
  48. // otherwise it could cause initialization fiasco at the instantiation time.
  49. typedef DataSourceClientPtr (*ClientCreator)(RRClass, const Name&);
  50. // Creator for the in-memory client to be tested
  51. DataSourceClientPtr
  52. createInMemoryClient(RRClass zclass, const Name& zname)
  53. {
  54. const ElementPtr config(Element::fromJSON("{}"));
  55. shared_ptr<ZoneTableSegment> ztable_segment(
  56. ZoneTableSegment::create(*config, zclass));
  57. shared_ptr<InMemoryClient> client(new InMemoryClient(ztable_segment,
  58. zclass));
  59. client->load(zname, TEST_ZONE_FILE);
  60. return (client);
  61. }
  62. void
  63. addRRset(ZoneUpdaterPtr updater, ConstRRsetPtr rrset) {
  64. updater->addRRset(*rrset);
  65. }
  66. DataSourceClientPtr
  67. createSQLite3Client(RRClass zclass, const Name& zname, stringstream& ss) {
  68. // We always begin with an empty template SQLite3 DB file and install
  69. // the zone data from the zone file to ensure both cases have the
  70. // same test data.
  71. DataSourceClientPtr client = unittest::createSQLite3Client(
  72. zclass, zname, TEST_DATA_BUILDDIR "/contexttest.sqlite3.copied",
  73. TEST_ZONE_FILE);
  74. // Insert an out-of-zone name to test if it's incorrectly returned.
  75. // Note that neither updater nor SQLite3 accessor checks this condition,
  76. // so this should succeed.
  77. ZoneUpdaterPtr updater = client->getUpdater(zname, false);
  78. masterLoad(ss, Name::ROOT_NAME(), zclass,
  79. boost::bind(addRRset, updater, _1));
  80. updater->commit();
  81. return (client);
  82. }
  83. DataSourceClientPtr
  84. createSQLite3ClientWithNS(RRClass zclass, const Name& zname) {
  85. stringstream ss("ns.example.com. 3600 IN A 192.0.2.7");
  86. return (createSQLite3Client(zclass, zname, ss));
  87. }
  88. // The test class. Its parameterized so we can share the test scnearios
  89. // for any concrete data source implementaitons.
  90. class ZoneFinderContextTest :
  91. public ::testing::TestWithParam<ClientCreator>
  92. {
  93. protected:
  94. ZoneFinderContextTest() : qclass_(RRClass::IN()), qzone_("example.org") {
  95. client_ = (*GetParam())(qclass_, qzone_);
  96. REQUESTED_A.push_back(RRType::A());
  97. REQUESTED_AAAA.push_back(RRType::AAAA());
  98. REQUESTED_BOTH.push_back(RRType::A());
  99. REQUESTED_BOTH.push_back(RRType::AAAA());
  100. }
  101. void SetUp() {
  102. finder_ = client_->findZone(qzone_).zone_finder;
  103. ASSERT_TRUE(finder_);
  104. }
  105. const RRClass qclass_;
  106. const Name qzone_;
  107. DataSourceClientPtr client_;
  108. ZoneFinderPtr finder_;
  109. vector<RRType> requested_types_;
  110. vector<RRType> REQUESTED_A;
  111. vector<RRType> REQUESTED_AAAA;
  112. vector<RRType> REQUESTED_BOTH;
  113. vector<ConstRRsetPtr> result_sets_;
  114. };
  115. // We test the in-memory and SQLite3 data source implementations.
  116. INSTANTIATE_TEST_CASE_P(, ZoneFinderContextTest,
  117. ::testing::Values(createInMemoryClient,
  118. createSQLite3ClientWithNS));
  119. TEST_P(ZoneFinderContextTest, getAdditionalAuthNS) {
  120. ZoneFinderContextPtr ctx = finder_->find(qzone_, RRType::NS());
  121. EXPECT_EQ(ZoneFinder::SUCCESS, ctx->code);
  122. // Getting both A and AAAA NS addresses
  123. ctx->getAdditional(REQUESTED_BOTH, result_sets_);
  124. rrsetsCheck("ns1.example.org. 3600 IN A 192.0.2.1\n"
  125. "ns1.example.org. 3600 IN AAAA 2001:db8::1\n"
  126. "ns2.example.org. 3600 IN A 192.0.2.2\n",
  127. result_sets_.begin(), result_sets_.end());
  128. // Getting only A
  129. result_sets_.clear();
  130. ctx->getAdditional(REQUESTED_A, result_sets_);
  131. rrsetsCheck("ns1.example.org. 3600 IN A 192.0.2.1\n"
  132. "ns2.example.org. 3600 IN A 192.0.2.2\n",
  133. result_sets_.begin(), result_sets_.end());
  134. // Getting only AAAA
  135. result_sets_.clear();
  136. ctx->getAdditional(REQUESTED_AAAA, result_sets_);
  137. rrsetsCheck("ns1.example.org. 3600 IN AAAA 2001:db8::1\n",
  138. result_sets_.begin(), result_sets_.end());
  139. // Getting A again, without clearing the result sets. This confirms
  140. // getAdditional() doesn't change the existing vector content.
  141. ctx->getAdditional(REQUESTED_A, result_sets_);
  142. // The first element should be the existing AAAA RR, followed by the A's.
  143. EXPECT_EQ(RRType::AAAA(), result_sets_[0]->getType());
  144. rrsetsCheck("ns1.example.org. 3600 IN AAAA 2001:db8::1\n"
  145. "ns1.example.org. 3600 IN A 192.0.2.1\n"
  146. "ns2.example.org. 3600 IN A 192.0.2.2\n",
  147. result_sets_.begin(), result_sets_.end());
  148. // Normally expected type set contain only A and/or AAAA, but others aren't
  149. // excluded.
  150. result_sets_.clear();
  151. requested_types_.push_back(RRType::TXT());
  152. ctx->getAdditional(requested_types_, result_sets_);
  153. rrsetsCheck("ns2.example.org. 3600 IN TXT \"text data\"",
  154. result_sets_.begin(), result_sets_.end());
  155. // Even empty set is okay. The result should also be empty.
  156. result_sets_.clear();
  157. ctx->getAdditional(vector<RRType>(), result_sets_);
  158. EXPECT_TRUE(result_sets_.empty());
  159. }
  160. TEST_P(ZoneFinderContextTest, getAdditionalDelegation) {
  161. // Basically similar to the AuthNS case, but NS names are glues.
  162. // It contains an out-of-zone NS name. Its address (even if it's somehow
  163. // inserted to the zone data) shouldn't be returned.
  164. const Name qname("www.a.example.org");
  165. ZoneFinderContextPtr ctx = finder_->find(qname, RRType::AAAA());
  166. EXPECT_EQ(ZoneFinder::DELEGATION, ctx->code);
  167. ctx->getAdditional(REQUESTED_BOTH, result_sets_);
  168. rrsetsCheck("ns1.a.example.org. 3600 IN A 192.0.2.5\n"
  169. "ns2.a.example.org. 3600 IN A 192.0.2.6\n"
  170. "ns2.a.example.org. 3600 IN AAAA 2001:db8::6\n",
  171. result_sets_.begin(), result_sets_.end());
  172. result_sets_.clear();
  173. ctx->getAdditional(REQUESTED_A, result_sets_);
  174. rrsetsCheck("ns1.a.example.org. 3600 IN A 192.0.2.5\n"
  175. "ns2.a.example.org. 3600 IN A 192.0.2.6\n",
  176. result_sets_.begin(), result_sets_.end());
  177. result_sets_.clear();
  178. ctx->getAdditional(REQUESTED_AAAA, result_sets_);
  179. rrsetsCheck("ns2.a.example.org. 3600 IN AAAA 2001:db8::6\n",
  180. result_sets_.begin(), result_sets_.end());
  181. }
  182. TEST_P(ZoneFinderContextTest, getAdditionalDelegationAtZoneCut) {
  183. // Similar to the previous case, but one of the NS addresses is at the
  184. // zone cut.
  185. ZoneFinderContextPtr ctx = finder_->find(Name("www.b.example.org"),
  186. RRType::SOA());
  187. EXPECT_EQ(ZoneFinder::DELEGATION, ctx->code);
  188. ctx->getAdditional(REQUESTED_BOTH, result_sets_);
  189. rrsetsCheck("b.example.org. 3600 IN AAAA 2001:db8::8\n"
  190. "ns.b.example.org. 3600 IN A 192.0.2.9\n",
  191. result_sets_.begin(), result_sets_.end());
  192. }
  193. TEST_P(ZoneFinderContextTest, getAdditionalDelegationWithDname) {
  194. // Delegation: One of the NS names under a DNAME delegation; another
  195. // is at the delegation point; yet another is under DNAME below a zone cut.
  196. // The first should be hidden.
  197. ZoneFinderContextPtr ctx = finder_->find(Name("www.c.example.org"),
  198. RRType::TXT());
  199. EXPECT_EQ(ZoneFinder::DELEGATION, ctx->code);
  200. ctx->getAdditional(REQUESTED_BOTH, result_sets_);
  201. rrsetsCheck("dname.example.org. 3600 IN A 192.0.2.12\n"
  202. "ns.deepdname.example.org. 3600 IN AAAA 2001:db8::9\n",
  203. result_sets_.begin(), result_sets_.end());
  204. }
  205. TEST_P(ZoneFinderContextTest, getAdditionalOnDname) {
  206. // The additional name has a DNAME as well as the additional record.
  207. // The existence of DNAME shouldn't hide the additional record.
  208. ZoneFinderContextPtr ctx = finder_->find(Name("dnamemx.example.org"),
  209. RRType::MX());
  210. EXPECT_EQ(ZoneFinder::SUCCESS, ctx->code);
  211. ctx->getAdditional(REQUESTED_BOTH, result_sets_);
  212. rrsetsCheck("dname.example.org. 3600 IN A 192.0.2.12\n",
  213. result_sets_.begin(), result_sets_.end());
  214. }
  215. TEST_P(ZoneFinderContextTest, getAdditionalDelegationWithEmptyName) {
  216. // One of NS names is at an empty non terminal node. It shouldn't cause
  217. // any disruption.
  218. ZoneFinderContextPtr ctx = finder_->find(Name("www.d.example.org"),
  219. RRType::A());
  220. EXPECT_EQ(ZoneFinder::DELEGATION, ctx->code);
  221. ctx->getAdditional(REQUESTED_BOTH, result_sets_);
  222. rrsetsCheck("ns1.example.org. 3600 IN A 192.0.2.1\n"
  223. "ns1.example.org. 3600 IN AAAA 2001:db8::1\n",
  224. result_sets_.begin(), result_sets_.end());
  225. }
  226. TEST_P(ZoneFinderContextTest, getAdditionalDelegationWithWild) {
  227. // An NS name needs to be expanded by a wildcard. Another NS name
  228. // also matches a wildcard, but it's an empty node, so there's no
  229. // corresponding additional RR. The other NS name isn't subject to
  230. // wildcard expansion, which shouldn't cause any disruption.
  231. ZoneFinderContextPtr ctx = finder_->find(Name("www.e.example.org"),
  232. RRType::AAAA());
  233. EXPECT_EQ(ZoneFinder::DELEGATION, ctx->code);
  234. ctx->getAdditional(REQUESTED_BOTH, result_sets_);
  235. rrsetsCheck("ns.wild.example.org. 3600 IN A 192.0.2.15\n"
  236. "ns2.example.org. 3600 IN A 192.0.2.2\n",
  237. result_sets_.begin(), result_sets_.end());
  238. // ns.wild.example.org/A (expanded from a wildcard) should be considered
  239. // the same kind, whether it's a direct result of find() or a result of
  240. // getAdditional().
  241. ctx = finder_->find(Name("ns.wild.example.org"), RRType::A());
  242. EXPECT_EQ(ZoneFinder::SUCCESS, ctx->code);
  243. for (vector<ConstRRsetPtr>::const_iterator it = result_sets_.begin();
  244. it != result_sets_.end(); ++it) {
  245. const bool same_kind = (*it)->isSameKind(*ctx->rrset);
  246. EXPECT_EQ((*it)->getName() == ctx->rrset->getName(), same_kind);
  247. }
  248. }
  249. TEST_P(ZoneFinderContextTest, getAdditionalDelegationForWild) {
  250. // additional for an answer RRset (MX) as a result of wildcard expansion.
  251. // note the difference from the previous test. in this case wildcard
  252. // applies to the owner name of the answer, not the owner name of the
  253. // additional.
  254. ZoneFinderContextPtr ctx = finder_->find(Name("mx.wildmx.example.org"),
  255. RRType::MX());
  256. EXPECT_EQ(ZoneFinder::SUCCESS, ctx->code);
  257. ctx->getAdditional(REQUESTED_BOTH, result_sets_);
  258. rrsetsCheck("mx1.example.org. 3600 IN A 192.0.2.10\n",
  259. result_sets_.begin(), result_sets_.end());
  260. }
  261. TEST_P(ZoneFinderContextTest, getAdditionalMX) {
  262. // Similar to the previous cases, but for MX addresses. The test zone
  263. // contains MX name under a zone cut. Its address shouldn't be returned.
  264. ZoneFinderContextPtr ctx = finder_->find(qzone_, RRType::MX());
  265. EXPECT_EQ(ZoneFinder::SUCCESS, ctx->code);
  266. // Getting both A and AAAA NS addresses
  267. ctx->getAdditional(REQUESTED_BOTH, result_sets_);
  268. rrsetsCheck("mx1.example.org. 3600 IN A 192.0.2.10\n"
  269. "mx2.example.org. 3600 IN AAAA 2001:db8::10\n",
  270. result_sets_.begin(), result_sets_.end());
  271. // Getting only A
  272. result_sets_.clear();
  273. ctx->getAdditional(REQUESTED_A, result_sets_);
  274. rrsetsCheck("mx1.example.org. 3600 IN A 192.0.2.10\n",
  275. result_sets_.begin(), result_sets_.end());
  276. // Getting only AAAA
  277. result_sets_.clear();
  278. ctx->getAdditional(REQUESTED_AAAA, result_sets_);
  279. rrsetsCheck("mx2.example.org. 3600 IN AAAA 2001:db8::10\n",
  280. result_sets_.begin(), result_sets_.end());
  281. }
  282. TEST_P(ZoneFinderContextTest, getAdditionalMXAtZoneCut) {
  283. ZoneFinderContextPtr ctx = finder_->find(Name("mxatcut.example.org."),
  284. RRType::MX());
  285. EXPECT_EQ(ZoneFinder::SUCCESS, ctx->code);
  286. ctx->getAdditional(REQUESTED_BOTH, result_sets_);
  287. EXPECT_TRUE(result_sets_.empty());
  288. }
  289. TEST_P(ZoneFinderContextTest, getAdditionalWithSIG) {
  290. // Similar to the AuthNS test, but the original find() requested DNSSEC
  291. // RRSIGs. Then additional records will also have RRSIGs.
  292. ZoneFinderContextPtr ctx = finder_->find(qzone_, RRType::NS(),
  293. ZoneFinder::FIND_DNSSEC);
  294. EXPECT_EQ(ZoneFinder::SUCCESS, ctx->code);
  295. ctx->getAdditional(REQUESTED_BOTH, result_sets_);
  296. rrsetsCheck("ns1.example.org. 3600 IN A 192.0.2.1\n"
  297. "ns1.example.org. 3600 IN RRSIG A 7 3 3600 20150420235959 "
  298. "20051021000000 40430 example.org. FAKEFAKE\n"
  299. "ns1.example.org. 3600 IN AAAA 2001:db8::1\n"
  300. "ns1.example.org. 3600 IN RRSIG AAAA 7 3 3600 20150420235959 "
  301. "20051021000000 40430 example.org. FAKEFAKEFAKE\n"
  302. "ns2.example.org. 3600 IN A 192.0.2.2\n",
  303. result_sets_.begin(), result_sets_.end());
  304. vector<ConstRRsetPtr> sigresult_sets;
  305. BOOST_FOREACH(ConstRRsetPtr rrset, result_sets_) {
  306. ConstRRsetPtr sig_rrset = rrset->getRRsig();
  307. if (sig_rrset) {
  308. sigresult_sets.push_back(sig_rrset);
  309. }
  310. }
  311. rrsetsCheck("ns1.example.org. 3600 IN RRSIG A 7 3 3600 20150420235959 "
  312. "20051021000000 40430 example.org. FAKEFAKE\n"
  313. "ns1.example.org. 3600 IN RRSIG AAAA 7 3 3600 20150420235959 "
  314. "20051021000000 40430 example.org. FAKEFAKEFAKE\n",
  315. sigresult_sets.begin(), sigresult_sets.end());
  316. }
  317. TEST_P(ZoneFinderContextTest, getAdditionalNoOP) {
  318. // getAdditional() is only meaningful after SUCCESS or DELEGATION.
  319. ZoneFinderContextPtr ctx = finder_->find(Name("nxdomain.example.org"),
  320. RRType::NS());
  321. EXPECT_EQ(ZoneFinder::NXDOMAIN, ctx->code);
  322. ctx->getAdditional(REQUESTED_BOTH, result_sets_);
  323. EXPECT_TRUE(result_sets_.empty());
  324. ctx = finder_->find(qzone_, RRType::TXT());
  325. EXPECT_EQ(ZoneFinder::NXRRSET, ctx->code);
  326. ctx->getAdditional(REQUESTED_BOTH, result_sets_);
  327. EXPECT_TRUE(result_sets_.empty());
  328. ctx = finder_->find(Name("alias.example.org."), RRType::A());
  329. EXPECT_EQ(ZoneFinder::CNAME, ctx->code);
  330. ctx->getAdditional(REQUESTED_BOTH, result_sets_);
  331. EXPECT_TRUE(result_sets_.empty());
  332. ctx = finder_->find(Name("www.dname.example.org."), RRType::A());
  333. EXPECT_EQ(ZoneFinder::DNAME, ctx->code);
  334. ctx->getAdditional(REQUESTED_BOTH, result_sets_);
  335. EXPECT_TRUE(result_sets_.empty());
  336. }
  337. TEST_P(ZoneFinderContextTest, getAdditionalForAny) {
  338. // getAdditional() after successful type ANY query should return
  339. // the additional records of all returned RRsets.
  340. vector<ConstRRsetPtr> all_rrsets;
  341. ZoneFinderContextPtr ctx = finder_->findAll(qzone_, all_rrsets);
  342. EXPECT_EQ(ZoneFinder::SUCCESS, ctx->code);
  343. ctx->getAdditional(REQUESTED_BOTH, result_sets_);
  344. rrsetsCheck("ns1.example.org. 3600 IN A 192.0.2.1\n"
  345. "ns1.example.org. 3600 IN AAAA 2001:db8::1\n"
  346. "ns2.example.org. 3600 IN A 192.0.2.2\n"
  347. "mx1.example.org. 3600 IN A 192.0.2.10\n"
  348. "mx2.example.org. 3600 IN AAAA 2001:db8::10\n",
  349. result_sets_.begin(), result_sets_.end());
  350. // If the type ANY query results in DELEGATION, the result should be the
  351. // same as normal query.
  352. all_rrsets.clear();
  353. result_sets_.clear();
  354. ctx = finder_->findAll(Name("www.a.example.org"), all_rrsets);
  355. EXPECT_EQ(ZoneFinder::DELEGATION, ctx->code);
  356. ctx->getAdditional(REQUESTED_BOTH, result_sets_);
  357. rrsetsCheck("ns1.a.example.org. 3600 IN A 192.0.2.5\n"
  358. "ns2.a.example.org. 3600 IN A 192.0.2.6\n"
  359. "ns2.a.example.org. 3600 IN AAAA 2001:db8::6\n",
  360. result_sets_.begin(), result_sets_.end());
  361. }
  362. TEST_P(ZoneFinderContextTest, getAdditionalWithRRSIGOnly) {
  363. // This has two MX records, but type-A for one of them only has RRSIG.
  364. // It shouldn't be contained in the result.
  365. ZoneFinderContextPtr ctx = finder_->find(Name("f.example.org"),
  366. RRType::MX(),
  367. ZoneFinder::FIND_DNSSEC);
  368. EXPECT_EQ(ZoneFinder::SUCCESS, ctx->code);
  369. ctx->getAdditional(REQUESTED_BOTH, result_sets_);
  370. rrsetsCheck("mx2.f.example.org. 3600 IN A 192.0.2.16\n",
  371. result_sets_.begin(), result_sets_.end());
  372. }
  373. TEST(ZoneFinderContextSQLite3Test, escapedText) {
  374. // This test checks that TXTLike data, when written to a database,
  375. // is escaped correctly before stored in the database. The actual
  376. // escaping is done in the toText() method of TXTLike objects, but
  377. // we check anyway if this also carries over to the ZoneUpdater.
  378. RRClass zclass(RRClass::IN());
  379. Name zname("example.org");
  380. stringstream ss("escaped.example.org. 3600 IN TXT Hello~World\\;\\\"");
  381. DataSourceClientPtr client = createSQLite3Client(zclass, zname, ss);
  382. ZoneFinderPtr finder = client->findZone(zname).zone_finder;
  383. // If there is no escaping, the following will throw an exception
  384. // when it tries to construct a TXT RRset using the data from the
  385. // database.
  386. ZoneFinderContextPtr ctx = finder->find(Name("escaped.example.org"),
  387. RRType::TXT());
  388. EXPECT_EQ(ZoneFinder::SUCCESS, ctx->code);
  389. EXPECT_EQ("escaped.example.org. 3600 IN TXT \"Hello~World\\;\\\"\"\n",
  390. ctx->rrset->toText());
  391. }
  392. }