|
@@ -193,8 +193,8 @@ TEST_F(DataSrcTest, QueryClassAny) {
|
|
|
}
|
|
|
|
|
|
TEST_F(DataSrcTest, NSQuery) {
|
|
|
- readAndProcessQuery("q_example_ns");
|
|
|
-
|
|
|
+ createAndProcessQuery(Name("example.com"), RRClass::IN(),
|
|
|
+ RRType::NS());
|
|
|
headerCheck(msg, Rcode::NOERROR(), true, true, true, 4, 0, 6);
|
|
|
|
|
|
RRsetIterator rit = msg.beginSection(Section::ANSWER());
|
|
@@ -216,7 +216,8 @@ TEST_F(DataSrcTest, NSQuery) {
|
|
|
|
|
|
// Make sure two successive queries have the same result
|
|
|
TEST_F(DataSrcTest, DuplicateQuery) {
|
|
|
- readAndProcessQuery("q_example_ns");
|
|
|
+ createAndProcessQuery(Name("example.com"), RRClass::IN(),
|
|
|
+ RRType::NS());
|
|
|
headerCheck(msg, Rcode::NOERROR(), true, true, true, 4, 0, 6);
|
|
|
|
|
|
RRsetIterator rit = msg.beginSection(Section::ANSWER());
|
|
@@ -236,7 +237,8 @@ TEST_F(DataSrcTest, DuplicateQuery) {
|
|
|
EXPECT_TRUE(it->isLast());
|
|
|
|
|
|
msg.clear(Message::PARSE);
|
|
|
- readAndProcessQuery("q_example_ns");
|
|
|
+ createAndProcessQuery(Name("example.com"), RRClass::IN(),
|
|
|
+ RRType::NS());
|
|
|
headerCheck(msg, Rcode::NOERROR(), true, true, true, 4, 0, 6);
|
|
|
|
|
|
rit = msg.beginSection(Section::ANSWER());
|
|
@@ -257,7 +259,8 @@ TEST_F(DataSrcTest, DuplicateQuery) {
|
|
|
}
|
|
|
|
|
|
TEST_F(DataSrcTest, DNSKEYQuery) {
|
|
|
- readAndProcessQuery("q_example_dnskey");
|
|
|
+ createAndProcessQuery(Name("example.com"), RRClass::IN(),
|
|
|
+ RRType::DNSKEY());
|
|
|
headerCheck(msg, Rcode::NOERROR(), true, true, true, 4, 4, 6);
|
|
|
|
|
|
RRsetIterator rit = msg.beginSection(Section::ANSWER());
|
|
@@ -271,7 +274,8 @@ TEST_F(DataSrcTest, DNSKEYQuery) {
|
|
|
// We query for a record at a zone cut to ensure the REFERRAL flag doesn't
|
|
|
// cause incorrect behavior.
|
|
|
TEST_F(DataSrcTest, DNSKEYDuplicateQuery) {
|
|
|
- readAndProcessQuery("q_example_dnskey");
|
|
|
+ createAndProcessQuery(Name("example.com"), RRClass::IN(),
|
|
|
+ RRType::DNSKEY());
|
|
|
headerCheck(msg, Rcode::NOERROR(), true, true, true, 4, 4, 6);
|
|
|
|
|
|
RRsetIterator rit = msg.beginSection(Section::ANSWER());
|
|
@@ -281,9 +285,8 @@ TEST_F(DataSrcTest, DNSKEYDuplicateQuery) {
|
|
|
EXPECT_EQ(RRClass::IN(), rrset->getClass());
|
|
|
|
|
|
msg.clear(Message::PARSE);
|
|
|
- readAndProcessQuery("q_example_dnskey");
|
|
|
- headerCheck(msg, Rcode::NOERROR(), true, true, true, 4, 4, 6);
|
|
|
-
|
|
|
+ createAndProcessQuery(Name("example.com"), RRClass::IN(),
|
|
|
+ RRType::DNSKEY());
|
|
|
rit = msg.beginSection(Section::ANSWER());
|
|
|
rrset = *rit;
|
|
|
EXPECT_EQ(Name("example.com"), rrset->getName());
|
|
@@ -292,7 +295,8 @@ TEST_F(DataSrcTest, DNSKEYDuplicateQuery) {
|
|
|
}
|
|
|
|
|
|
TEST_F(DataSrcTest, NxRRset) {
|
|
|
- readAndProcessQuery("q_example_ptr");
|
|
|
+ createAndProcessQuery(Name("example.com"), RRClass::IN(),
|
|
|
+ RRType::PTR());
|
|
|
|
|
|
headerCheck(msg, Rcode::NOERROR(), true, true, true, 0, 4, 0);
|
|
|
|
|
@@ -303,7 +307,8 @@ TEST_F(DataSrcTest, NxRRset) {
|
|
|
}
|
|
|
|
|
|
TEST_F(DataSrcTest, Nxdomain) {
|
|
|
- readAndProcessQuery("q_glork");
|
|
|
+ createAndProcessQuery(Name("glork.example.com"), RRClass::IN(),
|
|
|
+ RRType::A());
|
|
|
|
|
|
headerCheck(msg, Rcode::NXDOMAIN(), true, true, true, 0, 6, 0);
|
|
|
|
|
@@ -316,7 +321,8 @@ TEST_F(DataSrcTest, Nxdomain) {
|
|
|
}
|
|
|
|
|
|
TEST_F(DataSrcTest, NxZone) {
|
|
|
- readAndProcessQuery("q_spork");
|
|
|
+ createAndProcessQuery(Name("spork.example"), RRClass::IN(),
|
|
|
+ RRType::A());
|
|
|
|
|
|
headerCheck(msg, Rcode::REFUSED(), true, false, true, 0, 0, 0);
|
|
|
|
|
@@ -327,7 +333,8 @@ TEST_F(DataSrcTest, NxZone) {
|
|
|
}
|
|
|
|
|
|
TEST_F(DataSrcTest, Wildcard) {
|
|
|
- readAndProcessQuery("q_wild_a");
|
|
|
+ createAndProcessQuery(Name("www.wild.example.com"), RRClass::IN(),
|
|
|
+ RRType::A());
|
|
|
|
|
|
headerCheck(msg, Rcode::NOERROR(), true, true, true, 2, 6, 6);
|
|
|
|
|
@@ -380,17 +387,18 @@ TEST_F(DataSrcTest, Wildcard) {
|
|
|
}
|
|
|
|
|
|
TEST_F(DataSrcTest, WildcardNodata) {
|
|
|
-
|
|
|
// Check that a query for a data type not covered by the wildcard
|
|
|
// returns NOERROR
|
|
|
- readAndProcessQuery("q_wild_aaaa");
|
|
|
+ createAndProcessQuery(Name("www.wild.example.com"), RRClass::IN(),
|
|
|
+ RRType::AAAA());
|
|
|
headerCheck(msg, Rcode::NOERROR(), true, true, true, 0, 2, 0);
|
|
|
}
|
|
|
|
|
|
TEST_F(DataSrcTest, WildcardCname) {
|
|
|
// Check that wildcard answers containing CNAMES are followed
|
|
|
// correctly
|
|
|
- readAndProcessQuery("q_wild2_a");
|
|
|
+ createAndProcessQuery(Name("www.wild2.example.com"), RRClass::IN(),
|
|
|
+ RRType::A());
|
|
|
|
|
|
headerCheck(msg, Rcode::NOERROR(), true, true, true, 4, 6, 6);
|
|
|
|
|
@@ -458,7 +466,8 @@ TEST_F(DataSrcTest, WildcardCname) {
|
|
|
TEST_F(DataSrcTest, WildcardCnameNodata) {
|
|
|
// A wildcard containing a CNAME whose target does not include
|
|
|
// data of this type.
|
|
|
- readAndProcessQuery("q_wild2_aaaa");
|
|
|
+ createAndProcessQuery(Name("www.wild2.example.com"), RRClass::IN(),
|
|
|
+ RRType::AAAA());
|
|
|
headerCheck(msg, Rcode::NOERROR(), true, true, true, 2, 4, 0);
|
|
|
|
|
|
RRsetIterator rit = msg.beginSection(Section::ANSWER());
|
|
@@ -489,7 +498,8 @@ TEST_F(DataSrcTest, WildcardCnameNodata) {
|
|
|
|
|
|
TEST_F(DataSrcTest, WildcardCnameNxdomain) {
|
|
|
// A wildcard containing a CNAME whose target does not exist
|
|
|
- readAndProcessQuery("q_wild3_a");
|
|
|
+ createAndProcessQuery(Name("www.wild3.example.com"), RRClass::IN(),
|
|
|
+ RRType::A());
|
|
|
headerCheck(msg, Rcode::NOERROR(), true, true, true, 2, 6, 0);
|
|
|
|
|
|
RRsetIterator rit = msg.beginSection(Section::ANSWER());
|
|
@@ -525,7 +535,8 @@ TEST_F(DataSrcTest, WildcardCnameNxdomain) {
|
|
|
EXPECT_EQ(RRClass::IN(), rrset->getClass());
|
|
|
}
|
|
|
TEST_F(DataSrcTest, AuthDelegation) {
|
|
|
- readAndProcessQuery("q_sql1");
|
|
|
+ createAndProcessQuery(Name("www.sql1.example.com"), RRClass::IN(),
|
|
|
+ RRType::A());
|
|
|
|
|
|
headerCheck(msg, Rcode::NOERROR(), true, true, true, 2, 4, 6);
|
|
|
|
|
@@ -571,7 +582,8 @@ TEST_F(DataSrcTest, AuthDelegation) {
|
|
|
}
|
|
|
|
|
|
TEST_F(DataSrcTest, Dname) {
|
|
|
- readAndProcessQuery("q_dname");
|
|
|
+ createAndProcessQuery(Name("www.dname.example.com"), RRClass::IN(),
|
|
|
+ RRType::A());
|
|
|
|
|
|
headerCheck(msg, Rcode::NOERROR(), true, true, true, 5, 4, 6);
|
|
|
|
|
@@ -628,7 +640,8 @@ TEST_F(DataSrcTest, DnameExact) {
|
|
|
}
|
|
|
|
|
|
TEST_F(DataSrcTest, Cname) {
|
|
|
- readAndProcessQuery("q_cname");
|
|
|
+ createAndProcessQuery(Name("foo.example.com"), RRClass::IN(),
|
|
|
+ RRType::A());
|
|
|
|
|
|
headerCheck(msg, Rcode::NOERROR(), true, true, true, 2, 0, 0);
|
|
|
|
|
@@ -646,7 +659,8 @@ TEST_F(DataSrcTest, Cname) {
|
|
|
}
|
|
|
|
|
|
TEST_F(DataSrcTest, CnameInt) {
|
|
|
- readAndProcessQuery("q_cname_int");
|
|
|
+ createAndProcessQuery(Name("cname-int.example.com"), RRClass::IN(),
|
|
|
+ RRType::A());
|
|
|
|
|
|
headerCheck(msg, Rcode::NOERROR(), true, true, true, 4, 4, 6);
|
|
|
|
|
@@ -672,7 +686,8 @@ TEST_F(DataSrcTest, CnameInt) {
|
|
|
}
|
|
|
|
|
|
TEST_F(DataSrcTest, CnameExt) {
|
|
|
- readAndProcessQuery("q_cname_ext");
|
|
|
+ createAndProcessQuery(Name("cname-ext.example.com"), RRClass::IN(),
|
|
|
+ RRType::A());
|
|
|
|
|
|
headerCheck(msg, Rcode::NOERROR(), true, true, true, 4, 4, 6);
|
|
|
|
|
@@ -696,7 +711,8 @@ TEST_F(DataSrcTest, CnameExt) {
|
|
|
}
|
|
|
|
|
|
TEST_F(DataSrcTest, Delegation) {
|
|
|
- readAndProcessQuery("q_subzone");
|
|
|
+ createAndProcessQuery(Name("www.subzone.example.com"), RRClass::IN(),
|
|
|
+ RRType::A());
|
|
|
|
|
|
headerCheck(msg, Rcode::NOERROR(), true, false, true, 0, 5, 2);
|
|
|
|
|
@@ -726,7 +742,8 @@ TEST_F(DataSrcTest, Delegation) {
|
|
|
}
|
|
|
|
|
|
TEST_F(DataSrcTest, NSDelegation) {
|
|
|
- readAndProcessQuery("q_subzone_ns");
|
|
|
+ createAndProcessQuery(Name("subzone.example.com"), RRClass::IN(),
|
|
|
+ RRType::NS());
|
|
|
|
|
|
headerCheck(msg, Rcode::NOERROR(), true, false, true, 0, 5, 2);
|
|
|
|
|
@@ -758,12 +775,13 @@ TEST_F(DataSrcTest, NSDelegation) {
|
|
|
TEST_F(DataSrcTest, ANYZonecut) {
|
|
|
// An ANY query at a zone cut should behave the same as any other
|
|
|
// delegation
|
|
|
- readAndProcessQuery("q_subzone_any");
|
|
|
-
|
|
|
+ createAndProcessQuery(Name("subzone.example.com"), RRClass::IN(),
|
|
|
+ RRType::ANY());
|
|
|
}
|
|
|
|
|
|
TEST_F(DataSrcTest, NSECZonecut) {
|
|
|
- readAndProcessQuery("q_subzone_nsec");
|
|
|
+ createAndProcessQuery(Name("subzone.example.com"), RRClass::IN(),
|
|
|
+ RRType::NSEC());
|
|
|
|
|
|
headerCheck(msg, Rcode::NOERROR(), true, true, true, 2, 4, 6);
|
|
|
|
|
@@ -791,7 +809,8 @@ TEST_F(DataSrcTest, NSECZonecut) {
|
|
|
}
|
|
|
|
|
|
TEST_F(DataSrcTest, DNAMEZonecut) {
|
|
|
- readAndProcessQuery("q_subzone_dname");
|
|
|
+ createAndProcessQuery(Name("subzone.example.com"), RRClass::IN(),
|
|
|
+ RRType::DNAME());
|
|
|
|
|
|
headerCheck(msg, Rcode::NOERROR(), true, false, true, 0, 5, 2);
|
|
|
RRsetIterator rit = msg.beginSection(Section::AUTHORITY());
|
|
@@ -820,7 +839,8 @@ TEST_F(DataSrcTest, DNAMEZonecut) {
|
|
|
}
|
|
|
|
|
|
TEST_F(DataSrcTest, DS) {
|
|
|
- readAndProcessQuery("q_subzone_ds");
|
|
|
+ createAndProcessQuery(Name("subzone.example.com"), RRClass::IN(),
|
|
|
+ RRType::DS());
|
|
|
|
|
|
headerCheck(msg, Rcode::NOERROR(), true, true, true, 3, 4, 6);
|
|
|
|