diff --git a/tests/rib/readvertise/host-to-gateway-readvertise-policy.t.cpp b/tests/rib/readvertise/host-to-gateway-readvertise-policy.t.cpp
new file mode 100644
index 0000000..1b357cb
--- /dev/null
+++ b/tests/rib/readvertise/host-to-gateway-readvertise-policy.t.cpp
@@ -0,0 +1,114 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2014-2018,  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 "rib/readvertise/host-to-gateway-readvertise-policy.hpp"
+
+#include "tests/identity-management-fixture.hpp"
+
+#include <ndn-cxx/security/signing-helpers.hpp>
+
+namespace nfd {
+namespace rib {
+namespace tests {
+
+using namespace nfd::tests;
+
+class HostToGatewayReadvertisePolicyFixture : public IdentityManagementFixture
+{
+public:
+  RibRouteRef
+  makeNewRoute(const Name& prefix) {
+    auto entry = make_shared<RibEntry>();
+    entry->setName(prefix);
+
+    Route route;
+    auto routeIt = entry->insertRoute(route).first;
+    return RibRouteRef{entry, routeIt};
+  }
+
+  shared_ptr<HostToGatewayReadvertisePolicy>
+  makePolicy(const ConfigSection& section = ConfigSection())
+  {
+    return make_shared<HostToGatewayReadvertisePolicy>(m_keyChain, section);
+  }
+};
+
+BOOST_AUTO_TEST_SUITE(Readvertise)
+BOOST_FIXTURE_TEST_SUITE(TestHostToGatewayReadvertisePolicy,
+                         HostToGatewayReadvertisePolicyFixture)
+
+BOOST_AUTO_TEST_CASE(PrefixToAdvertise)
+{
+  BOOST_REQUIRE(addIdentity("/A"));
+  BOOST_REQUIRE(addIdentity("/A/B"));
+  BOOST_REQUIRE(addIdentity("/C/nrd"));
+
+  auto test = [this] (Name routeName, optional<ReadvertiseAction> expectedAction) {
+    auto policy = makePolicy();
+    auto action = policy->handleNewRoute(makeNewRoute(routeName));
+
+    if (expectedAction) {
+      BOOST_REQUIRE(action);
+      BOOST_CHECK_EQUAL(action->prefix, expectedAction->prefix);
+      BOOST_REQUIRE_EQUAL(action->signer, expectedAction->signer);
+    }
+    else {
+      BOOST_REQUIRE(!action);
+    }
+  };
+
+  test("/D/app", nullopt);
+  test("/A/B/app", ReadvertiseAction{"/A", ndn::security::signingByIdentity("/A")});
+  test("/C/nrd", ReadvertiseAction{"/C", ndn::security::signingByIdentity("/C/nrd")});
+}
+
+BOOST_AUTO_TEST_CASE(DontReadvertise)
+{
+  auto policy = makePolicy();
+  BOOST_REQUIRE(!policy->handleNewRoute(makeNewRoute("/localhost/test")));
+  BOOST_REQUIRE(!policy->handleNewRoute(makeNewRoute("/localhop/nfd")));
+}
+
+BOOST_AUTO_TEST_CASE(LoadRefreshInterval)
+{
+  auto policy = makePolicy();
+  BOOST_CHECK_EQUAL(policy->getRefreshInterval(), time::seconds(25)); // default setting is 25
+
+  ConfigSection section;
+  section.put("refresh_interval_wrong", 10);
+  policy = makePolicy(section);
+  BOOST_CHECK_EQUAL(policy->getRefreshInterval(), time::seconds(25)); // wrong formate
+
+  section.put("refresh_interval", 10);
+  policy = makePolicy(section);
+  BOOST_CHECK_EQUAL(policy->getRefreshInterval(), time::seconds(10));
+}
+
+BOOST_AUTO_TEST_SUITE_END() // TestHostToGatewayReadvertisePolicy
+BOOST_AUTO_TEST_SUITE_END() // Readvertise
+
+} // namespace tests
+} // namespace rib
+} // namespace nfd
