fib: don't refresh neighbor router's FIB entry (it is already installed w/ expiry=never)
refs: #4799
Change-Id: Ib55687655ccd8673eeae14d8418e458ad8ab00aa
diff --git a/tests/test-fib.cpp b/tests/test-fib.cpp
index 629f933..04b08ea 100644
--- a/tests/test-fib.cpp
+++ b/tests/test-fib.cpp
@@ -36,7 +36,7 @@
{
public:
FibFixture()
- : face(std::make_shared<ndn::util::DummyClientFace>(m_keyChain))
+ : face(std::make_shared<ndn::util::DummyClientFace>(m_ioService, m_keyChain))
, interests(face->sentInterests)
{
Adjacent neighbor1(router1Name, ndn::FaceUri(router1FaceUri), 0, Adjacent::STATUS_ACTIVE, 0, router1FaceId);
@@ -51,6 +51,7 @@
conf.setMaxFacesPerPrefix(2);
fib = std::make_shared<Fib>(*face, m_scheduler, adjacencies, conf, m_keyChain);
+ fib->setEntryRefreshTime(1);
fib->m_faceMap.update(router1FaceUri, router1FaceId);
fib->m_faceMap.update(router2FaceUri, router2FaceId);
@@ -314,6 +315,22 @@
this->advanceClocks(ndn::time::milliseconds(10), 1);
}
+BOOST_AUTO_TEST_CASE(ShouldNotRefreshNeighborRoute) // #4799
+{
+ NextHop hop1;
+ hop1.setConnectingFaceUri(router1FaceUri);
+
+ NexthopList hops;
+ hops.addNextHop(hop1);
+
+ // Simulate update for this neighbor from name prefix table
+ fib->update(router1Name, hops);
+ this->advanceClocks(ndn::time::seconds(1));
+
+ // Should not send the register interest
+ BOOST_CHECK_EQUAL(face->sentInterests.size(), 0);
+}
+
BOOST_AUTO_TEST_SUITE_END()
} // namespace test