diff --git a/tests/daemon/face/packet-datasets.cpp b/tests/daemon/face/packet-datasets.cpp
index cf661db..196fa86 100644
--- a/tests/daemon/face/packet-datasets.cpp
+++ b/tests/daemon/face/packet-datasets.cpp
@@ -46,18 +46,6 @@
         BOOST_CHECK_THROW((Interest(block)), tlv::Error);
       }
   }
-
-  {
-    typedef CorruptedInterestWithLocalControlHeader Dataset;
-    Dataset dataset;
-
-    BOOST_FOREACH(Dataset::Container::value_type& data, dataset.data)
-      {
-        Block block(data.buf(), data.size());
-
-        BOOST_CHECK_THROW(ndn::nfd::LocalControlHeader::getPayload(block), tlv::Error);
-      }
-  }
 }
 
 BOOST_AUTO_TEST_SUITE_END()
diff --git a/tests/daemon/face/packet-datasets.hpp b/tests/daemon/face/packet-datasets.hpp
index 373f4e6..95639c1 100644
--- a/tests/daemon/face/packet-datasets.hpp
+++ b/tests/daemon/face/packet-datasets.hpp
@@ -31,31 +31,6 @@
 namespace nfd {
 namespace tests {
 
-class CorruptedInterestWithLocalControlHeader
-{
-public:
-  typedef std::vector<ndn::Buffer> Container;
-
-  static std::string
-  getName()
-  {
-    return "CorruptedInterestWithLocalControlHeader";
-  }
-
-  CorruptedInterestWithLocalControlHeader()
-  {
-    static const uint8_t interest[] = {
-      0x50, 0x22, 0x51, 0x81, 0x0a, 0x05, 0x1d, 0x07, 0x14, 0x08, 0x05, 0x6c, 0x6f, 0x63, 0x61,
-      0x6c, 0x08, 0x03, 0x6e, 0x64, 0x6e, 0x08, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x09,
-      0x02, 0x12, 0x00, 0x0a, 0x01, 0x01
-    };
-
-    data.push_back(ndn::Buffer(interest, sizeof(interest)));
-  }
-public:
-  Container data;
-};
-
 class CorruptedInterest
 {
 public:
@@ -81,9 +56,7 @@
   Container data;
 };
 
-
-typedef boost::mpl::vector< CorruptedInterestWithLocalControlHeader,
-                            CorruptedInterest> CorruptedPackets;
+typedef boost::mpl::vector<CorruptedInterest> CorruptedPackets;
 
 } // namespace tests
 } // namespace nfd
diff --git a/tests/daemon/face/tcp-transport.t.cpp b/tests/daemon/face/tcp-transport.t.cpp
new file mode 100644
index 0000000..a9d2fe1
--- /dev/null
+++ b/tests/daemon/face/tcp-transport.t.cpp
@@ -0,0 +1,83 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014-2015,  Regents of the University of California,
+ *                           Arizona Board of Regents,
+ *                           Colorado State University,
+ *                           University Pierre & Marie Curie, Sorbonne University,
+ *                           Washington University in St. Louis,
+ *                           Beijing Institute of Technology,
+ *                           The University of Memphis.
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "face/tcp-transport.hpp"
+#include "transport-properties.hpp"
+
+#include "tests/test-common.hpp"
+
+namespace nfd {
+namespace face {
+namespace tests {
+
+using namespace nfd::tests;
+namespace ip = boost::asio::ip;
+using ip::tcp;
+
+BOOST_AUTO_TEST_SUITE(Face)
+BOOST_FIXTURE_TEST_SUITE(TestTcpTransport, BaseFixture)
+
+BOOST_AUTO_TEST_CASE(StaticPropertiesIpv4)
+{
+  tcp::endpoint ep(ip::address_v4::loopback(), 7002);
+  tcp::acceptor acceptor(g_io, ep);
+
+  tcp::socket sock(g_io, tcp::endpoint(ip::address_v4::loopback(), 7001));
+  sock.connect(ep);
+  TcpTransport transport(std::move(sock), ndn::nfd::FACE_PERSISTENCY_PERSISTENT);
+  checkStaticPropertiesInitialized(transport);
+
+  BOOST_CHECK_EQUAL(transport.getLocalUri(), FaceUri("tcp4://127.0.0.1:7001"));
+  BOOST_CHECK_EQUAL(transport.getRemoteUri(), FaceUri("tcp4://127.0.0.1:7002"));
+  BOOST_CHECK_EQUAL(transport.getScope(), ndn::nfd::FACE_SCOPE_LOCAL);
+  BOOST_CHECK_EQUAL(transport.getPersistency(), ndn::nfd::FACE_PERSISTENCY_PERSISTENT);
+  BOOST_CHECK_EQUAL(transport.getLinkType(), ndn::nfd::LINK_TYPE_POINT_TO_POINT);
+  BOOST_CHECK_EQUAL(transport.getMtu(), MTU_UNLIMITED);
+}
+
+BOOST_AUTO_TEST_CASE(StaticPropertiesIpv6)
+{
+  tcp::endpoint ep(ip::address_v6::loopback(), 7002);
+  tcp::acceptor acceptor(g_io, ep);
+
+  tcp::socket sock(g_io, tcp::endpoint(ip::address_v6::loopback(), 7001));
+  sock.connect(ep);
+  TcpTransport transport(std::move(sock), ndn::nfd::FACE_PERSISTENCY_ON_DEMAND);
+  checkStaticPropertiesInitialized(transport);
+
+  BOOST_CHECK_EQUAL(transport.getLocalUri(), FaceUri("tcp6://[::1]:7001"));
+  BOOST_CHECK_EQUAL(transport.getRemoteUri(), FaceUri("tcp6://[::1]:7002"));
+  BOOST_CHECK_EQUAL(transport.getScope(), ndn::nfd::FACE_SCOPE_LOCAL);
+  BOOST_CHECK_EQUAL(transport.getPersistency(), ndn::nfd::FACE_PERSISTENCY_ON_DEMAND);
+  BOOST_CHECK_EQUAL(transport.getLinkType(), ndn::nfd::LINK_TYPE_POINT_TO_POINT);
+  BOOST_CHECK_EQUAL(transport.getMtu(), MTU_UNLIMITED);
+}
+
+BOOST_AUTO_TEST_SUITE_END() // TestTcpTransport
+BOOST_AUTO_TEST_SUITE_END() // Face
+
+} // namespace tests
+} // namespace face
+} // namespace nfd
diff --git a/tests/daemon/face/tcp.t.cpp b/tests/daemon/face/tcp.t.cpp
index bec87e1..cbb3946 100644
--- a/tests/daemon/face/tcp.t.cpp
+++ b/tests/daemon/face/tcp.t.cpp
@@ -24,7 +24,6 @@
  */
 
 #include "face/tcp-channel.hpp"
-#include "face/tcp-face.hpp"
 #include "face/tcp-factory.hpp"
 
 #include "core/network-interface.hpp"
@@ -33,12 +32,13 @@
 #include "dummy-stream-sender.hpp"
 #include "packet-datasets.hpp"
 
-#include <ndn-cxx/security/key-chain.hpp>
-
 namespace nfd {
 namespace tests {
 
-BOOST_FIXTURE_TEST_SUITE(FaceTcp, BaseFixture)
+BOOST_AUTO_TEST_SUITE(Face)
+BOOST_FIXTURE_TEST_SUITE(TestTcp, BaseFixture)
+
+using nfd::Face;
 
 BOOST_AUTO_TEST_CASE(ChannelMap)
 {
@@ -102,14 +102,14 @@
                           "No channels available to connect to 127.0.0.1:6363"));
 
   factory.createChannel("127.0.0.1", "20071");
-  
+
   factory.createFace(FaceUri("tcp4://127.0.0.1:20070"),
                      ndn::nfd::FACE_PERSISTENCY_PERSISTENT,
                      bind([]{}),
                      bind(&FaceCreateFixture::failIfError, this, _1));
 }
 
-BOOST_FIXTURE_TEST_CASE(UnsupportedFaceCreate, FaceCreateFixture)
+BOOST_AUTO_TEST_CASE(UnsupportedFaceCreate)
 {
   TcpFactory factory;
 
@@ -305,11 +305,6 @@
   BOOST_CHECK_EQUAL(face1->isLocal(), true);
   BOOST_CHECK_EQUAL(face2->isLocal(), true);
 
-  BOOST_CHECK_EQUAL(static_cast<bool>(dynamic_pointer_cast<LocalFace>(face1)), true);
-  BOOST_CHECK_EQUAL(static_cast<bool>(dynamic_pointer_cast<LocalFace>(face2)), true);
-
-  // integrated tests needs to check that TcpFace for non-loopback fails these tests...
-
   shared_ptr<Interest> interest1 = makeInterest("ndn:/TpnzGvW9R");
   shared_ptr<Data>     data1     = makeData("ndn:/KfczhUqVix");
   shared_ptr<Interest> interest2 = makeInterest("ndn:/QWiIMfj5sL");
@@ -388,11 +383,6 @@
   BOOST_CHECK_EQUAL(face1->isLocal(), true);
   BOOST_CHECK_EQUAL(face2->isLocal(), true);
 
-  BOOST_CHECK_EQUAL(static_cast<bool>(dynamic_pointer_cast<LocalFace>(face1)), true);
-  BOOST_CHECK_EQUAL(static_cast<bool>(dynamic_pointer_cast<LocalFace>(face2)), true);
-
-  // integrated tests needs to check that TcpFace for non-loopback fails these tests...
-
   shared_ptr<Interest> interest1 = makeInterest("ndn:/TpnzGvW9R");
   shared_ptr<Data>     data1     = makeData("ndn:/KfczhUqVix");
   shared_ptr<Interest> interest2 = makeInterest("ndn:/QWiIMfj5sL");
@@ -464,7 +454,6 @@
   BOOST_CHECK_EQUAL(faces.size(), 6);
 }
 
-
 BOOST_FIXTURE_TEST_CASE(FaceClosing, EndToEndFixture)
 {
   TcpFactory factory;
@@ -504,7 +493,6 @@
   BOOST_CHECK_EQUAL(channel2->size(), 0);
 }
 
-
 class SimpleEndToEndFixture : protected BaseFixture
 {
 public:
@@ -515,14 +503,6 @@
     face->onReceiveData.connect(bind(&SimpleEndToEndFixture::onReceiveData, this, _1));
     face->onFail.connect(bind(&SimpleEndToEndFixture::onFail, this, face));
 
-    if (static_cast<bool>(dynamic_pointer_cast<LocalFace>(face))) {
-      static_pointer_cast<LocalFace>(face)->setLocalControlHeaderFeature(
-        LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID);
-
-      static_pointer_cast<LocalFace>(face)->setLocalControlHeaderFeature(
-        LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID);
-    }
-
     limitedIo.afterOp();
   }
 
@@ -563,26 +543,6 @@
   std::vector<Data> receivedDatas;
 };
 
-
-BOOST_FIXTURE_TEST_CASE_TEMPLATE(LocalFaceCorruptedInput, Dataset,
-                                 CorruptedPackets, SimpleEndToEndFixture)
-{
-  TcpFactory factory;
-  tcp::Endpoint endpoint(boost::asio::ip::address_v4::from_string("127.0.0.1"), 20070);
-
-  shared_ptr<TcpChannel> channel = factory.createChannel(endpoint);
-  channel->listen(bind(&SimpleEndToEndFixture::onFaceCreated,   this, _1),
-                  bind(&SimpleEndToEndFixture::onConnectFailed, this, _1));
-  BOOST_REQUIRE_EQUAL(channel->isListening(), true);
-
-  DummyStreamSender<boost::asio::ip::tcp, Dataset> sender;
-  sender.start(endpoint);
-
-  BOOST_CHECK_MESSAGE(limitedIo.run(LimitedIo::UNLIMITED_OPS,
-                                    time::seconds(1)) == LimitedIo::EXCEED_TIME,
-                      "Exception thrown for " + Dataset::getName());
-}
-
 BOOST_FIXTURE_TEST_CASE_TEMPLATE(FaceCorruptedInput, Dataset,
                                  CorruptedPackets, SimpleEndToEndFixture)
 {
@@ -787,7 +747,8 @@
                }));
 }
 
-BOOST_AUTO_TEST_SUITE_END()
+BOOST_AUTO_TEST_SUITE_END() // TestTcp
+BOOST_AUTO_TEST_SUITE_END() // Face
 
 } // namespace tests
 } // namespace nfd
