phosphor-rsyslog-conf: add unit tests

Add tests related to setting remote server IP address and port.

Change-Id: I35ac539a8316d34245ee6b1abcb9f48c1ebe5095
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
diff --git a/test/remote_logging_tests.hpp b/test/remote_logging_tests.hpp
new file mode 100644
index 0000000..3606f5a
--- /dev/null
+++ b/test/remote_logging_tests.hpp
@@ -0,0 +1,64 @@
+#include <gtest/gtest.h>
+#include <experimental/filesystem>
+#include <sdbusplus/bus.hpp>
+#include "config.h"
+#include "phosphor-rsyslog-config/server-conf.hpp"
+#include "gmock/gmock.h"
+
+namespace phosphor
+{
+namespace logging
+{
+namespace test
+{
+
+namespace fs = std::experimental::filesystem;
+
+char tmplt[] = "/tmp/logging_test.XXXXXX";
+auto bus = sdbusplus::bus::new_default();
+fs::path dir(fs::path(mkdtemp(tmplt)));
+
+class MockServer : public phosphor::rsyslog_config::Server
+{
+    public:
+        MockServer(sdbusplus::bus::bus& bus,
+               const std::string& path,
+               const char* filePath) :
+            phosphor::rsyslog_config::Server(bus, path, filePath)
+        {
+        }
+
+        MOCK_METHOD0(restart, void());
+};
+
+class TestRemoteLogging : public testing::Test
+{
+    public:
+        TestRemoteLogging()
+        {
+            configFilePath = std::string(dir.c_str()) + "/server.conf";
+            config =
+                new MockServer(bus,
+                               BUSPATH_REMOTE_LOGGING_CONFIG,
+                               configFilePath.c_str());
+        }
+
+        ~TestRemoteLogging()
+        {
+            delete config;
+        }
+
+        static void TearDownTestCase()
+        {
+            fs::remove_all(dir);
+        }
+
+        MockServer* config;
+        std::string configFilePath;
+};
+
+} // namespace test
+} // namespace logging
+} // namespace phosphor
+
+