Commit 23e6b6ec authored by Michal Vaner's avatar Michal Vaner
Browse files

Merge #85 (test for ./DS query to server authoritative for .)

git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@3836 e5f2f494-b856-4b98-b285-d166d9295462
parents 0b626b87 848fddd0
......@@ -877,12 +877,32 @@ TEST_F(DataSrcTest, NSECZonecutOfNonsecureZone) {
EXPECT_TRUE(it->isLast());
}
TEST_F(DataSrcTest, RootDSQuery) {
// Test sending a DS query to root (nonsense, but it should survive)
TEST_F(DataSrcTest, RootDSQuery1) {
EXPECT_NO_THROW(createAndProcessQuery(Name("."), RRClass::IN(),
RRType::DS()));
headerCheck(msg, Rcode::REFUSED(), true, false, true, 0, 0, 0);
}
// The same, but when we have the root zone
// (which triggers rfc4035 section 3.1.4.1)
TEST_F(DataSrcTest, RootDSQuery2) {
// The message
msg.makeResponse();
msg.setOpcode(Opcode::QUERY());
msg.addQuestion(Question(Name("."), RRClass::IN(), RRType::DS()));
msg.setHeaderFlag(Message::HEADERFLAG_RD);
// Prepare the source
DataSrcPtr sql3_source = DataSrcPtr(new Sqlite3DataSrc);
ConstElementPtr sqlite_root = Element::fromJSON(
"{ \"database_file\": \"" TEST_DATA_DIR "/test-root.sqlite3\"}");
EXPECT_NO_THROW(sql3_source->init(sqlite_root));
// Make the query
EXPECT_NO_THROW(performQuery(*sql3_source, cache, msg));
headerCheck(msg, Rcode::NOERROR(), true, true, true, 0, 1, 0);
}
TEST_F(DataSrcTest, DSQueryFromCache) {
// explicitly enable hot spot cache
cache.setEnabled(true);
......
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