summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDeepak Kodihalli <dkodihal@in.ibm.com>2018-08-31 04:22:55 -0500
committerDeepak Kodihalli <dkodihal@in.ibm.com>2018-08-31 04:37:30 -0500
commit2ce7b2c37e634da4e38e63f560d04707506746a2 (patch)
tree7a12b06513f5015e98c43f6f987d7b90745cd524
parent9fab279fb38ab6b391503ce89aceb917ec35efa9 (diff)
downloadphosphor-logging-2ce7b2c37e634da4e38e63f560d04707506746a2.zip
phosphor-logging-2ce7b2c37e634da4e38e63f560d04707506746a2.tar.gz
phoshor-rsyslog-config: wrap utils::restart
Provide a virtual wrapper around utils::restart in class Server. This allows mocking in tests. Change-Id: I79a229eaaaa17860959b8025eb8c152362738acf Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
-rw-r--r--phosphor-rsyslog-config/server-conf.cpp7
-rw-r--r--phosphor-rsyslog-config/server-conf.hpp4
2 files changed, 10 insertions, 1 deletions
diff --git a/phosphor-rsyslog-config/server-conf.cpp b/phosphor-rsyslog-config/server-conf.cpp
index 0b5bc62..4bf8c79 100644
--- a/phosphor-rsyslog-config/server-conf.cpp
+++ b/phosphor-rsyslog-config/server-conf.cpp
@@ -105,7 +105,7 @@ void Server::writeConfig(
stream << "#*.* @@remote-host:port";
}
- utils::restart();
+ restart();
}
bool Server::addressValid(const std::string& address)
@@ -150,5 +150,10 @@ void Server::restore(const char* filePath)
}
}
+void Server::restart()
+{
+ utils::restart();
+}
+
} // namespace rsyslog_config
} // namespace phosphor
diff --git a/phosphor-rsyslog-config/server-conf.hpp b/phosphor-rsyslog-config/server-conf.hpp
index 0f67f30..edab113 100644
--- a/phosphor-rsyslog-config/server-conf.hpp
+++ b/phosphor-rsyslog-config/server-conf.hpp
@@ -69,6 +69,10 @@ class Server : public Iface
*/
virtual uint16_t port(uint16_t value) override;
+ /** @brief Restart rsyslog's systemd unit
+ */
+ virtual void restart();
+
private:
/** @brief Update remote server address and port in
* rsyslog config file.
OpenPOWER on IntegriCloud