diff --git a/tests/daemon/face/tcp-channel-fixture.hpp b/tests/daemon/face/tcp-channel-fixture.hpp
index 4f63035..798fedd 100644
--- a/tests/daemon/face/tcp-channel-fixture.hpp
+++ b/tests/daemon/face/tcp-channel-fixture.hpp
@@ -50,7 +50,7 @@
   connect(TcpChannel& channel) final
   {
     g_io.post([&] {
-      channel.connect(listenerEp, false,
+      channel.connect(listenerEp, ndn::nfd::FACE_PERSISTENCY_PERSISTENT, false,
         [this] (const shared_ptr<Face>& newFace) {
           BOOST_REQUIRE(newFace != nullptr);
           connectFaceClosedSignal(*newFace, [this] { limitedIo.afterOp(); });
diff --git a/tests/daemon/face/tcp-channel.t.cpp b/tests/daemon/face/tcp-channel.t.cpp
index 8068364..986d471 100644
--- a/tests/daemon/face/tcp-channel.t.cpp
+++ b/tests/daemon/face/tcp-channel.t.cpp
@@ -46,7 +46,8 @@
   // do not listen
 
   auto channel = this->makeChannel(A());
-  channel->connect(tcp::Endpoint(address, 7040), false,
+  channel->connect(tcp::Endpoint(address, 7040),
+    ndn::nfd::FACE_PERSISTENCY_PERSISTENT, false,
     [this] (const shared_ptr<nfd::Face>&) {
       BOOST_FAIL("Connect succeeded when it should have failed");
       this->limitedIo.afterOp();
diff --git a/tests/daemon/face/tcp-factory.t.cpp b/tests/daemon/face/tcp-factory.t.cpp
index 31e8918..d3f5fc9 100644
--- a/tests/daemon/face/tcp-factory.t.cpp
+++ b/tests/daemon/face/tcp-factory.t.cpp
@@ -185,35 +185,40 @@
              ndn::nfd::FACE_PERSISTENCY_PERSISTENT,
              false,
              {CreateFaceExpectedResult::SUCCESS, 0, ""});
+
+  createFace(factory,
+             FaceUri("tcp4://127.0.0.1:6363"),
+             {},
+             ndn::nfd::FACE_PERSISTENCY_PERMANENT,
+             false,
+             {CreateFaceExpectedResult::SUCCESS, 0, ""});
+
+  createFace(factory,
+             FaceUri("tcp4://127.0.0.1:20072"),
+             {},
+             ndn::nfd::FACE_PERSISTENCY_PERMANENT,
+             false,
+             {CreateFaceExpectedResult::SUCCESS, 0, ""});
 }
 
 BOOST_AUTO_TEST_CASE(UnsupportedFaceCreate)
 {
   TcpFactory factory;
 
-  factory.createChannel("127.0.0.1", "20070");
   factory.createChannel("127.0.0.1", "20071");
   factory.createChannel("127.0.0.1", "20072");
 
   createFace(factory,
-             FaceUri("tcp4://127.0.0.1:20070"),
-             {},
-             ndn::nfd::FACE_PERSISTENCY_PERMANENT,
-             false,
-             {CreateFaceExpectedResult::FAILURE, 406,
-               "Outgoing TCP faces only support persistent persistency"});
-
-  createFace(factory,
              FaceUri("tcp4://127.0.0.1:20071"),
              {},
              ndn::nfd::FACE_PERSISTENCY_ON_DEMAND,
              false,
              {CreateFaceExpectedResult::FAILURE, 406,
-               "Outgoing TCP faces only support persistent persistency"});
+               "Outgoing TCP faces do not support on-demand persistency"});
 
   createFace(factory,
              FaceUri("tcp4://127.0.0.1:20072"),
-             FaceUri("udp4://127.0.0.1:20073"),
+             FaceUri("tcp4://127.0.0.1:20073"),
              ndn::nfd::FACE_PERSISTENCY_PERSISTENT,
              false,
              {CreateFaceExpectedResult::FAILURE, 406,
@@ -227,8 +232,7 @@
   onFaceCreated(const shared_ptr<Face>& newFace)
   {
     BOOST_CHECK_MESSAGE(false, "Timeout expected");
-    BOOST_CHECK(!static_cast<bool>(face1));
-    face1 = newFace;
+    face = newFace;
 
     limitedIo.afterOp();
   }
@@ -243,14 +247,13 @@
 
 public:
   LimitedIo limitedIo;
-
-  shared_ptr<Face> face1;
+  shared_ptr<Face> face;
 };
 
 BOOST_FIXTURE_TEST_CASE(FaceCreateTimeout, FaceCreateTimeoutFixture)
 {
   TcpFactory factory;
-  shared_ptr<TcpChannel> channel = factory.createChannel("0.0.0.0", "20070");
+  factory.createChannel("0.0.0.0", "20070");
 
   factory.createFace(FaceUri("tcp4://192.0.2.1:20070"),
                      {},
@@ -259,10 +262,8 @@
                      bind(&FaceCreateTimeoutFixture::onFaceCreated, this, _1),
                      bind(&FaceCreateTimeoutFixture::onConnectFailed, this, _2));
 
-  BOOST_CHECK_MESSAGE(limitedIo.run(1, time::seconds(10)) == LimitedIo::EXCEED_OPS,
-                      "TcpChannel error: cannot connect or cannot accept connection");
-
-  BOOST_CHECK_EQUAL(static_cast<bool>(face1), false);
+  BOOST_REQUIRE_EQUAL(limitedIo.run(1, time::seconds(10)), LimitedIo::EXCEED_OPS);
+  BOOST_CHECK(face == nullptr);
 }
 
 class FakeNetworkInterfaceFixture : public BaseFixture
diff --git a/tests/daemon/face/udp-factory.t.cpp b/tests/daemon/face/udp-factory.t.cpp
index e658248..3270ad6 100644
--- a/tests/daemon/face/udp-factory.t.cpp
+++ b/tests/daemon/face/udp-factory.t.cpp
@@ -611,14 +611,14 @@
   factory.createChannel("127.0.0.1", "20071");
 
   createFace(factory,
-             FaceUri("udp4://127.0.0.1:20070"),
+             FaceUri("udp4://127.0.0.1:6363"),
              {},
              ndn::nfd::FACE_PERSISTENCY_PERSISTENT,
              false,
              {CreateFaceExpectedResult::SUCCESS, 0, ""});
 
   createFace(factory,
-             FaceUri("udp4://127.0.0.1:20070"),
+             FaceUri("udp4://127.0.0.1:6363"),
              {},
              ndn::nfd::FACE_PERSISTENCY_PERMANENT,
              false,
@@ -636,11 +636,11 @@
 {
   UdpFactory factory;
 
-  factory.createChannel("127.0.0.1", "20070");
   factory.createChannel("127.0.0.1", "20071");
+  factory.createChannel("127.0.0.1", "20072");
 
   createFace(factory,
-             FaceUri("udp4://127.0.0.1:20070"),
+             FaceUri("udp4://127.0.0.1:20071"),
              {},
              ndn::nfd::FACE_PERSISTENCY_ON_DEMAND,
              false,
@@ -648,7 +648,7 @@
                "Outgoing unicast UDP faces do not support on-demand persistency"});
 
   createFace(factory,
-             FaceUri("udp4://127.0.0.1:20071"),
+             FaceUri("udp4://127.0.0.1:20072"),
              FaceUri("udp4://127.0.0.1:20073"),
              ndn::nfd::FACE_PERSISTENCY_PERSISTENT,
              false,
diff --git a/tests/daemon/mgmt/face-manager-create-face.t.cpp b/tests/daemon/mgmt/face-manager-create-face.t.cpp
index 5cfe952..f96e532 100644
--- a/tests/daemon/mgmt/face-manager-create-face.t.cpp
+++ b/tests/daemon/mgmt/face-manager-create-face.t.cpp
@@ -27,8 +27,6 @@
 #include "face-manager-command-fixture.hpp"
 #include "nfd-manager-common-fixture.hpp"
 
-#include <thread>
-
 namespace nfd {
 namespace tests {
 
@@ -40,7 +38,7 @@
 class TcpFaceOnDemand
 {
 public:
-  ControlParameters
+  static ControlParameters
   getParameters()
   {
     return ControlParameters()
@@ -52,7 +50,7 @@
 class TcpFacePersistent
 {
 public:
-  ControlParameters
+  static ControlParameters
   getParameters()
   {
     return ControlParameters()
@@ -64,7 +62,7 @@
 class TcpFacePermanent
 {
 public:
-  ControlParameters
+  static ControlParameters
   getParameters()
   {
     return ControlParameters()
@@ -76,7 +74,7 @@
 class UdpFaceOnDemand
 {
 public:
-  ControlParameters
+  static ControlParameters
   getParameters()
   {
     return ControlParameters()
@@ -88,7 +86,7 @@
 class UdpFacePersistent
 {
 public:
-  ControlParameters
+  static ControlParameters
   getParameters()
   {
     return ControlParameters()
@@ -100,7 +98,7 @@
 class UdpFacePermanent
 {
 public:
-  ControlParameters
+  static ControlParameters
   getParameters()
   {
     return ControlParameters()
@@ -113,7 +111,7 @@
                            // fails because remote endpoint is prohibited
 {
 public:
-  ControlParameters
+  static ControlParameters
   getParameters()
   {
     return ControlParameters()
@@ -124,7 +122,7 @@
 class LocalTcpFaceLocalFieldsEnabled
 {
 public:
-  ControlParameters
+  static ControlParameters
   getParameters()
   {
     return ControlParameters()
@@ -137,7 +135,7 @@
 class LocalTcpFaceLocalFieldsDisabled
 {
 public:
-  ControlParameters
+  static ControlParameters
   getParameters()
   {
     return ControlParameters()
@@ -150,7 +148,7 @@
 class NonLocalUdpFaceLocalFieldsEnabled // won't work because non-local scope
 {
 public:
-  ControlParameters
+  static ControlParameters
   getParameters()
   {
     return ControlParameters()
@@ -163,7 +161,7 @@
 class NonLocalUdpFaceLocalFieldsDisabled
 {
 public:
-  ControlParameters
+  static ControlParameters
   getParameters()
   {
     return ControlParameters()
@@ -176,9 +174,10 @@
 namespace mpl = boost::mpl;
 
 // pairs of CreateCommand and Success/Failure status
-typedef mpl::vector<mpl::pair<TcpFaceOnDemand, CommandFailure<406>>,
+using TestCases = mpl::vector<
+                    mpl::pair<TcpFaceOnDemand, CommandFailure<406>>,
                     mpl::pair<TcpFacePersistent, CommandSuccess>,
-                    mpl::pair<TcpFacePermanent, CommandFailure<406>>,
+                    mpl::pair<TcpFacePermanent, CommandSuccess>,
                     mpl::pair<UdpFaceOnDemand, CommandFailure<406>>,
                     mpl::pair<UdpFacePersistent, CommandSuccess>,
                     mpl::pair<UdpFacePermanent, CommandSuccess>,
@@ -186,16 +185,16 @@
                     mpl::pair<LocalTcpFaceLocalFieldsEnabled, CommandSuccess>,
                     mpl::pair<LocalTcpFaceLocalFieldsDisabled, CommandSuccess>,
                     mpl::pair<NonLocalUdpFaceLocalFieldsEnabled, CommandFailure<406>>,
-                    mpl::pair<NonLocalUdpFaceLocalFieldsDisabled, CommandSuccess>> Faces;
+                    mpl::pair<NonLocalUdpFaceLocalFieldsDisabled, CommandSuccess>>;
 
-BOOST_FIXTURE_TEST_CASE_TEMPLATE(NewFace, T, Faces, FaceManagerCommandFixture)
+BOOST_FIXTURE_TEST_CASE_TEMPLATE(NewFace, T, TestCases, FaceManagerCommandFixture)
 {
-  typedef typename T::first FaceType;
-  typedef typename T::second CreateResult;
+  using FaceType = typename T::first;
+  using CreateResult = typename T::second;
 
   Name commandName("/localhost/nfd/faces");
   commandName.append("create");
-  commandName.append(FaceType().getParameters().wireEncode());
+  commandName.append(FaceType::getParameters().wireEncode());
   auto command = makeInterest(commandName);
   m_keyChain.sign(*command);
 
@@ -206,12 +205,12 @@
     }
 
     ControlResponse actual(response.getContent().blockFromValue());
-    ControlResponse expected(CreateResult().getExpected());
+    ControlResponse expected(CreateResult::getExpected());
     BOOST_TEST_MESSAGE(actual.getText());
     BOOST_CHECK_EQUAL(expected.getCode(), actual.getCode());
 
     if (actual.getBody().hasWire()) {
-      ControlParameters expectedParams(FaceType().getParameters());
+      ControlParameters expectedParams(FaceType::getParameters());
       ControlParameters actualParams(actual.getBody());
 
       BOOST_CHECK(actualParams.hasFaceId());
@@ -234,7 +233,7 @@
 
     if (actual.getCode() != 200) {
       // ensure face not created
-      FaceUri uri(FaceType().getParameters().getUri());
+      FaceUri uri(FaceType::getParameters().getUri());
       auto& faceTable = this->node1.manager.m_faceTable;
       BOOST_CHECK(std::none_of(faceTable.begin(), faceTable.end(), [uri] (Face& face) {
         return face.getRemoteUri() == uri;
@@ -259,7 +258,7 @@
 
     Name commandName("/localhost/nfd/faces");
     commandName.append("create");
-    commandName.append(FaceType().getParameters().wireEncode());
+    commandName.append(FaceType::getParameters().wireEncode());
     auto command = makeInterest(commandName);
     m_keyChain.sign(*command);
 
@@ -268,7 +267,7 @@
   }
 
   // find the created face
-  auto foundFace = this->node1.findFaceByUri(FaceType().getParameters().getUri());
+  auto foundFace = this->node1.findFaceByUri(FaceType::getParameters().getUri());
   BOOST_REQUIRE(foundFace != nullptr);
 
   {
@@ -276,7 +275,7 @@
 
     Name commandName("/localhost/nfd/faces");
     commandName.append("create");
-    commandName.append(FaceType().getParameters().wireEncode());
+    commandName.append(FaceType::getParameters().wireEncode());
     auto command = makeInterest(commandName);
     m_keyChain.sign(*command);
 
