diff --git a/tests/daemon/face/dummy-face.hpp b/tests/daemon/face/dummy-face.hpp
index ca45722..ec0adbf 100644
--- a/tests/daemon/face/dummy-face.hpp
+++ b/tests/daemon/face/dummy-face.hpp
@@ -44,6 +44,11 @@
   {
   }
 
+  DummyFaceImpl(const std::string& remoteUri, const std::string& localUri)
+    : FaceBase(FaceUri(remoteUri), FaceUri(localUri))
+  {
+  }
+
   virtual void
   sendInterest(const Interest& interest)
   {
diff --git a/tests/daemon/mgmt/face-manager.cpp b/tests/daemon/mgmt/face-manager.cpp
index aa1bf32..70d8d83 100644
--- a/tests/daemon/mgmt/face-manager.cpp
+++ b/tests/daemon/mgmt/face-manager.cpp
@@ -41,6 +41,7 @@
 #include "tests/test-common.hpp"
 #include "validation-common.hpp"
 #include "face-status-publisher-common.hpp"
+#include "face-query-status-publisher-common.hpp"
 #include "channel-status-common.hpp"
 
 #include <ndn-cxx/encoding/tlv.hpp>
@@ -1778,6 +1779,75 @@
   BOOST_REQUIRE(m_callbackFired);
 }
 
+class FaceQueryListFixture : public FaceQueryStatusPublisherFixture
+{
+public:
+  FaceQueryListFixture()
+    : m_manager(m_table, m_face, m_testKeyChain)
+  {
+
+  }
+
+  virtual
+  ~FaceQueryListFixture()
+  {
+
+  }
+
+protected:
+  FaceManager m_manager;
+  ndn::KeyChain m_testKeyChain;
+};
+
+BOOST_FIXTURE_TEST_CASE(TestValidQueryFilter, FaceQueryListFixture)
+{
+  Name queryName("/localhost/nfd/faces/query");
+  ndn::nfd::FaceQueryFilter queryFilter;
+  queryFilter.setUriScheme("dummy");
+  queryName.append(queryFilter.wireEncode());
+
+  shared_ptr<Interest> query(make_shared<Interest>(queryName));
+
+  // add expected faces
+  shared_ptr<DummyLocalFace> expectedFace1(make_shared<DummyLocalFace>());
+  m_referenceFaces.push_back(expectedFace1);
+  add(expectedFace1);
+
+  shared_ptr<DummyFace> expectedFace2(make_shared<DummyFace>());
+  m_referenceFaces.push_back(expectedFace2);
+  add(expectedFace2);
+
+  // add other faces
+  shared_ptr<DummyFace> face1(make_shared<DummyFace>("udp://", "udp://"));
+  add(face1);
+  shared_ptr<DummyLocalFace> face2(make_shared<DummyLocalFace>("tcp://", "tcp://"));
+  add(face2);
+
+  m_face->onReceiveData +=
+    bind(&FaceQueryStatusPublisherFixture::decodeFaceStatusBlock, this, _1);
+
+  m_manager.listQueriedFaces(*query);
+  BOOST_REQUIRE(m_finished);
+}
+
+//BOOST_FIXTURE_TEST_CASE(TestInvalidQueryFilter, FaceQueryListFixture)
+//{
+//  Name queryName("/localhost/nfd/faces/query");
+//  ndn::nfd::FaceStatus queryFilter;
+//  queryName.append(queryFilter.wireEncode());
+//
+//  shared_ptr<Interest> query(make_shared<Interest>(queryName));
+//
+//  shared_ptr<DummyLocalFace> face(make_shared<DummyLocalFace>());
+//  add(face);
+//
+//  m_face->onReceiveData +=
+//    bind(&FaceQueryStatusPublisherFixture::decodeNackBlock, this, _1);
+//
+//  m_manager.listQueriedFaces(*query);
+//  BOOST_REQUIRE(m_finished);
+//}
+
 BOOST_AUTO_TEST_SUITE_END()
 
 } // namespace tests
diff --git a/tests/daemon/mgmt/face-query-status-publisher-common.hpp b/tests/daemon/mgmt/face-query-status-publisher-common.hpp
new file mode 100644
index 0000000..06d562b
--- /dev/null
+++ b/tests/daemon/mgmt/face-query-status-publisher-common.hpp
@@ -0,0 +1,163 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014,  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/>.
+ */
+
+#ifndef NFD_TESTS_NFD_MGMT_FACE_QUERY_STATUS_PUBLISHER_COMMON_HPP
+#define NFD_TESTS_NFD_MGMT_FACE_QUERY_STATUS_PUBLISHER_COMMON_HPP
+
+#include "mgmt/face-query-status-publisher.hpp"
+#include "mgmt/app-face.hpp"
+#include "mgmt/internal-face.hpp"
+#include "fw/forwarder.hpp"
+#include "face/udp-factory.hpp"
+
+#include "tests/test-common.hpp"
+#include "tests/daemon/face/dummy-face.hpp"
+
+#include <ndn-cxx/management/nfd-face-status.hpp>
+
+namespace nfd {
+namespace tests {
+
+class FaceQueryStatusPublisherFixture : public BaseFixture
+{
+public:
+
+  FaceQueryStatusPublisherFixture()
+    : m_table(m_forwarder)
+    , m_face(make_shared<InternalFace>())
+    , m_dummyFace(make_shared<DummyFace>())
+    , m_dummyLocalFace(make_shared<DummyLocalFace>())
+    , m_dummyUri(make_shared<DummyFace>("dummy://remoteUri", "dummy://localUri"))
+    , m_factory(UdpFactory())
+    , m_finished(false)
+  {
+  }
+
+  virtual
+  ~FaceQueryStatusPublisherFixture()
+  {
+  }
+
+  void
+  add(shared_ptr<Face> face)
+  {
+    m_table.add(face);
+  }
+
+  void
+  validateFaceStatus(const Block& statusBlock, const shared_ptr<Face>& reference)
+  {
+    ndn::nfd::FaceStatus status;
+    BOOST_REQUIRE_NO_THROW(status.wireDecode(statusBlock));
+
+    BOOST_CHECK_EQUAL(status.getFaceId(), reference->getId());
+    BOOST_CHECK_EQUAL(status.getRemoteUri(), reference->getRemoteUri().toString());
+    BOOST_CHECK_EQUAL(status.getLocalUri(), reference->getLocalUri().toString());
+
+    if (reference->isLocal()) {
+      BOOST_CHECK_EQUAL(status.getFaceScope(), ndn::nfd::FACE_SCOPE_LOCAL);
+    }
+    else {
+      BOOST_CHECK_EQUAL(status.getFaceScope(), ndn::nfd::FACE_SCOPE_NON_LOCAL);
+    }
+
+    if (reference->isOnDemand()) {
+      BOOST_CHECK_EQUAL(status.getFacePersistency(), ndn::nfd::FACE_PERSISTENCY_ON_DEMAND);
+    }
+    else {
+      BOOST_CHECK_EQUAL(status.getFacePersistency(), ndn::nfd::FACE_PERSISTENCY_PERSISTENT);
+    }
+
+    if (reference->isMultiAccess()) {
+      BOOST_CHECK_EQUAL(status.getLinkType(), ndn::nfd::LINK_TYPE_MULTI_ACCESS);
+    }
+    else {
+      BOOST_CHECK_EQUAL(status.getLinkType(), ndn::nfd::LINK_TYPE_POINT_TO_POINT);
+    }
+  }
+
+  void
+  decodeFaceStatusBlock(const Data& data)
+  {
+    BOOST_REQUIRE_EQUAL(data.getContentType(), ndn::MetaInfo::TYPE_BLOB);
+
+    Block payload = data.getContent();
+    m_buffer.appendByteArray(payload.value(), payload.value_size());
+
+    BOOST_CHECK_NO_THROW(data.getName()[-1].toSegment());
+    if (data.getFinalBlockId() != data.getName()[-1]) {
+        return;
+    }
+
+    // wrap the Face Statuses in a single Content TLV for easy parsing
+    m_buffer.prependVarNumber(m_buffer.size());
+    m_buffer.prependVarNumber(tlv::Content);
+
+    ndn::Block parser(m_buffer.buf(), m_buffer.size());
+    parser.parse();
+
+    BOOST_REQUIRE_EQUAL(parser.elements_size(), m_referenceFaces.size());
+
+    std::list<shared_ptr<Face> >::const_iterator iReference = m_referenceFaces.begin();
+    for (Block::element_const_iterator i = parser.elements_begin();
+         i != parser.elements_end();
+         ++i) {
+      if (i->type() != ndn::tlv::nfd::FaceStatus) {
+          BOOST_FAIL("expected face status, got type #" << i->type());
+      }
+      validateFaceStatus(*i, *iReference);
+      ++iReference;
+    }
+    m_finished = true;
+  }
+
+  //void
+  //decodeNackBlock(const Data& data)
+  //{
+  //  BOOST_REQUIRE_EQUAL(data.getContentType(), ndn::tlv::ContentType_Nack);
+
+  //  m_finished = true;
+  //}
+
+protected:
+  Forwarder m_forwarder;
+  FaceTable m_table;
+  shared_ptr<InternalFace> m_face;
+  ndn::EncodingBuffer m_buffer;
+  std::list<shared_ptr<Face> > m_referenceFaces;
+  ndn::KeyChain m_keyChain;
+  shared_ptr<DummyFace> m_dummyFace;
+  shared_ptr<DummyLocalFace> m_dummyLocalFace;
+  shared_ptr<DummyFace> m_dummyUri;
+  UdpFactory m_factory;
+
+protected:
+  bool m_finished;
+};
+
+} // namespace tests
+} // namespace nfd
+
+#endif // NFD_TESTS_NFD_MGMT_FACE_QUERY_STATUS_PUBLISHER_COMMON_HPP
diff --git a/tests/daemon/mgmt/face-query-status-publisher.cpp b/tests/daemon/mgmt/face-query-status-publisher.cpp
new file mode 100644
index 0000000..948ee88
--- /dev/null
+++ b/tests/daemon/mgmt/face-query-status-publisher.cpp
@@ -0,0 +1,131 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014,  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-query-status-publisher-common.hpp"
+
+namespace nfd {
+namespace tests {
+
+NFD_LOG_INIT("FaceQueryStatusPublisherTest");
+
+BOOST_FIXTURE_TEST_SUITE(MgmtFaceQuerySatusPublisher, FaceQueryStatusPublisherFixture)
+
+BOOST_AUTO_TEST_CASE(NoConditionFilter)
+{
+  // filter without conditions matches all faces
+  ndn::nfd::FaceQueryFilter filter;
+  FaceQueryStatusPublisher faceQueryStatusPublisher(m_table, *m_face,
+                                                    "/localhost/nfd/FaceStatusPublisherFixture",
+                                                    filter, m_keyChain);
+
+  BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(m_dummyFace), true);
+  BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(m_dummyLocalFace), true);
+}
+
+BOOST_AUTO_TEST_CASE(AllConditionFilter)
+{
+  ndn::nfd::FaceQueryFilter filter;
+  filter.setUriScheme("dummy")
+        .setRemoteUri("dummy://")
+        .setLocalUri("dummy://")
+        .setFaceScope(ndn::nfd::FACE_SCOPE_NON_LOCAL)
+        .setFacePersistency(ndn::nfd::FACE_PERSISTENCY_PERSISTENT)
+        .setLinkType(ndn::nfd::LINK_TYPE_POINT_TO_POINT);
+
+  FaceQueryStatusPublisher faceQueryStatusPublisher(m_table, *m_face,
+                                                    "/localhost/nfd/FaceStatusPublisherFixture",
+                                                    filter, m_keyChain);
+  BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(m_dummyFace), true);
+  BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(m_dummyLocalFace), false);
+}
+
+BOOST_AUTO_TEST_CASE(UriSchemeFilter)
+{
+  ndn::nfd::FaceQueryFilter filter;
+  filter.setUriScheme("dummyurischeme");
+  FaceQueryStatusPublisher faceQueryStatusPublisher(m_table, *m_face,
+                                                    "/localhost/nfd/FaceStatusPublisherFixture",
+                                                    filter, m_keyChain);
+  BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(m_dummyFace), false);
+  auto dummyUriScheme = make_shared<DummyFace>("dummyurischeme://", "dummyurischeme://");
+  BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(dummyUriScheme), true);
+}
+
+BOOST_AUTO_TEST_CASE(RemoteUriFilter)
+{
+  ndn::nfd::FaceQueryFilter filter;
+  filter.setRemoteUri("dummy://remoteUri");
+  FaceQueryStatusPublisher faceQueryStatusPublisher(m_table, *m_face,
+                                                    "/localhost/nfd/FaceStatusPublisherFixture",
+                                                    filter, m_keyChain);
+  BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(m_dummyFace), false);
+  BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(m_dummyUri), true);
+}
+
+BOOST_AUTO_TEST_CASE(LocalUriFilter)
+{
+  ndn::nfd::FaceQueryFilter filter;
+  filter.setLocalUri("dummy://localUri");
+  FaceQueryStatusPublisher faceQueryStatusPublisher(m_table, *m_face,
+                                                    "/localhost/nfd/FaceStatusPublisherFixture",
+                                                    filter, m_keyChain);
+  BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(m_dummyFace), false);
+  BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(m_dummyUri), true);
+}
+
+
+BOOST_AUTO_TEST_CASE(LinkTypeFilter)
+{
+  shared_ptr<MulticastUdpFace> multicastFace = m_factory.createMulticastFace("0.0.0.0",
+                                                                             "224.0.0.1",
+                                                                             "20070");
+  ndn::nfd::FaceQueryFilter filter;
+  filter.setLinkType(ndn::nfd::LINK_TYPE_MULTI_ACCESS);
+  FaceQueryStatusPublisher faceQueryStatusPublisher(m_table, *m_face,
+                                                    "/localhost/nfd/FaceStatusPublisherFixture",
+                                                    filter, m_keyChain);
+  BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(m_dummyFace), false);
+  BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(multicastFace), true);
+}
+
+BOOST_AUTO_TEST_CASE(PersistencyFilter)
+{
+  shared_ptr<MulticastUdpFace> multicastFace = m_factory.createMulticastFace("0.0.0.0",
+                                                                             "224.0.0.1",
+                                                                             "20070");
+  ndn::nfd::FaceQueryFilter filter;
+  filter.setFacePersistency(ndn::nfd::FACE_PERSISTENCY_ON_DEMAND);
+  FaceQueryStatusPublisher faceQueryStatusPublisher(m_table, *m_face,
+                                                    "/localhost/nfd/FaceStatusPublisherFixture",
+                                                    filter, m_keyChain);
+  BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(m_dummyFace), false);
+  multicastFace->setOnDemand(true);
+  BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(multicastFace), true);
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
