diff --git a/tests/tools/nfdc/face-module.t.cpp b/tests/tools/nfdc/face-module.t.cpp
index 0c9d074..20d5514 100644
--- a/tests/tools/nfdc/face-module.t.cpp
+++ b/tests/tools/nfdc/face-module.t.cpp
@@ -24,6 +24,7 @@
  */
 
 #include "nfdc/face-module.hpp"
+#include <ndn-cxx/mgmt/nfd/face-query-filter.hpp>
 
 #include "execute-command-fixture.hpp"
 #include "status-fixture.hpp"
@@ -33,13 +34,13 @@
 namespace nfdc {
 namespace tests {
 
+using ndn::nfd::FaceQueryFilter;
+
 BOOST_AUTO_TEST_SUITE(Nfdc)
 BOOST_AUTO_TEST_SUITE(TestFaceModule)
 
 BOOST_FIXTURE_TEST_SUITE(ShowCommand, ExecuteCommandFixture)
 
-using ndn::nfd::FaceQueryFilter;
-
 const std::string NORMAL_OUTPUT = std::string(R"TEXT(
   faceid=256
   remote=udp4://84.67.35.111:6363
@@ -105,6 +106,42 @@
 
 BOOST_AUTO_TEST_SUITE_END() // ShowCommand
 
+BOOST_FIXTURE_TEST_SUITE(CreateCommand, ExecuteCommandFixture)
+
+BOOST_AUTO_TEST_CASE(Normal)
+{
+  this->processInterest = [this] (const Interest& interest) {
+    ControlParameters req = MOCK_NFD_MGMT_REQUIRE_LAST_COMMAND_IS("/localhost/nfd/faces/create");
+    BOOST_REQUIRE(req.hasUri());
+    BOOST_CHECK_EQUAL(req.getUri(), "udp4://159.242.33.78:6363");
+    BOOST_REQUIRE(req.hasFacePersistency());
+    BOOST_CHECK_EQUAL(req.getFacePersistency(), FacePersistency::FACE_PERSISTENCY_PERSISTENT);
+
+    ControlParameters resp;
+    resp.setFaceId(2130)
+        .setUri("udp4://159.242.33.78:6363")
+        .setFacePersistency(FacePersistency::FACE_PERSISTENCY_PERSISTENT);
+    this->succeedCommand(resp);
+  };
+
+  this->execute("face create udp://159.242.33.78");
+  BOOST_CHECK_EQUAL(exitCode, 0);
+  BOOST_CHECK(out.is_equal("face-created id=2130 remote=udp4://159.242.33.78:6363 persistency=persistent\n"));
+  BOOST_CHECK(err.is_empty());
+}
+
+BOOST_AUTO_TEST_CASE(Error)
+{
+  this->processInterest = nullptr; // no response
+
+  this->execute("face create udp://159.242.33.78");
+  BOOST_CHECK_EQUAL(exitCode, 1);
+  BOOST_CHECK(out.is_empty());
+  BOOST_CHECK(err.is_equal("Error 10060 when creating face: request timed out\n"));
+}
+
+BOOST_AUTO_TEST_SUITE_END() // CreateCommand
+
 const std::string STATUS_XML = stripXmlSpaces(R"XML(
   <faces>
     <face>
diff --git a/tests/tools/nfdc/mock-nfd-mgmt-fixture.hpp b/tests/tools/nfdc/mock-nfd-mgmt-fixture.hpp
index a1dd694..4d55849 100644
--- a/tests/tools/nfdc/mock-nfd-mgmt-fixture.hpp
+++ b/tests/tools/nfdc/mock-nfd-mgmt-fixture.hpp
@@ -37,6 +37,7 @@
 namespace tests {
 
 using namespace nfd::tests;
+using ndn::nfd::ControlParameters;
 
 /** \brief fixture to emulate NFD management
  */
@@ -56,7 +57,43 @@
     });
   }
 
-protected: // status fetching
+protected: // ControlCommand
+  /** \brief check the last Interest is a command with specified prefix
+   *  \retval nullopt last Interest is not the expected command
+   *  \return command parameters
+   */
+  ndn::optional<ControlParameters>
+  getCommand(const Name& expectedPrefix)
+  {
+    if (face.sentInterests.empty() ||
+        !expectedPrefix.isPrefixOf(face.sentInterests.back().getName())) {
+      return ndn::nullopt;
+    }
+    return ControlParameters(face.sentInterests.back().getName()
+                             .at(expectedPrefix.size()).blockFromValue());
+  }
+
+  /** \brief respond to the last command
+   *  \pre last Interest is a command
+   */
+  void
+  succeedCommand(const ControlParameters& parameters)
+  {
+    ndn::nfd::ControlResponse resp(200, "OK");
+    resp.setBody(parameters.wireEncode());
+    this->sendCommandReply(resp);
+  }
+
+  /** \brief respond to the last command
+   *  \pre last Interest is a command
+   */
+  void
+  failCommand(uint32_t code, const std::string& text)
+  {
+    this->sendCommandReply({code, text});
+  }
+
+protected: // StatusDataset
   /** \brief send an empty dataset in reply to StatusDataset request
    *  \param prefix dataset prefix without version and segment
    *  \pre Interest for dataset has been expressed, sendDataset has not been invoked
@@ -114,6 +151,14 @@
     this->advanceClocks(time::milliseconds(100), timeout);
   }
 
+  void
+  sendCommandReply(const ndn::nfd::ControlResponse& resp)
+  {
+    auto data = makeData(face.sentInterests.back().getName());
+    data->setContent(resp.wireEncode());
+    face.receive(*data);
+  }
+
   /** \brief send a payload in reply to StatusDataset request
    *  \param name dataset prefix without version and segment
    *  \param contentArgs passed to Data::setContent
@@ -158,4 +203,13 @@
 } // namespace tools
 } // namespace nfd
 
+#define MOCK_NFD_MGMT_REQUIRE_LAST_COMMAND_IS(expectedPrefix) \
+  [this] { \
+    BOOST_REQUIRE_MESSAGE(!face.sentInterests.empty(), "no Interest expressed"); \
+    auto params = this->getCommand(expectedPrefix); \
+    BOOST_REQUIRE_MESSAGE(params, "last Interest " << face.sentInterests.back().getName() << \
+                          " does not match command prefix " << expectedPrefix); \
+    return *params; \
+  } ()
+
 #endif // NFD_TESTS_TOOLS_NFDC_MOCK_NFD_MGMT_FIXTURE_HPP
