fw: add test for received Interest with no nonce

refs #4685

Change-Id: I4f81890b34f4453825f7426e5e55c58b234258cd
This commit is contained in:
Eric Newberry committed 2020-06-24 12:46:18 -07:00
1 parent e1cf4ba46a
commit fdc0645d77
1 file changed
+19
+19
View File
@@ -135,6 +135,25 @@ BOOST_AUTO_TEST_CASE(CsMatched)
BOOST_CHECK_EQUAL(pit.size(), 0);
}
BOOST_AUTO_TEST_CASE(InterestWithoutNonce)
{
auto face1 = addFace();
auto face2 = addFace();
Fib& fib = forwarder.getFib();
fib::Entry* entry = fib.insert("/A").first;
fib.addOrUpdateNextHop(*entry, *face2, 0);
auto interest = makeInterest("/A");
BOOST_CHECK_EQUAL(interest->hasNonce(), false);
face1->receiveInterest(*interest, 0);
// Ensure Nonce added if incoming packet did not have Nonce
BOOST_REQUIRE_EQUAL(face2->getCounters().nOutInterests, 1);
BOOST_REQUIRE_EQUAL(face2->sentInterests.size(), 1);
BOOST_CHECK_EQUAL(face2->sentInterests.back().hasNonce(), true);
}
BOOST_AUTO_TEST_CASE(OutgoingInterest)
{
auto face1 = addFace();