rib: Add RIB dataset publisher

refs: #1662
Change-Id: I97885c07af131a7ea78d074b39df884178f09416
diff --git a/tests/rib/rib-manager.cpp b/tests/rib/rib-manager.cpp
index 92188b1..797f01e 100644
--- a/tests/rib/rib-manager.cpp
+++ b/tests/rib/rib-manager.cpp
@@ -27,6 +27,7 @@
 
 #include "tests/test-common.hpp"
 #include "tests/dummy-face.hpp"
+#include "rib/rib-status-publisher-common.hpp"
 
 namespace nfd {
 namespace rib {
@@ -111,7 +112,7 @@
 
 typedef RibManagerFixture UnauthorizedRibManager;
 
-BOOST_FIXTURE_TEST_SUITE(RibRibManager, RibManagerFixture)
+BOOST_FIXTURE_TEST_SUITE(RibManager, RibManagerFixture)
 
 BOOST_FIXTURE_TEST_CASE(Basic, AuthorizedRibManager)
 {
@@ -219,6 +220,39 @@
   BOOST_REQUIRE_EQUAL(face->m_sentInterests.size(), 0);
 }
 
+BOOST_FIXTURE_TEST_CASE(RibStatusRequest, AuthorizedRibManager)
+{
+  FaceEntry entry;
+  Name name("/");
+  entry.faceId = 1;
+  entry.origin = 128;
+  entry.cost = 32;
+  entry.flags = ndn::nfd::ROUTE_FLAG_CAPTURE;
+
+  ControlParameters parameters;
+  parameters
+    .setName(name)
+    .setFaceId(entry.faceId)
+    .setOrigin(entry.origin)
+    .setCost(entry.cost)
+    .setFlags(entry.flags)
+    .setExpirationPeriod(ndn::time::milliseconds::max());
+
+  Name commandName("/localhost/nfd/rib/register");
+
+  BOOST_REQUIRE_EQUAL(face->m_sentInterests.size(), 0);
+
+  receiveCommandInterest(commandName, parameters);
+  face->m_sentInterests.clear();
+  face->m_sentDatas.clear();
+
+  face->receive(Interest("/localhost/nfd/rib/list"));
+  face->processEvents(time::milliseconds(1));
+
+  BOOST_REQUIRE_EQUAL(face->m_sentDatas.size(), 1);
+  RibStatusPublisherFixture::decodeRibEntryBlock(face->m_sentDatas[0], name, entry);
+}
+
 BOOST_AUTO_TEST_SUITE_END()
 
 } // namespace tests