tests: sign command Interests with CommandInterestSigner

Previously used ndn::v2::KeyChain::sign creates signed Interests, not
command Interests.

refs #4089

Change-Id: I7b13926d676ff81041f036eaec1978d82e8e1dfd
This commit is contained in:
Junxiao Shi committed 2017-07-03 00:05:08 +00:00
1 parent 83be1dae4b
commit 8a1f170ea6
13 files changed
+190 -226

No files matched your search

+4 -7
View File
@@ -118,7 +118,7 @@ BOOST_AUTO_TEST_CASE(RegisterStatusDataset)
m_manager.registerStatusDatasetHandler("test-status", handler);
setTopPrefix("/localhost/nfd");
receiveInterest(makeInterest("/localhost/nfd/test-module/test-status"));
receiveInterest(Interest("/localhost/nfd/test-module/test-status"));
BOOST_CHECK(isStatusDatasetCalled);
}
@@ -140,15 +140,12 @@ BOOST_AUTO_TEST_CASE(ExtractRequester)
std::string requesterName;
auto testAccept = [&] (const std::string& requester) { requesterName = requester; };
auto unsignedCommand = makeInterest("/test/interest/unsigned");
auto signedCommand = makeControlCommandRequest("/test/interest/signed", ControlParameters());
m_manager.extractRequester(*unsignedCommand, testAccept);
m_manager.extractRequester(Interest("/test/interest/unsigned"), testAccept);
BOOST_CHECK(requesterName.empty());
requesterName = "";
m_manager.extractRequester(*signedCommand, testAccept);
auto keyLocator = m_keyChain.getPib().getIdentity(m_identityName).getDefaultKey().getName();
m_manager.extractRequester(makeControlCommandRequest("/test/interest/signed", ControlParameters()), testAccept);
auto keyLocator = m_keyChain.getPib().getIdentity(DEFAULT_COMMAND_SIGNER_IDENTITY).getDefaultKey().getName();
BOOST_CHECK_EQUAL(requesterName, keyLocator.toUri());
}