rib: delete incorrect assertion in AutoPrefixPropagator::afterEraseRibEntry

Change-Id: Ie78675055317e5297174447ce4782c5e0fafd760
refs: #3362
This commit is contained in:
Yanbiao Li
2016-01-16 12:25:23 +08:00
parent 4100646192
commit 6db75f0bd2
2 changed files with 21 additions and 3 deletions
+3 -2
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
* Copyright (c) 2014-2015, Regents of the University of California,
* Copyright (c) 2014-2016, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -176,7 +176,8 @@ AutoPrefixPropagator::afterInsertRibEntry(const Name& prefix)
auto entryIt = m_propagatedEntries.find(propagateParameters.parameters.getName());
if (entryIt != m_propagatedEntries.end()) {
BOOST_ASSERT(!entryIt->second.isNew());
// in addition to PROPAGATED and PROPAGATE_FAIL, the state may also be NEW,
// if its propagation was suspended because there was no connectivity to the Hub.
NFD_LOG_INFO("prefix has already been propagated: "
<< propagateParameters.parameters.getName());
return;
+18 -1
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
* Copyright (c) 2014-2015, Regents of the University of California,
* Copyright (c) 2014-2016, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -421,6 +421,23 @@ BOOST_AUTO_TEST_CASE(NoHubConnectivity)
BOOST_CHECK(m_requests.empty());
}
BOOST_AUTO_TEST_CASE(ProcessSuspendedEntries)
{
BOOST_REQUIRE(addIdentity("/test/A"));
BOOST_REQUIRE(insertEntryToRib("/test/A/app1"));
BOOST_REQUIRE(insertEntryToRib("/test/A/app2"));
BOOST_CHECK(m_requests.empty()); // no propagation because no hub is connected
BOOST_CHECK_EQUAL(m_entries.size(), 1); // /test/A was suspended
BOOST_REQUIRE(eraseEntryFromRib("/test/A/app2"));
BOOST_CHECK_EQUAL(m_entries.size(), 1); // /test/A was kept for app1
// repeat the scenario that leads to BUG 3362.
// ensure there is no improper assertion.
BOOST_REQUIRE(insertEntryToRib("/test/A/app2"));
}
BOOST_AUTO_TEST_CASE(PropagatedEntryExists)
{
connectToHub();