mgmt: Reinitialize multicast faces and partially reload config file on HUP signal

The following elements from the config file are reloaded:
- effective user/group
- log levels
- multicast faces (enable/disable)
- security

Change-Id: I6ddf124702b30610dd0404d8fbaa9a9d800f02bf
Refs: #1584
diff --git a/tests/core/logger.cpp b/tests/core/logger.cpp
index febadfc..9ae7fa4 100644
--- a/tests/core/logger.cpp
+++ b/tests/core/logger.cpp
@@ -493,6 +493,7 @@
   const std::string LOG_CONFIG =
     "log\n"
     "{\n"
+    "  default_level DEBUG\n"
     "  TestMadeUpModule INFO\n"
     "}\n";
 
diff --git a/tests/daemon/mgmt/face-manager.cpp b/tests/daemon/mgmt/face-manager.cpp
index e43c142..6ad6197 100644
--- a/tests/daemon/mgmt/face-manager.cpp
+++ b/tests/daemon/mgmt/face-manager.cpp
@@ -30,6 +30,8 @@
 #include "../face/dummy-face.hpp"
 #include "fw/face-table.hpp"
 #include "fw/forwarder.hpp"
+#include "face/udp-factory.hpp"
+#include "face/ethernet-factory.hpp"
 
 #include "common.hpp"
 #include "tests/test-common.hpp"
@@ -653,6 +655,37 @@
                              "Unrecognized option \"hello\" in \"udp\" section"));
 }
 
+
+BOOST_AUTO_TEST_CASE(TestProcessSectionUdpMulticastReinit)
+{
+  const std::string CONFIG_WITH_MCAST =
+    "face_system\n"
+    "{\n"
+    "  udp\n"
+    "  {\n"
+    "    mcast yes\n"
+    "  }\n"
+    "}\n";
+  BOOST_CHECK_NO_THROW(parseConfig(CONFIG_WITH_MCAST, false));
+
+  shared_ptr<UdpFactory> factory = static_pointer_cast<UdpFactory>(getManager().findFactory("udp"));
+  BOOST_REQUIRE(static_cast<bool>(factory));
+
+  BOOST_CHECK_GT(factory->getMulticastFaces().size(), 0);
+
+  const std::string CONFIG_WITHOUT_MCAST =
+    "face_system\n"
+    "{\n"
+    "  udp\n"
+    "  {\n"
+    "    mcast no\n"
+    "  }\n"
+    "}\n";
+  BOOST_CHECK_NO_THROW(parseConfig(CONFIG_WITHOUT_MCAST, false));
+  BOOST_CHECK_EQUAL(factory->getMulticastFaces().size(), 0);
+}
+
+
 #ifdef HAVE_LIBPCAP
 
 BOOST_AUTO_TEST_CASE(TestProcessSectionEther)
@@ -734,6 +767,37 @@
                              "Unrecognized option \"hello\" in \"ether\" section"));
 }
 
+BOOST_AUTO_TEST_CASE(TestProcessSectionEtherMulticastReinit)
+{
+  const std::string CONFIG_WITH_MCAST =
+    "face_system\n"
+    "{\n"
+    "  ether\n"
+    "  {\n"
+    "    mcast yes\n"
+    "  }\n"
+    "}\n";
+  BOOST_CHECK_NO_THROW(parseConfig(CONFIG_WITH_MCAST, false));
+
+  shared_ptr<EthernetFactory> factory =
+    static_pointer_cast<EthernetFactory>(getManager().findFactory("ether"));
+  BOOST_REQUIRE(static_cast<bool>(factory));
+
+  BOOST_CHECK_GT(factory->getMulticastFaces().size(), 0);
+
+  const std::string CONFIG_WITHOUT_MCAST =
+    "face_system\n"
+    "{\n"
+    "  ether\n"
+    "  {\n"
+    "    mcast no\n"
+    "  }\n"
+    "}\n";
+  BOOST_CHECK_NO_THROW(parseConfig(CONFIG_WITHOUT_MCAST, false));
+  BOOST_CHECK_EQUAL(factory->getMulticastFaces().size(), 0);
+}
+
+
 #endif
 
 BOOST_AUTO_TEST_CASE(TestFireInterestFilter)