Commit 68eab3b1 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

an additional test case for CNAME loops


git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@1124 e5f2f494-b856-4b98-b285-d166d9295462
parent f63c6c70
......@@ -52,6 +52,14 @@ protected:
Message msg;
};
void
performQuery(Message& message) {
message.setHeaderFlag(MessageFlag::AA());
message.setRcode(Rcode::NOERROR());
Query q(message, true);
ds.doQuery(q);
}
void
readAndProcessQuery(Message& message, const char* datafile) {
std::vector<unsigned char> data;
......@@ -61,10 +69,18 @@ readAndProcessQuery(Message& message, const char* datafile) {
message.fromWire(buffer);
message.makeResponse();
message.setHeaderFlag(MessageFlag::AA());
message.setRcode(Rcode::NOERROR());
Query q(message, true);
ds.doQuery(q);
performQuery(message);
}
void
createAndProcessQuery(Message& message, const Name& qname,
const RRClass& qclass, const RRType& qtype)
{
message.makeResponse();
message.setOpcode(Opcode::QUERY());
message.addQuestion(Question(qname, qclass, qtype));
message.setHeaderFlag(MessageFlag::RD());
performQuery(message);
}
void
......@@ -455,5 +471,11 @@ TEST_F(DataSrcTest, DS) {
EXPECT_TRUE(it->isLast());
}
TEST_F(DataSrcTest, CNAMELoop) {
// This should not make the process hang
//createAndProcessQuery(msg, Name("loop1.example.com"), RRClass::IN(),
// RRType::A());
}
}
This diff is collapsed.
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