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/test-nlsr.cpp b/tests/test-nlsr.cpp
index 6be31ed..f5ffb8e 100644
--- a/tests/test-nlsr.cpp
+++ b/tests/test-nlsr.cpp
@@ -65,6 +65,7 @@
AdjacencyList& neighbors;
uint32_t nSuccessCallbacks;
uint32_t nFailureCallbacks;
+ ndn::util::signal::ScopedConnection connection;
};
BOOST_FIXTURE_TEST_SUITE(TestNlsr, NlsrFixture)
@@ -121,7 +122,6 @@
{
// Simulate loading configuration file
conf.setAdjLsaBuildInterval(3);
- conf.setFirstHelloInterval(6);
conf.setRoutingCalcInterval(9);
Nlsr nlsr2(m_face, m_keyChain, conf);
@@ -130,7 +130,6 @@
const RoutingTable& rt = nlsr2.m_routingTable;
BOOST_CHECK_EQUAL(lsdb.m_adjLsaBuildInterval, ndn::time::seconds(3));
- BOOST_CHECK_EQUAL(conf.getFirstHelloInterval(), 6);
BOOST_CHECK_EQUAL(rt.getRoutingCalcInterval(), ndn::time::seconds(9));
}
@@ -265,6 +264,9 @@
10, Adjacent::STATUS_ACTIVE, 0, 256);
neighbors.insert(otherNeighbor);
+ // Set HelloInterest lifetime as 10 seconds so that neighbors are not marked INACTIVE
+ // upon timeout before this test ends
+ conf.setInterestResendTime(10);
nlsr.initialize();
// Simulate successful HELLO responses
@@ -531,9 +533,6 @@
conf.setFaceDatasetFetchInterval(fetchInterval);
conf.setFaceDatasetFetchTries(0);
- nlsr.initializeFaces(std::bind(&Nlsr::processFaceDataset, &nlsr, _1),
- std::bind(&Nlsr::onFaceDatasetFetchTimeout, &nlsr, _1, _2, 0));
-
// Elapse the default timeout time of the interest.
this->advanceClocks(defaultTimeout);