|
@@ -915,6 +915,24 @@ TEST_F(DataSrcTest, RootDSQuery) {
|
|
|
headerCheck(msg, Rcode::REFUSED(), true, false, true, 0, 0, 0);
|
|
|
}
|
|
|
|
|
|
+TEST_F(DataSrcTest, DSQueryFromCache) {
|
|
|
+ // explicitly enable hot spot cache
|
|
|
+ cache.setEnabled(true);
|
|
|
+
|
|
|
+ // The first query will create a negative cache for example.org/CNAME
|
|
|
+ createAndProcessQuery(Name("example.org"), RRClass::IN(), RRType::SOA());
|
|
|
+
|
|
|
+ // the cached CNAME shouldn't confuse subsequent query.
|
|
|
+ // there may be several different possible cases that could trigger a bug,
|
|
|
+ // but DS query is the only known example.
|
|
|
+ msg.clear(Message::PARSE);
|
|
|
+ createAndProcessQuery(Name("example.org"), RRClass::IN(), RRType::DS());
|
|
|
+
|
|
|
+ // returning refused is probably a bad behavior, but it's a different
|
|
|
+ // issue -- see Trac Ticket #306.
|
|
|
+ headerCheck(msg, Rcode::REFUSED(), true, false, true, 0, 0, 0);
|
|
|
+}
|
|
|
+
|
|
|
// Non-existent name in the "static" data source. The purpose of this test
|
|
|
// is to check a corner case behavior when atypical RRClass (CH in this case)
|
|
|
// is specified.
|