Commit 051b1916 authored by Evan Hunt's avatar Evan Hunt
Browse files

Add a unit test for NS query at a zone cut


git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@1319 e5f2f494-b856-4b98-b285-d166d9295462
parent 1e3f8521
......@@ -207,7 +207,7 @@ TEST_F(DataSrcTest, NxZone) {
}
TEST_F(DataSrcTest, Wildcard) {
readAndProcessQuery(msg, "testdata/q_wild");
readAndProcessQuery(msg, "testdata/q_wild_a");
headerCheck(msg, Rcode::NOERROR(), true, true, true, 2, 4, 6);
......@@ -256,7 +256,7 @@ TEST_F(DataSrcTest, WildcardNodata) {
// Check that a query for a data type not covered by the wildcard
// returns NOERROR
readAndProcessQuery(msg, "testdata/q_wild2");
readAndProcessQuery(msg, "testdata/q_wild_aaaa");
headerCheck(msg, Rcode::NOERROR(), true, true, true, 0, 2, 0);
}
......@@ -452,6 +452,35 @@ TEST_F(DataSrcTest, Delegation) {
EXPECT_TRUE(it->isLast());
}
TEST_F(DataSrcTest, NSDelegation) {
readAndProcessQuery(msg, "testdata/q_subzone_ns");
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/NS (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 02 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