src: change initialization order
Send Hello Interest after route to neighbor is successfully registered
--> First Hello interval is eliminated
--> After Hello Nack, wait exponentially before processing it as a timeout
Register sync route for each neighbor after its Hello Data is validated
refs: #5009
Change-Id: Ice39a591f1e58e474b494d93c913fa45e10f24f2
diff --git a/tests/communication/test-sync-logic-handler.cpp b/tests/communication/test-sync-logic-handler.cpp
index 4dc6346..2352735 100644
--- a/tests/communication/test-sync-logic-handler.cpp
+++ b/tests/communication/test-sync-logic-handler.cpp
@@ -61,12 +61,12 @@
if (Protocol == SYNC_PROTOCOL_CHRONOSYNC) {
std::vector<chronosync::MissingDataInfo> updates;
updates.push_back({ndn::Name(prefix).appendNumber(1), 0, seqNo});
- sync.m_syncLogic->onChronoSyncUpdate(updates);
+ sync.m_syncLogic.onChronoSyncUpdate(updates);
}
else {
std::vector<psync::MissingDataInfo> updates;
updates.push_back({ndn::Name(prefix), 0, seqNo});
- sync.m_syncLogic->onPSyncUpdate(updates);
+ sync.m_syncLogic.onPSyncUpdate(updates);
}
this->advanceClocks(ndn::time::milliseconds(1), 10);
@@ -246,8 +246,6 @@
expectedPrefix.append(this->conf.getSiteName());
expectedPrefix.append(this->conf.getRouterName());
- this->sync.buildUpdatePrefix();
-
BOOST_CHECK_EQUAL(this->sync.m_nameLsaUserPrefix,
ndn::Name(expectedPrefix).append(std::to_string(Lsa::Type::NAME)));
BOOST_CHECK_EQUAL(this->sync.m_adjLsaUserPrefix,
@@ -256,27 +254,6 @@
ndn::Name(expectedPrefix).append(std::to_string(Lsa::Type::COORDINATE)));
}
-/* Tests that SyncLogicHandler's socket will be created when
- Nlsr is initialized, preventing use of sync before the
- socket is created.
-
- NB: This test is as much an Nlsr class test as a
- SyncLogicHandler class test, but it rides the line and ends up here.
- */
-BOOST_FIXTURE_TEST_CASE_TEMPLATE(createSyncLogicOnInitialization, T, Protocols,
- SyncLogicFixture<T::value>) // Bug #2649
-{
- Nlsr nlsr(this->face, this->m_keyChain, this->conf);
-
- // Make sure an adjacency LSA has not been built yet
- ndn::Name key = ndn::Name(this->conf.getRouterPrefix()).append(std::to_string(Lsa::Type::ADJACENCY));
- AdjLsa* lsa = nlsr.m_lsdb.findAdjLsa(key);
- BOOST_REQUIRE(lsa == nullptr);
-
- // Publish a routing update before an Adjacency LSA is built
- BOOST_CHECK_NO_THROW(nlsr.m_lsdb.m_sync.publishRoutingUpdate(Lsa::Type::ADJACENCY, 0));
-}
-
BOOST_AUTO_TEST_SUITE_END()
} // namespace test