Commit a3e8eb8a authored by Evan Hunt's avatar Evan Hunt
Browse files

add a unit test to explicitly cover the case of an ANY query at a zone cut


git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@1328 e5f2f494-b856-4b98-b285-d166d9295462
parent d8791496
......@@ -481,6 +481,39 @@ TEST_F(DataSrcTest, NSDelegation) {
it->next();
EXPECT_TRUE(it->isLast());
}
TEST_F(DataSrcTest, ANYDelegation) {
// An ANY query at a zone cut should behave the same as any other
// delegation
readAndProcessQuery(msg, "testdata/q_subzone_any");
headerCheck(msg, Rcode::NOERROR(), true, false, true, 0, 5, 2);
RRsetIterator rit = msg.beginSection(Section::AUTHORITY());
RRsetPtr rrset = *rit;
EXPECT_EQ(Name("subzone.example.com."), rrset->getName());
EXPECT_EQ(RRType::NS(), rrset->getType());
EXPECT_EQ(RRClass::IN(), rrset->getClass());
RdataIteratorPtr it = rrset->getRdataIterator();
it->first();
EXPECT_EQ("ns1.subzone.example.com.", it->getCurrent().toText());
it->next();
EXPECT_FALSE(it->isLast());
rit = msg.beginSection(Section::ADDITIONAL());
rrset = *rit;
EXPECT_EQ(Name("ns1.subzone.example.com"), rrset->getName());
EXPECT_EQ(RRType::A(), rrset->getType());
EXPECT_EQ(RRClass::IN(), rrset->getClass());
it = rrset->getRdataIterator();
it->first();
EXPECT_EQ("192.168.3.1", it->getCurrent().toText());
it->next();
EXPECT_TRUE(it->isLast());
}
TEST_F(DataSrcTest, DS) {
readAndProcessQuery(msg, "testdata/q_subzone_ds");
......
# www.subzone.example.com/A (delegation to non-local zone)
00 7c 01 00 00 01 00 00 00 00 00 00 03 77 77 77
07 73 75 62 7a 6f 6e 65 07 65 78 61 6d 70 6c 65
03 63 6f 6d 00 00 ff 00 01
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment