BOOST_CHECK_EQUAL(ret.size(), length);
BOOST_CHECK_EQUAL(length, SyncRes::s_max_CNAMES_followed + 1);
- // Currently a CNAME bounds check originating from the record cache causes an ImmediateServFail
- // exception. This is different from the non-cached case, tested above. There a ServFail is
- // returned with a partial CNAME chain. This should be fixed one way or another. For details, see
- // how the result of syncres.cc:scanForCNAMELoop() is handled in the two cases.
+ // The CNAME bounds check originating from the record cache causes an ImmediateServFail
+ // exception. This is different from the non-cached case, tested above.
ret.clear();
- length = 0;
BOOST_CHECK_EXCEPTION(sr->beginResolve(target, QType(QType::A), QClass::IN, ret),
ImmediateServFailException,
[&](const ImmediateServFailException& isfe) {
return isfe.reason == "max number of CNAMEs exceeded";
});
+ BOOST_CHECK_EQUAL(ret.size(), SyncRes::s_max_CNAMES_followed + 1);
+
+ // Again, now with QName Minimization on, originally this would fail as the result was collected
+ // in a temp vector and the throw would skip the copy of the temp vector into the end result
+ sr->setQNameMinimization();
+ ret.clear();
+ BOOST_CHECK_EXCEPTION(sr->beginResolve(target, QType(QType::A), QClass::IN, ret),
+ ImmediateServFailException,
+ [&](const ImmediateServFailException& isfe) {
+ return isfe.reason == "max number of CNAMEs exceeded";
+ });
+ BOOST_CHECK_EQUAL(ret.size(), SyncRes::s_max_CNAMES_followed + 1);
}
BOOST_AUTO_TEST_CASE(test_cname_target_servfail)