tests: sign command Interests with CommandInterestSigner
Previously used ndn::v2::KeyChain::sign creates signed Interests, not
command Interests.
refs #4089
Change-Id: I7b13926d676ff81041f036eaec1978d82e8e1dfd
diff --git a/tests/daemon/mgmt/face-manager-create-face.t.cpp b/tests/daemon/mgmt/face-manager-create-face.t.cpp
index 428e517..ac50913 100644
--- a/tests/daemon/mgmt/face-manager-create-face.t.cpp
+++ b/tests/daemon/mgmt/face-manager-create-face.t.cpp
@@ -228,15 +228,11 @@
using FaceType = typename T::first;
using CreateResult = typename T::second;
- Name commandName("/localhost/nfd/faces");
- commandName.append("create");
- commandName.append(FaceType::getParameters().wireEncode());
- auto command = makeInterest(commandName);
- m_keyChain.sign(*command);
+ Interest req = makeControlCommandRequest("/localhost/nfd/faces/create", FaceType::getParameters());
bool hasCallbackFired = false;
- this->node1.face.onSendData.connect([this, command, &hasCallbackFired] (const Data& response) {
- if (!command->getName().isPrefixOf(response.getName())) {
+ this->node1.face.onSendData.connect([this, req, &hasCallbackFired] (const Data& response) {
+ if (!req.getName().isPrefixOf(response.getName())) {
return;
}
@@ -284,7 +280,7 @@
hasCallbackFired = true;
});
- this->node1.face.receive(*command);
+ this->node1.face.receive(req);
this->advanceClocks(time::milliseconds(1), 5);
BOOST_CHECK(hasCallbackFired);
@@ -296,14 +292,8 @@
{
// create face
-
- Name commandName("/localhost/nfd/faces");
- commandName.append("create");
- commandName.append(FaceType::getParameters().wireEncode());
- auto command = makeInterest(commandName);
- m_keyChain.sign(*command);
-
- this->node1.face.receive(*command);
+ Interest req = makeControlCommandRequest("/localhost/nfd/faces/create", FaceType::getParameters());
+ this->node1.face.receive(req);
this->advanceClocks(time::milliseconds(1), 5);
}
@@ -313,17 +303,12 @@
{
// re-create face
-
- Name commandName("/localhost/nfd/faces");
- commandName.append("create");
- commandName.append(FaceType::getParameters().wireEncode());
- auto command = makeInterest(commandName);
- m_keyChain.sign(*command);
+ Interest req = makeControlCommandRequest("/localhost/nfd/faces/create", FaceType::getParameters());
bool hasCallbackFired = false;
this->node1.face.onSendData.connect(
- [this, command, &hasCallbackFired, foundFace] (const Data& response) {
- if (!command->getName().isPrefixOf(response.getName())) {
+ [this, req, &hasCallbackFired, foundFace] (const Data& response) {
+ if (!req.getName().isPrefixOf(response.getName())) {
return;
}
@@ -338,7 +323,7 @@
hasCallbackFired = true;
});
- this->node1.face.receive(*command);
+ this->node1.face.receive(req);
this->advanceClocks(time::milliseconds(1), 5);
BOOST_CHECK(hasCallbackFired);