diff --git a/tests/core/manager-base.t.cpp b/tests/core/manager-base.t.cpp
index db3a8ec..7a7cd12 100644
--- a/tests/core/manager-base.t.cpp
+++ b/tests/core/manager-base.t.cpp
@@ -118,7 +118,7 @@
   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 @@
   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());
 }
 
diff --git a/tests/daemon/mgmt/command-authenticator.t.cpp b/tests/daemon/mgmt/command-authenticator.t.cpp
index 7d2ed6e..498f44f 100644
--- a/tests/daemon/mgmt/command-authenticator.t.cpp
+++ b/tests/daemon/mgmt/command-authenticator.t.cpp
@@ -24,16 +24,15 @@
  */
 
 #include "mgmt/command-authenticator.hpp"
-#include <ndn-cxx/security/signing-helpers.hpp>
 #include <boost/filesystem.hpp>
 
 #include "tests/test-common.hpp"
-#include "tests/identity-management-fixture.hpp"
+#include "tests/manager-common-fixture.hpp"
 
 namespace nfd {
 namespace tests {
 
-class CommandAuthenticatorFixture : public IdentityManagementTimeFixture
+class CommandAuthenticatorFixture : public CommandInterestSignerFixture
 {
 protected:
   CommandAuthenticatorFixture()
@@ -63,17 +62,17 @@
   authorize(const std::string& module, const Name& identity,
             const function<void(Interest&)>& modifyInterest = nullptr)
   {
-    auto interest = makeInterest(Name("/prefix").append(module).append("verb"));
-    m_keyChain.sign(*interest, signingByIdentity(identity));
+    Interest interest = this->makeControlCommandRequest(Name("/prefix/" + module + "/verb"),
+                        ControlParameters(), identity);
     if (modifyInterest != nullptr) {
-      modifyInterest(*interest);
+      modifyInterest(interest);
     }
 
     ndn::mgmt::Authorization authorization = authorizations.at(module);
 
     bool isAccepted = false;
     bool isRejected = false;
-    authorization(Name("/prefix"), *interest, nullptr,
+    authorization(Name("/prefix"), interest, nullptr,
       [this, &isAccepted, &isRejected] (const std::string& requester) {
         BOOST_REQUIRE_MESSAGE(!isAccepted && !isRejected,
                               "authorization function should invoke only one continuation");
diff --git a/tests/daemon/mgmt/face-manager-command-fixture.hpp b/tests/daemon/mgmt/face-manager-command-fixture.hpp
index bf376f5..b00b9cc 100644
--- a/tests/daemon/mgmt/face-manager-command-fixture.hpp
+++ b/tests/daemon/mgmt/face-manager-command-fixture.hpp
@@ -29,10 +29,7 @@
 #include "mgmt/face-manager.hpp"
 #include "fw/face-table.hpp"
 
-#include "tests/identity-management-fixture.hpp"
-
-#include <ndn-cxx/mgmt/dispatcher.hpp>
-#include <ndn-cxx/util/dummy-client-face.hpp>
+#include "tests/manager-common-fixture.hpp"
 
 namespace nfd {
 namespace tests {
@@ -61,7 +58,7 @@
   FaceManager manager;
 };
 
-class FaceManagerCommandFixture : public IdentityManagementTimeFixture
+class FaceManagerCommandFixture : public CommandInterestSignerFixture
 {
 public:
   FaceManagerCommandFixture();
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);
diff --git a/tests/daemon/mgmt/face-manager-update-face.t.cpp b/tests/daemon/mgmt/face-manager-update-face.t.cpp
index 6757622..e81e3be 100644
--- a/tests/daemon/mgmt/face-manager-update-face.t.cpp
+++ b/tests/daemon/mgmt/face-manager-update-face.t.cpp
@@ -68,18 +68,15 @@
   createFace(const ControlParameters& createParams,
              bool isForOnDemandFace = false)
   {
-    Name commandName("/localhost/nfd/faces/create");
-    commandName.append(createParams.wireEncode());
-    auto command = makeInterest(commandName);
-    m_keyChain.sign(*command);
+    Interest req = makeControlCommandRequest("/localhost/nfd/faces/create", createParams);
 
     // if this creation if for on-demand face then create it on node2
     FaceManagerCommandNode& target = isForOnDemandFace ? this->node2 : this->node1;
 
     bool hasCallbackFired = false;
     signal::ScopedConnection connection = target.face.onSendData.connect(
-      [&, command, isForOnDemandFace, this] (const Data& response) {
-        if (!command->getName().isPrefixOf(response.getName())) {
+      [&, req, isForOnDemandFace, this] (const Data& response) {
+        if (!req.getName().isPrefixOf(response.getName())) {
           return;
         }
 
@@ -101,7 +98,7 @@
         }
       });
 
-    target.face.receive(*command);
+    target.face.receive(req);
     this->advanceClocks(time::milliseconds(1), 5);
 
     if (isForOnDemandFace) {
@@ -117,19 +114,16 @@
              bool isSelfUpdating,
              const function<void(const ControlResponse& resp)>& checkResp)
   {
-    Name commandName("/localhost/nfd/faces/update");
-    commandName.append(requestParams.wireEncode());
-    auto command = makeInterest(commandName);
+    Interest req = makeControlCommandRequest("/localhost/nfd/faces/update", requestParams);
     if (isSelfUpdating) {
       // Attach IncomingFaceIdTag to interest
-      command->setTag(make_shared<lp::IncomingFaceIdTag>(faceId));
+      req.setTag(make_shared<lp::IncomingFaceIdTag>(faceId));
     }
-    m_keyChain.sign(*command);
 
     bool hasCallbackFired = false;
     signal::ScopedConnection connection = this->node1.face.onSendData.connect(
-      [this, command, &hasCallbackFired, &checkResp] (const Data& response) {
-        if (!command->getName().isPrefixOf(response.getName())) {
+      [this, req, &hasCallbackFired, &checkResp] (const Data& response) {
+        if (!req.getName().isPrefixOf(response.getName())) {
           return;
         }
 
@@ -139,7 +133,7 @@
         hasCallbackFired = true;
       });
 
-    this->node1.face.receive(*command);
+    this->node1.face.receive(req);
     this->advanceClocks(time::milliseconds(1), 5);
 
     BOOST_CHECK(hasCallbackFired);
@@ -156,15 +150,12 @@
     ControlParameters params;
     params.setFaceId(faceId);
 
-    Name commandName("/localhost/nfd/faces/destroy");
-    commandName.append(params.wireEncode());
-    auto command = makeInterest(commandName);
-    m_keyChain.sign(*command);
+    Interest req = makeControlCommandRequest("/localhost/nfd/faces/destroy", params);
 
     bool hasCallbackFired = false;
     signal::ScopedConnection connection = this->node1.face.onSendData.connect(
-      [this, command, &hasCallbackFired] (const Data& response) {
-        if (!command->getName().isPrefixOf(response.getName())) {
+      [this, req, &hasCallbackFired] (const Data& response) {
+        if (!req.getName().isPrefixOf(response.getName())) {
           return;
         }
 
@@ -175,7 +166,7 @@
         hasCallbackFired = true;
       });
 
-    this->node1.face.receive(*command);
+    this->node1.face.receive(req);
     this->advanceClocks(time::milliseconds(1), 5);
 
     BOOST_CHECK(hasCallbackFired);
diff --git a/tests/daemon/mgmt/face-manager.t.cpp b/tests/daemon/mgmt/face-manager.t.cpp
index 41dcb90..52e2a11 100644
--- a/tests/daemon/mgmt/face-manager.t.cpp
+++ b/tests/daemon/mgmt/face-manager.t.cpp
@@ -125,14 +125,13 @@
   auto addedFace = addFace(REMOVE_LAST_NOTIFICATION | SET_SCOPE_LOCAL); // clear notification for creation
 
   auto parameters = ControlParameters().setFaceId(addedFace->getId());
-  auto command = makeControlCommandRequest("/localhost/nfd/faces/destroy", parameters);
-
-  receiveInterest(command);
+  auto req = makeControlCommandRequest("/localhost/nfd/faces/destroy", parameters);
+  receiveInterest(req);
 
   BOOST_REQUIRE_EQUAL(m_responses.size(), 2); // one response and one notification
   // notification is already tested, so ignore it
 
-  BOOST_CHECK_EQUAL(checkResponse(1, command->getName(), makeResponse(200, "OK", parameters)),
+  BOOST_CHECK_EQUAL(checkResponse(1, req.getName(), makeResponse(200, "OK", parameters)),
                     CheckResponseResult::OK);
 
   BOOST_CHECK_EQUAL(addedFace->getId(), face::INVALID_FACEID);
@@ -141,13 +140,11 @@
 BOOST_AUTO_TEST_CASE(NonExisting)
 {
   auto parameters = ControlParameters().setFaceId(65535);
-  auto command = makeControlCommandRequest("/localhost/nfd/faces/destroy", parameters);
-
-  receiveInterest(command);
+  auto req = makeControlCommandRequest("/localhost/nfd/faces/destroy", parameters);
+  receiveInterest(req);
 
   BOOST_REQUIRE_EQUAL(m_responses.size(), 1);
-
-  BOOST_CHECK_EQUAL(checkResponse(0, command->getName(), makeResponse(200, "OK", parameters)),
+  BOOST_CHECK_EQUAL(checkResponse(0, req.getName(), makeResponse(200, "OK", parameters)),
                     CheckResponseResult::OK);
 }
 
@@ -162,7 +159,7 @@
     addFace(REMOVE_LAST_NOTIFICATION | SET_URI_TEST | RANDOMIZE_COUNTERS);
   }
 
-  receiveInterest(makeInterest("/localhost/nfd/faces/list"));
+  receiveInterest(Interest("/localhost/nfd/faces/list"));
 
   Block content;
   BOOST_CHECK_NO_THROW(content = concatenateResponses());
@@ -202,10 +199,10 @@
   auto invalidQueryName =
     Name("/localhost/nfd/faces/query").append(ndn::makeStringBlock(tlv::Content, "invalid"));
 
-  receiveInterest(makeInterest(querySchemeName)); // face1 and face2 expected
-  receiveInterest(makeInterest(queryIdName)); // face1 expected
-  receiveInterest(makeInterest(queryScopeName)); // face1 and face3 expected
-  receiveInterest(makeInterest(invalidQueryName)); // nack expected
+  receiveInterest(Interest(querySchemeName)); // face1 and face2 expected
+  receiveInterest(Interest(queryIdName)); // face1 expected
+  receiveInterest(Interest(queryScopeName)); // face1 and face3 expected
+  receiveInterest(Interest(invalidQueryName)); // nack expected
 
   BOOST_REQUIRE_EQUAL(m_responses.size(), 4);
 
@@ -311,7 +308,7 @@
     addedChannels[channel->getUri().toString()] = channel;
   }
 
-  receiveInterest(makeInterest("/localhost/nfd/faces/channels"));
+  receiveInterest(Interest("/localhost/nfd/faces/channels"));
 
   Block content;
   BOOST_CHECK_NO_THROW(content = concatenateResponses());
diff --git a/tests/daemon/mgmt/fib-manager.t.cpp b/tests/daemon/mgmt/fib-manager.t.cpp
index 6fc59d1..7c86e28 100644
--- a/tests/daemon/mgmt/fib-manager.t.cpp
+++ b/tests/daemon/mgmt/fib-manager.t.cpp
@@ -158,13 +158,13 @@
 
 BOOST_AUTO_TEST_CASE(UnknownFaceId)
 {
-  auto command = makeControlCommandRequest("/localhost/nfd/fib/add-nexthop",
-                                           makeParameters("hello", face::FACEID_NULL, 101));
-  receiveInterest(command);
+  auto req = makeControlCommandRequest("/localhost/nfd/fib/add-nexthop",
+                                       makeParameters("hello", face::FACEID_NULL, 101));
+  receiveInterest(req);
   BOOST_REQUIRE_EQUAL(m_responses.size(), 1);
 
   // check response
-  BOOST_CHECK_EQUAL(checkResponse(0, command->getName(), ControlResponse(410, "Face not found")),
+  BOOST_CHECK_EQUAL(checkResponse(0, req.getName(), ControlResponse(410, "Face not found")),
                     CheckResponseResult::OK);
 
   // double check that the next hop was not added
@@ -181,14 +181,12 @@
   Name expectedName;
   ControlResponse expectedResponse;
   auto testAddNextHop = [&] (ControlParameters parameters, const FaceId& faceId) {
-    auto command = makeControlCommandRequest("/localhost/nfd/fib/add-nexthop", parameters,
-                   [&faceId] (shared_ptr<Interest> interest) {
-                     interest->setTag(make_shared<lp::IncomingFaceIdTag>(faceId));
-                   });
+    auto req = makeControlCommandRequest("/localhost/nfd/fib/add-nexthop", parameters);
+    req.setTag(make_shared<lp::IncomingFaceIdTag>(faceId));
     m_responses.clear();
-    expectedName = command->getName();
+    expectedName = req.getName();
     expectedResponse = makeResponse(200, "Success", parameters.setFaceId(faceId));
-    receiveInterest(command);
+    receiveInterest(req);
   };
 
   testAddNextHop(ControlParameters().setName("/hello").setCost(100).setFaceId(0), face1);
@@ -208,11 +206,11 @@
   BOOST_REQUIRE_NE(addedFaceId, face::INVALID_FACEID);
 
   auto parameters = makeParameters("hello", addedFaceId, 101);
-  auto command = makeControlCommandRequest("/localhost/nfd/fib/add-nexthop", parameters);
+  auto req = makeControlCommandRequest("/localhost/nfd/fib/add-nexthop", parameters);
+  receiveInterest(req);
 
-  receiveInterest(command);
   BOOST_REQUIRE_EQUAL(m_responses.size(), 1);
-  BOOST_CHECK_EQUAL(checkResponse(0, command->getName(), makeResponse(200, "Success", parameters)),
+  BOOST_CHECK_EQUAL(checkResponse(0, req.getName(), makeResponse(200, "Success", parameters)),
                     CheckResponseResult::OK);
   BOOST_CHECK_EQUAL(checkNextHop("/hello", 1, addedFaceId, 101), CheckNextHopResult::OK);
 }
@@ -224,11 +222,11 @@
 
   auto originalParameters = ControlParameters().setName("/hello").setFaceId(addedFaceId);
   auto parameters = makeParameters("/hello", addedFaceId, 0);
-  auto command = makeControlCommandRequest("/localhost/nfd/fib/add-nexthop", originalParameters);
+  auto req = makeControlCommandRequest("/localhost/nfd/fib/add-nexthop", originalParameters);
+  receiveInterest(req);
 
-  receiveInterest(command);
   BOOST_REQUIRE_EQUAL(m_responses.size(), 1);
-  BOOST_CHECK_EQUAL(checkResponse(0, command->getName(), makeResponse(200, "Success", parameters)),
+  BOOST_CHECK_EQUAL(checkResponse(0, req.getName(), makeResponse(200, "Success", parameters)),
                     CheckResponseResult::OK);
   BOOST_CHECK_EQUAL(checkNextHop("/hello", 1, addedFaceId, 0), CheckNextHopResult::OK);
 }
@@ -242,10 +240,10 @@
   ControlResponse expectedResponse;
   auto testAddNextHop = [&] (const ControlParameters& parameters) {
     m_responses.clear();
-    auto command = makeControlCommandRequest("/localhost/nfd/fib/add-nexthop", parameters);
-    expectedName = command->getName();
+    auto req = makeControlCommandRequest("/localhost/nfd/fib/add-nexthop", parameters);
+    expectedName = req.getName();
     expectedResponse = makeResponse(200, "Success", parameters);
-    receiveInterest(command);
+    receiveInterest(req);
   };
 
   // add initial, succeeds
@@ -273,10 +271,10 @@
   ControlResponse expectedResponse;
   auto testRemoveNextHop = [&] (const ControlParameters& parameters) {
     m_responses.clear();
-    auto command = makeControlCommandRequest("/localhost/nfd/fib/remove-nexthop", parameters);
-    expectedName = command->getName();
+    auto req = makeControlCommandRequest("/localhost/nfd/fib/remove-nexthop", parameters);
+    expectedName = req.getName();
     expectedResponse = makeResponse(200, "Success", parameters);
-    receiveInterest(command);
+    receiveInterest(req);
   };
 
   FaceId face1 = addFace();
@@ -313,12 +311,12 @@
   BOOST_REQUIRE_NE(addedFaceId, face::INVALID_FACEID);
 
   auto parameters = makeParameters("hello", addedFaceId);
-  auto command = makeControlCommandRequest("/localhost/nfd/fib/remove-nexthop", parameters);
-  auto response = makeResponse(200, "Success", parameters);
-
-  receiveInterest(command);
+  auto req = makeControlCommandRequest("/localhost/nfd/fib/remove-nexthop", parameters);
+  receiveInterest(req);
   BOOST_REQUIRE_EQUAL(m_responses.size(), 1);
-  BOOST_CHECK_EQUAL(checkResponse(0, command->getName(), response), CheckResponseResult::OK);
+
+  auto expectedResponse = makeResponse(200, "Success", parameters);
+  BOOST_CHECK_EQUAL(checkResponse(0, req.getName(), expectedResponse), CheckResponseResult::OK);
 }
 
 BOOST_AUTO_TEST_CASE(ImplicitFaceId)
@@ -332,13 +330,11 @@
   ControlResponse expectedResponse;
   auto testWithImplicitFaceId = [&] (ControlParameters parameters, FaceId face) {
     m_responses.clear();
-    auto command = makeControlCommandRequest("/localhost/nfd/fib/remove-nexthop", parameters,
-                   [face] (shared_ptr<Interest> interest) {
-                     interest->setTag(make_shared<lp::IncomingFaceIdTag>(face));
-                   });
-    expectedName = command->getName();
+    auto req = makeControlCommandRequest("/localhost/nfd/fib/remove-nexthop", parameters);
+    req.setTag(make_shared<lp::IncomingFaceIdTag>(face));
+    expectedName = req.getName();
     expectedResponse = makeResponse(200, "Success", parameters.setFaceId(face));
-    receiveInterest(command);
+    receiveInterest(req);
   };
 
   fib::Entry* entry = m_fib.insert("/hello").first;
@@ -367,10 +363,10 @@
   ControlResponse expectedResponse;
   auto testRemoveNextHop = [&] (ControlParameters parameters) {
     m_responses.clear();
-    auto command = makeControlCommandRequest("/localhost/nfd/fib/remove-nexthop", parameters);
-    expectedName = command->getName();
+    auto req = makeControlCommandRequest("/localhost/nfd/fib/remove-nexthop", parameters);
+    expectedName = req.getName();
     expectedResponse = makeResponse(200, "Success", parameters);
-    receiveInterest(command);
+    receiveInterest(req);
   };
 
   m_fib.insert("/hello").first->addNextHop(*m_faceTable.get(face1), 101);
@@ -402,7 +398,7 @@
     fibEntry->addNextHop(*m_faceTable.get(addFace()), std::numeric_limits<uint8_t>::max() - 2);
   }
 
-  receiveInterest(makeInterest("/localhost/nfd/fib/list"));
+  receiveInterest(Interest("/localhost/nfd/fib/list"));
 
   Block content = concatenateResponses();
   content.parse();
diff --git a/tests/daemon/mgmt/forwarder-status-manager.t.cpp b/tests/daemon/mgmt/forwarder-status-manager.t.cpp
index b9cade3..3b30b5c 100644
--- a/tests/daemon/mgmt/forwarder-status-manager.t.cpp
+++ b/tests/daemon/mgmt/forwarder-status-manager.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2016,  Regents of the University of California,
+ * Copyright (c) 2014-2017,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -70,9 +70,8 @@
 
   // request
   time::system_clock::TimePoint beforeRequest = time::system_clock::now();
-  auto request = makeInterest("ndn:/localhost/nfd/status/general");
-  request->setMustBeFresh(true);
-  request->setChildSelector(1);
+  Interest request("/localhost/nfd/status/general");
+  request.setMustBeFresh(true).setChildSelector(1);
   this->receiveInterest(request);
   time::system_clock::TimePoint afterRequest = time::system_clock::now();
 
diff --git a/tests/daemon/mgmt/nfd-manager-common-fixture.cpp b/tests/daemon/mgmt/nfd-manager-common-fixture.cpp
index 47a1655..f39e983 100644
--- a/tests/daemon/mgmt/nfd-manager-common-fixture.cpp
+++ b/tests/daemon/mgmt/nfd-manager-common-fixture.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2016,  Regents of the University of California,
+ * Copyright (c) 2014-2017,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -42,7 +42,7 @@
 void
 NfdManagerCommonFixture::setPrivilege(const std::string& privilege)
 {
-  this->saveIdentityCertificate(m_identityName, "ManagerCommonFixture.ndncert");
+  this->saveIdentityCertificate(DEFAULT_COMMAND_SIGNER_IDENTITY, "ManagerCommonFixture.ndncert");
 
   const std::string& config = R"CONFIG(
     authorizations
diff --git a/tests/daemon/mgmt/strategy-choice-manager.t.cpp b/tests/daemon/mgmt/strategy-choice-manager.t.cpp
index 609fc5c..e0933e4 100644
--- a/tests/daemon/mgmt/strategy-choice-manager.t.cpp
+++ b/tests/daemon/mgmt/strategy-choice-manager.t.cpp
@@ -94,7 +94,7 @@
   expectedResp.setCode(200)
               .setText("OK")
               .setBody(expectedParams.wireEncode());
-  BOOST_CHECK_EQUAL(checkResponse(0, req->getName(), expectedResp),
+  BOOST_CHECK_EQUAL(checkResponse(0, req.getName(), expectedResp),
                     CheckResponseResult::OK);
 
   BOOST_CHECK_EQUAL(getInstanceName("/A"), strategyNameP);
@@ -114,7 +114,7 @@
   ControlResponse expectedResp;
   expectedResp.setCode(404)
               .setText("Strategy not registered");
-  BOOST_CHECK_EQUAL(checkResponse(0, req->getName(), expectedResp),
+  BOOST_CHECK_EQUAL(checkResponse(0, req.getName(), expectedResp),
                     CheckResponseResult::OK);
 
   BOOST_CHECK_EQUAL(hasEntry("/A"), false);
@@ -135,7 +135,7 @@
   expectedResp.setCode(200)
               .setText("OK")
               .setBody(expectedParams.wireEncode());
-  BOOST_CHECK_EQUAL(checkResponse(0, req->getName(), expectedResp),
+  BOOST_CHECK_EQUAL(checkResponse(0, req.getName(), expectedResp),
                     CheckResponseResult::OK);
 
   BOOST_CHECK_EQUAL(hasEntry("/A"), false);
@@ -153,7 +153,7 @@
   expectedResp.setCode(200)
               .setText("OK")
               .setBody(expectedParams.wireEncode());
-  BOOST_CHECK_EQUAL(checkResponse(0, req->getName(), expectedResp),
+  BOOST_CHECK_EQUAL(checkResponse(0, req.getName(), expectedResp),
                     CheckResponseResult::OK);
 
   BOOST_CHECK_EQUAL(hasEntry("/A"), false);
@@ -169,7 +169,7 @@
   ControlResponse expectedResp;
   expectedResp.setCode(400)
               .setText("failed in validating parameters");
-  BOOST_CHECK_EQUAL(checkResponse(0, req->getName(), expectedResp),
+  BOOST_CHECK_EQUAL(checkResponse(0, req.getName(), expectedResp),
                     CheckResponseResult::OK);
 
   BOOST_CHECK_EQUAL(hasEntry("/"), true);
@@ -192,7 +192,7 @@
     expected[name] = strategy;
   }
 
-  receiveInterest(makeInterest("/localhost/nfd/strategy-choice/list"));
+  receiveInterest(Interest("/localhost/nfd/strategy-choice/list"));
   Block dataset = concatenateResponses();
   dataset.parse();
   BOOST_CHECK_EQUAL(dataset.elements_size(), expected.size());
diff --git a/tests/manager-common-fixture.cpp b/tests/manager-common-fixture.cpp
index bc04045..bdda72e 100644
--- a/tests/manager-common-fixture.cpp
+++ b/tests/manager-common-fixture.cpp
@@ -29,13 +29,34 @@
 namespace nfd {
 namespace tests {
 
+const Name CommandInterestSignerFixture::DEFAULT_COMMAND_SIGNER_IDENTITY("/CommandInterestSignerFixture-identity");
+
+CommandInterestSignerFixture::CommandInterestSignerFixture()
+  : m_commandInterestSigner(m_keyChain)
+{
+  BOOST_REQUIRE(this->addIdentity(DEFAULT_COMMAND_SIGNER_IDENTITY));
+}
+
+Interest
+CommandInterestSignerFixture::makeCommandInterest(const Name& name, const Name& identity)
+{
+  return m_commandInterestSigner.makeCommandInterest(name, ndn::security::signingByIdentity(identity));
+}
+
+Interest
+CommandInterestSignerFixture::makeControlCommandRequest(Name commandName,
+                                                        const ControlParameters& params,
+                                                        const Name& identity)
+{
+  commandName.append(params.wireEncode());
+  return this->makeCommandInterest(commandName, identity);
+}
+
 ManagerCommonFixture::ManagerCommonFixture()
   : m_face(getGlobalIoService(), m_keyChain, {true, true})
   , m_dispatcher(m_face, m_keyChain, ndn::security::SigningInfo())
   , m_responses(m_face.sentData)
-  , m_identityName("/unit-test/ManagerCommonFixture/identity")
 {
-  BOOST_REQUIRE(this->addIdentity(m_identityName));
 }
 
 void
@@ -45,25 +66,10 @@
   advanceClocks(time::milliseconds(1));
 }
 
-shared_ptr<Interest>
-ManagerCommonFixture::makeControlCommandRequest(Name commandName,
-                                                const ControlParameters& parameters,
-                                                const InterestHandler& beforeSigning)
-{
-  shared_ptr<Interest> command = makeInterest(commandName.append(parameters.wireEncode()));
-
-  if (beforeSigning != nullptr) {
-    beforeSigning(command);
-  }
-
-  m_keyChain.sign(*command, ndn::security::signingByIdentity(m_identityName));
-  return command;
-}
-
 void
-ManagerCommonFixture::receiveInterest(shared_ptr<Interest> interest)
+ManagerCommonFixture::receiveInterest(const Interest& interest)
 {
-  m_face.receive(*interest);
+  m_face.receive(interest);
   advanceClocks(time::milliseconds(1));
 }
 
@@ -146,7 +152,7 @@
     Name prefix = name.getPrefix(-1);
     uint64_t segmentNo = name.at(-1).toSegment() + 1;
     // request for the next segment
-    receiveInterest(makeInterest(prefix.appendSegment(segmentNo)));
+    receiveInterest(Interest(prefix.appendSegment(segmentNo)));
   }
 
   size_t endIndex = startIndex + nResponses; // not included
@@ -166,41 +172,29 @@
 }
 
 std::ostream&
-operator<<(std::ostream &os, const ManagerCommonFixture::CheckResponseResult& result)
+operator<<(std::ostream& os, const ManagerCommonFixture::CheckResponseResult& result)
 {
   switch (result) {
-  case ManagerCommonFixture::CheckResponseResult::OK:
-    os << "OK";
-    break;
-  case ManagerCommonFixture::CheckResponseResult::OUT_OF_BOUNDARY:
-    os << "OUT_OF_BOUNDARY";
-    break;
-  case ManagerCommonFixture::CheckResponseResult::WRONG_NAME:
-    os << "WRONG_NAME";
-    break;
-  case ManagerCommonFixture::CheckResponseResult::WRONG_CONTENT_TYPE:
-    os << "WRONG_CONTENT_TYPE";
-    break;
-  case ManagerCommonFixture::CheckResponseResult::INVALID_RESPONSE:
-    os << "INVALID_RESPONSE";
-    break;
-  case ManagerCommonFixture::CheckResponseResult::WRONG_CODE:
-    os << "WRONG_CODE";
-    break;
-  case ManagerCommonFixture::CheckResponseResult::WRONG_TEXT:
-    os << "WRONG_TEXT";
-    break;
-  case ManagerCommonFixture::CheckResponseResult::WRONG_BODY_SIZE:
-    os << "WRONG_BODY_SIZE";
-    break;
-  case ManagerCommonFixture::CheckResponseResult::WRONG_BODY_VALUE:
-    os << "WRONG_BODY_VALUE";
-    break;
-  default:
-    break;
-  };
-
-  return os;
+    case ManagerCommonFixture::CheckResponseResult::OK:
+      return os << "OK";
+    case ManagerCommonFixture::CheckResponseResult::OUT_OF_BOUNDARY:
+      return os << "OUT_OF_BOUNDARY";
+    case ManagerCommonFixture::CheckResponseResult::WRONG_NAME:
+      return os << "WRONG_NAME";
+    case ManagerCommonFixture::CheckResponseResult::WRONG_CONTENT_TYPE:
+      return os << "WRONG_CONTENT_TYPE";
+    case ManagerCommonFixture::CheckResponseResult::INVALID_RESPONSE:
+      return os << "INVALID_RESPONSE";
+    case ManagerCommonFixture::CheckResponseResult::WRONG_CODE:
+      return os << "WRONG_CODE";
+    case ManagerCommonFixture::CheckResponseResult::WRONG_TEXT:
+      return os << "WRONG_TEXT";
+    case ManagerCommonFixture::CheckResponseResult::WRONG_BODY_SIZE:
+      return os << "WRONG_BODY_SIZE";
+    case ManagerCommonFixture::CheckResponseResult::WRONG_BODY_VALUE:
+      return os << "WRONG_BODY_VALUE";
+  }
+  return os << static_cast<int>(result);
 }
 
 } // namespace tests
diff --git a/tests/manager-common-fixture.hpp b/tests/manager-common-fixture.hpp
index b829476..186a5db 100644
--- a/tests/manager-common-fixture.hpp
+++ b/tests/manager-common-fixture.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2016,  Regents of the University of California,
+ * Copyright (c) 2014-2017,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -31,15 +31,48 @@
 #include "core/manager-base.hpp"
 
 #include <ndn-cxx/mgmt/dispatcher.hpp>
+#include <ndn-cxx/security/command-interest-signer.hpp>
 #include <ndn-cxx/util/dummy-client-face.hpp>
 
 namespace nfd {
 namespace tests {
 
+/** \brief a fixture that provides a CommandInterestSigner
+ */
+class CommandInterestSignerFixture : public IdentityManagementTimeFixture
+{
+protected:
+  CommandInterestSignerFixture();
+
+  /** \brief sign a command Interest
+   *  \param name command name include prefix and parameters
+   *  \param identity signing identity
+   *  \return a command Interest
+   */
+  Interest
+  makeCommandInterest(const Name& name, const Name& identity = DEFAULT_COMMAND_SIGNER_IDENTITY);
+
+  /** \brief create a ControlCommand request
+   *  \param commandName command name including prefix, such as "/localhost/nfd/fib/add-nexthop"
+   *  \param params command parameters
+   *  \param identity signing identity
+   *  \return a command Interest
+   */
+  Interest
+  makeControlCommandRequest(Name commandName, const ControlParameters& params,
+                            const Name& identity = DEFAULT_COMMAND_SIGNER_IDENTITY);
+
+protected:
+  static const Name DEFAULT_COMMAND_SIGNER_IDENTITY;
+
+private:
+  ndn::security::CommandInterestSigner m_commandInterestSigner;
+};
+
 /**
  * @brief a collection of common functions shared by all manager's testing fixtures.
  */
-class ManagerCommonFixture : public IdentityManagementTimeFixture
+class ManagerCommonFixture : public CommandInterestSignerFixture
 {
 public: // initialize
   ManagerCommonFixture();
@@ -55,26 +88,6 @@
   setTopPrefix(const Name& topPrefix);
 
 public: // test
-  typedef std::function<void(shared_ptr<Interest> interest)> InterestHandler;
-
-  /**
-   * @brief create a ControlCommand request
-   *
-   * step1: append the @param parameters to the @param commandName and make an Interest.
-   * step2: call @param beforeSinging to do something with the Interest.
-   * step3: sign the generated command
-   *
-   * @param commandName the command name
-   * @param parameters the ControlParameters
-   * @param beforeSigning a callback that can modify the Interest before it's signed
-   *
-   * @return the signed ControlCommand request
-   */
-  shared_ptr<Interest>
-  makeControlCommandRequest(Name commandName,
-                            const ControlParameters& parameters,
-                            const InterestHandler& beforeSigning = nullptr);
-
   /**
    * @brief cause management to receive an Interest
    *
@@ -84,7 +97,7 @@
    * @param interest the Interest to receive
    */
   void
-  receiveInterest(shared_ptr<Interest> interest);
+  receiveInterest(const Interest& interest);
 
 public: // verify
   ControlResponse
@@ -145,11 +158,10 @@
   ndn::util::DummyClientFace m_face;
   ndn::mgmt::Dispatcher m_dispatcher;
   std::vector<Data>& m_responses; ///< a reference of m_face->sentData
-  Name m_identityName; ///< the identity to sign requests
 };
 
 std::ostream&
-operator<<(std::ostream &os, const ManagerCommonFixture::CheckResponseResult& result);
+operator<<(std::ostream& os, const ManagerCommonFixture::CheckResponseResult& result);
 
 } // namespace tests
 } // namespace nfd
diff --git a/tests/rib/rib-manager.t.cpp b/tests/rib/rib-manager.t.cpp
index 42e8c93..7ef0194 100644
--- a/tests/rib/rib-manager.t.cpp
+++ b/tests/rib/rib-manager.t.cpp
@@ -338,10 +338,10 @@
   auto expectedLocalhopResponse = this->m_status.isLocalhopConfigured ? successResp : failureResp;
 
   BOOST_REQUIRE_EQUAL(this->m_responses.size(), nExpectedResponses);
-  BOOST_CHECK_EQUAL(this->checkResponse(0, commandHost->getName(), expectedLocalhostResponse),
+  BOOST_CHECK_EQUAL(this->checkResponse(0, commandHost.getName(), expectedLocalhostResponse),
                     ManagerCommonFixture::CheckResponseResult::OK);
   if (nExpectedResponses == 2) {
-    BOOST_CHECK_EQUAL(this->checkResponse(1, commandHop->getName(), expectedLocalhopResponse),
+    BOOST_CHECK_EQUAL(this->checkResponse(1, commandHop.getName(), expectedLocalhopResponse),
                       ManagerCommonFixture::CheckResponseResult::OK);
   }
 }
@@ -353,20 +353,18 @@
   auto paramsRegister    = makeRegisterParameters("/test-register-unregister", 9527);
   auto paramsUnregister  = makeUnregisterParameters("/test-register-unregister", 9527);
 
-  auto setInFaceId = [] (shared_ptr<Interest> commandInterest) {
-    commandInterest->setTag(make_shared<lp::IncomingFaceIdTag>(1234));
-  };
-
-  auto commandRegister   = makeControlCommandRequest("/localhost/nfd/rib/register", paramsRegister, setInFaceId);
-  auto commandUnregister = makeControlCommandRequest("/localhost/nfd/rib/unregister", paramsUnregister, setInFaceId);
+  auto commandRegister = makeControlCommandRequest("/localhost/nfd/rib/register", paramsRegister);
+  commandRegister.setTag(make_shared<lp::IncomingFaceIdTag>(1234));
+  auto commandUnregister = makeControlCommandRequest("/localhost/nfd/rib/unregister", paramsUnregister);
+  commandUnregister.setTag(make_shared<lp::IncomingFaceIdTag>(1234));
 
   receiveInterest(commandRegister);
   receiveInterest(commandUnregister);
 
   BOOST_REQUIRE_EQUAL(m_responses.size(), 2);
-  BOOST_CHECK_EQUAL(checkResponse(0, commandRegister->getName(), makeResponse(200, "Success", paramsRegister)),
+  BOOST_CHECK_EQUAL(checkResponse(0, commandRegister.getName(), makeResponse(200, "Success", paramsRegister)),
                     CheckResponseResult::OK);
-  BOOST_CHECK_EQUAL(checkResponse(1, commandUnregister->getName(), makeResponse(200, "Success", paramsUnregister)),
+  BOOST_CHECK_EQUAL(checkResponse(1, commandUnregister.getName(), makeResponse(200, "Success", paramsUnregister)),
                     CheckResponseResult::OK);
 
   BOOST_REQUIRE_EQUAL(m_commands.size(), 2);
@@ -382,11 +380,10 @@
   BOOST_CHECK_EQUAL(paramsUnregister.getFaceId(), 0);
 
   const uint64_t inFaceId = 9527;
-  auto setInFaceId = [&inFaceId] (shared_ptr<Interest> commandInterest) {
-    commandInterest->setTag(make_shared<lp::IncomingFaceIdTag>(inFaceId));
-  };
-  auto commandRegister   = makeControlCommandRequest("/localhost/nfd/rib/register", paramsRegister, setInFaceId);
-  auto commandUnregister = makeControlCommandRequest("/localhost/nfd/rib/unregister", paramsUnregister, setInFaceId);
+  auto commandRegister = makeControlCommandRequest("/localhost/nfd/rib/register", paramsRegister);
+  commandRegister.setTag(make_shared<lp::IncomingFaceIdTag>(inFaceId));
+  auto commandUnregister = makeControlCommandRequest("/localhost/nfd/rib/unregister", paramsUnregister);
+  commandUnregister.setTag(make_shared<lp::IncomingFaceIdTag>(inFaceId));
 
   receiveInterest(commandRegister);
   receiveInterest(commandUnregister);
@@ -395,9 +392,9 @@
   paramsUnregister.setFaceId(inFaceId);
 
   BOOST_REQUIRE_EQUAL(m_responses.size(), 2);
-  BOOST_CHECK_EQUAL(checkResponse(0, commandRegister->getName(), makeResponse(200, "Success", paramsRegister)),
+  BOOST_CHECK_EQUAL(checkResponse(0, commandRegister.getName(), makeResponse(200, "Success", paramsRegister)),
                     CheckResponseResult::OK);
-  BOOST_CHECK_EQUAL(checkResponse(1, commandUnregister->getName(), makeResponse(200, "Success", paramsUnregister)),
+  BOOST_CHECK_EQUAL(checkResponse(1, commandUnregister.getName(), makeResponse(200, "Success", paramsUnregister)),
                     CheckResponseResult::OK);
 
   BOOST_REQUIRE_EQUAL(m_commands.size(), 2);
@@ -450,7 +447,7 @@
     }
   }
 
-  receiveInterest(makeInterest("/localhost/nfd/rib/list"));
+  receiveInterest(Interest("/localhost/nfd/rib/list"));
 
   Block content = concatenateResponses();
   content.parse();
