tests: add FreshnessPeriod where MustBeFresh is used
refs #4913 Change-Id: Idf7e85b46ea9530678b51bf1f472ecfcfca5773f
This commit is contained in:
1 parent
15052408e9
commit
0b1b7d9ff4
2 files changed
+13
-7
No files matched your search
@@ -29,17 +29,18 @@
|
||||
#include <boost/asio.hpp>
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <ndn-cxx/util/scheduler.hpp>
|
||||
#include <ndn-cxx/security/key-chain.hpp>
|
||||
#include <ndn-cxx/util/time-unit-test-clock.hpp>
|
||||
|
||||
#include <ndn-cxx/security/signature-sha256-with-rsa.hpp>
|
||||
#include <ndn-cxx/face.hpp>
|
||||
#include <ndn-cxx/security/key-chain.hpp>
|
||||
#include <ndn-cxx/security/signature-sha256-with-rsa.hpp>
|
||||
#include <ndn-cxx/util/dummy-client-face.hpp>
|
||||
#include <ndn-cxx/util/scheduler.hpp>
|
||||
#include <ndn-cxx/util/time-unit-test-clock.hpp>
|
||||
|
||||
namespace nlsr {
|
||||
namespace test {
|
||||
|
||||
using namespace ndn::time_literals;
|
||||
|
||||
ndn::Data&
|
||||
signData(ndn::Data& data);
|
||||
|
||||
@@ -154,6 +155,7 @@ public:
|
||||
}
|
||||
|
||||
auto data = make_shared<ndn::Data>(name);
|
||||
data->setFreshnessPeriod(1_s);
|
||||
data->setFinalBlock(name[-1]);
|
||||
data->setContent(std::forward<ContentArgs>(contentArgs)...);
|
||||
this->signDatasetReply(*data);
|
||||
|
||||
+6
-2
@@ -1,5 +1,5 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/**
|
||||
/*
|
||||
* Copyright (c) 2014-2019, The University of Memphis,
|
||||
* Regents of the University of California,
|
||||
* Arizona Board of Regents.
|
||||
@@ -17,7 +17,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* NLSR, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
|
||||
**/
|
||||
*/
|
||||
|
||||
#include "nlsr.hpp"
|
||||
#include "test-common.hpp"
|
||||
@@ -153,6 +153,7 @@ BOOST_AUTO_TEST_CASE(FaceCreateEvent)
|
||||
.setRemoteUri(faceUri)
|
||||
.setFaceId(faceId);
|
||||
auto data = std::make_shared<ndn::Data>("/localhost/nfd/faces/events/%FE%00");
|
||||
data->setFreshnessPeriod(1_s);
|
||||
data->setContent(event.wireEncode());
|
||||
m_keyChain.sign(*data);
|
||||
m_face.receive(*data);
|
||||
@@ -185,6 +186,7 @@ BOOST_AUTO_TEST_CASE(FaceCreateEventNoMatch)
|
||||
.setRemoteUri(eventUri)
|
||||
.setFaceId(faceId);
|
||||
auto data = std::make_shared<ndn::Data>("/localhost/nfd/faces/events/%FE%00");
|
||||
data->setFreshnessPeriod(1_s);
|
||||
data->setContent(event.wireEncode());
|
||||
m_keyChain.sign(*data);
|
||||
m_face.receive(*data);
|
||||
@@ -215,6 +217,7 @@ BOOST_AUTO_TEST_CASE(FaceCreateEventAlreadyConfigured)
|
||||
.setRemoteUri(faceUri)
|
||||
.setFaceId(eventFaceId);
|
||||
std::shared_ptr<ndn::Data> data = std::make_shared<ndn::Data>("/localhost/nfd/faces/events/%FE%00");
|
||||
data->setFreshnessPeriod(1_s);
|
||||
data->setContent(event.wireEncode());
|
||||
m_keyChain.sign(*data);
|
||||
m_face.receive(*data);
|
||||
@@ -303,6 +306,7 @@ BOOST_AUTO_TEST_CASE(FaceDestroyEvent)
|
||||
.setFaceId(destroyFaceId);
|
||||
|
||||
std::shared_ptr<ndn::Data> data = std::make_shared<ndn::Data>("/localhost/nfd/faces/events/%FE%00");
|
||||
data->setFreshnessPeriod(1_s);
|
||||
data->setContent(event.wireEncode());
|
||||
m_keyChain.sign(*data);
|
||||
|
||||
|
||||
Reference in new issue
Block a user