diff --git a/tests/daemon/fw/strategy-ad-hoc-face.t.cpp b/tests/daemon/fw/strategy-ad-hoc-face.t.cpp
new file mode 100644
index 0000000..bdf0cb6
--- /dev/null
+++ b/tests/daemon/fw/strategy-ad-hoc-face.t.cpp
@@ -0,0 +1,156 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2014-2021,  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/>.
+ */
+
+/** \file
+ *  This test suite checks that forwarding can relay Interest and Data via ad hoc face.
+ */
+
+// Strategies that can forward Interest to an ad hoc face even if it's the downstream,
+// sorted alphabetically.
+#include "fw/asf-strategy.hpp"
+#include "fw/best-route-strategy.hpp"
+#include "fw/multicast-strategy.hpp"
+#include "fw/random-strategy.hpp"
+
+#include "tests/daemon/global-io-fixture.hpp"
+#include "topology-tester.hpp"
+
+#include <boost/mpl/vector.hpp>
+
+namespace nfd {
+namespace fw {
+namespace tests {
+
+template<typename S>
+class AdHocTopologyFixture : public GlobalIoTimeFixture
+{
+protected:
+  AdHocTopologyFixture()
+  {
+    nodeA = topo.addForwarder("A");
+    nodeB = topo.addForwarder("B");
+    nodeC = topo.addForwarder("C");
+
+    for (TopologyNode node : {nodeA, nodeB, nodeC}) {
+      topo.setStrategy<S>(node);
+    }
+
+    auto wireless = topo.addLink("ABC", 10_ms, {nodeA, nodeB, nodeC},
+                                 ndn::nfd::LINK_TYPE_AD_HOC);
+    wireless->block(nodeA, nodeC);
+    wireless->block(nodeC, nodeA);
+    faceA = &wireless->getFace(nodeA);
+    faceB = &wireless->getFace(nodeB);
+    faceC = &wireless->getFace(nodeC);
+
+    appA = topo.addAppFace("consumer", nodeA);
+    topo.registerPrefix(nodeA, *faceA, "/P");
+    appC = topo.addAppFace("producer", nodeC, "/P");
+    topo.addEchoProducer(appC->getClientFace(), "/P");
+  }
+
+protected:
+  TopologyTester topo;
+  TopologyNode nodeA;
+  TopologyNode nodeB;
+  TopologyNode nodeC;
+  Face* faceA;
+  Face* faceB;
+  Face* faceC;
+  shared_ptr<TopologyAppLink> appA;
+  shared_ptr<TopologyAppLink> appC;
+};
+
+BOOST_AUTO_TEST_SUITE(Fw)
+BOOST_AUTO_TEST_SUITE(TestStrategyAdHocFace)
+
+using Strategies = boost::mpl::vector<
+  AsfStrategy,
+  BestRouteStrategy,
+  MulticastStrategy,
+  RandomStrategy
+>;
+
+BOOST_FIXTURE_TEST_CASE_TEMPLATE(SingleNexthop,
+                                 S, Strategies, AdHocTopologyFixture<S>)
+{
+  // +---+---+
+  // A   B   C
+  //
+  // A is the consumer. C is the producer.
+  // B should relay Interest/Data between A and C.
+
+  this->topo.registerPrefix(this->nodeB, *this->faceB, "/P");
+  this->topo.addIntervalConsumer(this->appA->getClientFace(), "/P", 100_ms, 10);
+  this->advanceClocks(5_ms, 1200_ms);
+
+  // Consumer should receive Data, and B should be relaying.
+  BOOST_CHECK_EQUAL(this->faceB->getCounters().nInInterests, 10);
+  BOOST_CHECK_EQUAL(this->faceB->getCounters().nOutInterests, 10);
+  BOOST_CHECK_EQUAL(this->appC->getForwarderFace().getCounters().nOutInterests, 10);
+  BOOST_CHECK_EQUAL(this->faceB->getCounters().nInData, 10);
+  BOOST_CHECK_EQUAL(this->faceB->getCounters().nOutData, 10);
+  BOOST_CHECK_EQUAL(this->appA->getForwarderFace().getCounters().nOutData, 10);
+}
+
+BOOST_FIXTURE_TEST_CASE_TEMPLATE(SecondNexthop,
+                                 S, Strategies, AdHocTopologyFixture<S>)
+{
+  // +---+---+
+  // A   B   C
+  //     |
+  //     D
+  //
+  // A is the consumer. C is the producer.
+  // B's first nexthop is D, but B-D link has failed, so B should relay Interest/Data between A and C.
+
+  TopologyNode nodeD = this->topo.addForwarder("D");
+  shared_ptr<TopologyLink> linkBD = this->topo.addLink("BD", 5_ms, {this->nodeB, nodeD});
+  this->topo.registerPrefix(this->nodeB, linkBD->getFace(this->nodeB), "/P", 5);
+  linkBD->fail();
+  this->topo.registerPrefix(this->nodeB, *this->faceB, "/P", 10);
+
+  // Two interval consumers are expressing Interests with same name 40ms apart,
+  // so that Interests from the second interval consumer are considered retransmission.
+  this->topo.addIntervalConsumer(this->appA->getClientFace(), "/P", 100_ms, 50, 1);
+  this->advanceClocks(5_ms, 40_ms);
+  this->topo.addIntervalConsumer(this->appA->getClientFace(), "/P", 100_ms, 50, 1);
+  this->advanceClocks(5_ms, 5400_ms);
+
+  // Consumer should receive Data, and B should be relaying at least some Interest/Data.
+  BOOST_CHECK_GE(this->faceB->getCounters().nInInterests, 50);
+  BOOST_CHECK_GE(this->faceB->getCounters().nOutInterests, 25);
+  BOOST_CHECK_GE(this->appC->getForwarderFace().getCounters().nOutInterests, 25);
+  BOOST_CHECK_GE(this->faceB->getCounters().nInData, 25);
+  BOOST_CHECK_GE(this->faceB->getCounters().nOutData, 25);
+  BOOST_CHECK_GE(this->appA->getForwarderFace().getCounters().nOutData, 25);
+}
+
+BOOST_AUTO_TEST_SUITE_END() // TestStrategyAdHocFace
+BOOST_AUTO_TEST_SUITE_END() // Fw
+
+} // namespace tests
+} // namespace fw
+} // namespace nfd
