;; test zone file used for ZoneFinderContext tests.
;; RRSIGs are (obviouslly) faked ones for testing.
-example.org. 3600 IN SOA ns1.example.org. bugs.x.w.example.org. 52 3600 300 3600000 3600
+example.org. 3600 IN SOA ns1.example.org. bugs.x.w.example.org. 55 3600 300 3600000 3600
example.org. 3600 IN NS ns1.example.org.
example.org. 3600 IN NS ns2.example.org.
example.org. 3600 IN MX 1 mx1.example.org.
foo.ns.empty.example.org. 3600 IN A 192.0.2.13
bar.ns.empty.example.org. 3600 IN A 192.0.2.14
+;; delegation; the NS name matches a wildcard (and there's no exact match)
+e.example.org. 3600 IN NS ns.wild.example.org.
+*.wild.example.org. 3600 IN A 192.0.2.15
+
;; CNAME
alias.example.org. 3600 IN CNAME cname.example.org.
result_sets_.begin(), result_sets_.end());
}
+TEST_P(ZoneFinderContextTest, getAdditionalDelegationWithWild) {
+ // The NS name needs to be expanded by a wildcard. Currently it doesn't
+ // work for the optimized in-memory version.
+ if (GetParam() == createInMemoryClient) {
+ return;
+ }
+
+ ZoneFinderContextPtr ctx = finder_->find(Name("www.e.example.org"),
+ RRType::AAAA());
+ EXPECT_EQ(ZoneFinder::DELEGATION, ctx->code);
+ ctx->getAdditional(REQUESTED_BOTH, result_sets_);
+ rrsetsCheck("ns.wild.example.org. 3600 IN A 192.0.2.15\n",
+ result_sets_.begin(), result_sets_.end());
+}
+
TEST_P(ZoneFinderContextTest, getAdditionalMX) {
// Similar to the previous cases, but for MX addresses. The test zone
// contains MX name under a zone cut. Its address shouldn't be returned.