/// discarded.
///
/// Finally, If conflict resolution is enabled, it will instantiate either
- /// a NameAddTranscation or a NameRemoveTransaction. If disabled it will
- /// instantiate either a SimpleAddTransaction or a SimpleRemoveTranscation.
+ /// a NameAddTransaction or a NameRemoveTransaction. If disabled it will
+ /// instantiate either a SimpleAddTransaction or a SimpleRemoveTransaction.
///
/// @param ncr the NameChangeRequest for which to create a transaction.
///
dns::RRType::DHCID(), lease_ttl));
// We add the DHCID for auditing purposes and in the event
- // conflict resoloution is later enabled.
+ // conflict resolution is later enabled.
addDhcidRdata(update);
request->addRRset(D2UpdateMessage::SECTION_UPDATE, update);
NameChangeTransactionPtr trans = (*pos).second;
ASSERT_TRUE(trans);
- // Verify the correct type of transcation was created.
- ASSERT_NO_THROW(dynamic_cast<NameAddTransaction&>(*trans));
+ // Verify the correct type of transaction was created.
+ NameAddTransaction* t = dynamic_cast<NameAddTransaction*>(trans.get());
+ ASSERT_TRUE(t);
// At this point the transaction should have constructed
// and sent the DNS request.
NameChangeTransactionPtr trans = (*pos).second;
ASSERT_TRUE(trans);
- // Verify the correct type of transcation was created.
- ASSERT_NO_THROW(dynamic_cast<NameRemoveTransaction&>(*trans));
+ // Verify the correct type of transaction was created.
+ NameRemoveTransaction* t = dynamic_cast<NameRemoveTransaction*>(trans.get());
+ ASSERT_TRUE(t);
// At this point the transaction should have constructed
// and sent the DNS request.
NameChangeTransactionPtr trans = (*pos).second;
ASSERT_TRUE(trans);
- // Verify the correct type of transcation was created.
- ASSERT_NO_THROW(dynamic_cast<SimpleAddTransaction&>(*trans));
+ // Verify the correct type of transaction was created.
+ SimpleAddTransaction* t = dynamic_cast<SimpleAddTransaction*>(trans.get());
+ ASSERT_TRUE(t);
// At this point the transaction should have constructed
// and sent the DNS request.
NameChangeTransactionPtr trans = (*pos).second;
ASSERT_TRUE(trans);
- // Verify the correct type of transcation was created.
- ASSERT_NO_THROW(dynamic_cast<SimpleRemoveTransaction&>(*trans));
+ // Verify the correct type of transaction was created.
+ SimpleRemoveTransaction* t = dynamic_cast<SimpleRemoveTransaction*>(trans.get());
+ ASSERT_TRUE(t);
// At this point the transaction should have constructed
// and sent the DNS request.
name_remove->getNextEvent());
}
-// Tests addingFwdAddrsHandler with the following scenario:
+// Tests removingFwdAddrsHandler with the following scenario:
//
// The request includes only a forward change.
// Initial posted event is SERVER_SELECTED_EVT.
checkZone(request, exp_zone_name);
// Verify the PREREQUISITE SECTION
- // There should be no prerequisites.
+ // There should be no prerequisites.
dns::RRsetPtr rrset;
checkRRCount(request, D2UpdateMessage::SECTION_PREREQUISITE, 0);
// Verify the UPDATE SECTION
// Should be 4
// 1. delete of the FQDN/IP RR
- // 2. delete of the DHCID RR
+ // 2. delete of the DHCID RR
// 3. add of the FQDN/IP RR
- // 4. add of the DHCID RR
+ // 4. add of the DHCID RR
checkRRCount(request, D2UpdateMessage::SECTION_UPDATE, 4);
// Fetch ttl.
ASSERT_NO_THROW(request->toWire(renderer));
}
+// Verifies that the contents of the given transaction's DNS update request
+// is correct for removing a reverse DNS entry when not using conflict
+// resolution.
void checkSimpleRemoveRevPtrsRequest(NameChangeTransaction& tran) {
const D2UpdateMessagePtr& request = tran.getDnsUpdateRequest();
ASSERT_TRUE(request);
std::string exp_zone_name = tran.getReverseDomain()->getName();
std::string exp_rev_addr = D2CfgMgr::reverseIpAddress(ncr->getIpAddress());
- const dns::RRType& exp_ip_rr_type = tran.getAddressRRType();
// Verify the zone section.
checkZone(request, exp_zone_name);
ASSERT_NO_THROW(request->toWire(renderer));
}
+// Verifies the current state and next event in a transaction
void checkContext(NameChangeTransactionPtr trans, const int exp_state,
const int exp_evt, const std::string& file, int line) {
ASSERT_TRUE(trans);
<< " at " << file << ":" << line;
}
-}; // namespace isc::d2
-}; // namespace isc
+} // namespace isc::d2
+} // namespace isc
/// @param exp_state expected current state of the transaction
/// @param exp_event expected next event of the transaction
/// @param file source file name
-/// @param line souce line number
+/// @param line source line number
extern void checkContext(NameChangeTransactionPtr trans, const int exp_state,
const int exp_evt, const std::string& file, int line);
#define CHECK_CONTEXT(a,b,c) checkContext(a,b,c,__FILE__,__LINE__)
-}; // namespace isc::d2
-}; // namespace isc
+} // namespace isc::d2
+} // namespace isc
#endif
element = ncr->getElement("lease-length", element_map);
ncr->setLeaseLength(element);
- // For backward compatiblity use-conflict-resolution is optional
+ // For backward compatibility use-conflict-resolution is optional
// and defaults to true.
auto found = element_map.find("use-conflict-resolution");
if (found != element_map.end()) {
/// @brief The amount of time in seconds for which the lease is valid (TTL).
uint32_t lease_length_;
- /// @brief Indicates if conflict resoltuion is enabled.
+ /// @brief Indicates if conflict resolution is enabled.
bool conflict_resolution_;
/// @brief The processing status of the request. Used internally.