D2Controller::~D2Controller() {
}
+std::string
+D2Controller::getVersionAddendum() {
+ std::stringstream stream;
+ // Currently the only dependency D2 adds to base is cryptolink
+ stream << isc::cryptolink::CryptoLink::getVersion() << std::endl;
+ return (stream.str());
+
+}
+
}; // end namespace isc::d2
}; // end namespace isc
/// by convention this should match the executable name.
static const char* d2_bin_name_;
+protected:
+ /// @brief Returns version info specific to D2
+ virtual std::string getVersionAddendum();
+
private:
/// @brief Creates an instance of the DHCP-DDNS specific application
/// process. This method is invoked during the process initialization
libkea_process_la_LIBADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
libkea_process_la_LIBADD += $(top_builddir)/src/lib/cc/libkea-cc.la
libkea_process_la_LIBADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
-libkea_process_la_LIBADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
libkea_process_la_LIBADD += $(top_builddir)/src/lib/log/libkea-log.la
libkea_process_la_LIBADD += $(top_builddir)/src/lib/util/libkea-util.la
libkea_process_la_LIBADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
-libkea_process_la_LIBADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS) $(BOOST_LIBS)
+libkea_process_la_LIBADD += $(LOG4CPLUS_LIBS) $(BOOST_LIBS)
# Specify the headers for copying into the installation directory tree.
libkea_process_includedir = $(pkgincludedir)/process
#include <config.h>
#include <cc/command_interpreter.h>
#include <cfgrpt/config_report.h>
-#include <cryptolink/cryptolink.h>
#include <dhcpsrv/cfgmgr.h>
#include <exceptions/exceptions.h>
#include <log/logger.h>
tmp << std::endl << EXTENDED_VERSION << std::endl;
tmp << "linked with:" << std::endl;
tmp << isc::log::Logger::getVersion() << std::endl;
- tmp << isc::cryptolink::CryptoLink::getVersion() << std::endl;
- tmp << "database:" << std::endl;
-#ifdef HAVE_MYSQL
- tmp << isc::dhcp::MySqlLeaseMgr::getDBVersion() << std::endl;
-#endif
-#ifdef HAVE_PGSQL
- tmp << isc::dhcp::PgSqlLeaseMgr::getDBVersion() << std::endl;
-#endif
-#ifdef HAVE_CQL
- tmp << isc::dhcp::CqlLeaseMgr::getDBVersion() << std::endl;
-#endif
- tmp << isc::dhcp::Memfile_LeaseMgr::getDBVersion();
-
- // @todo: more details about database runtime
+ tmp << getVersionAddendum();
}
return (tmp.str());
/// @brief returns Kea version on stdout and exit.
/// redeclaration/redefinition. @ref isc::dhcp::Daemon::getVersion()
- static std::string getVersion(bool extended);
+ std::string getVersion(bool extended);
/// @brief Acts as the primary entry point into the controller execution
/// and provides the outermost application control logic:
/// This is intended to be used for specific usage violation messages.
void usage(const std::string& text);
+ /// @brief Fetches text containing additional version specifics
+ ///
+ /// This method is provided so derivations can append any additional
+ /// desired information such as library dependencies to the extended
+ /// version text returned when DControllerBase::getVersion(true) is
+ /// invoked.
+ /// @return a string containing additonal version info
+ virtual std::string getVersionAddendum() { return (""); }
+
private:
/// @brief Name of the service under control.
/// This name is used as the configuration module name and appears in log
EXPECT_TRUE(elapsed_time.total_milliseconds() < 300);
}
+// Verifies that version and extended version information is correct
+TEST_F(DStubControllerTest, getVersion) {
+ std::string text = controller_->getVersion(false);
+ EXPECT_EQ(text,VERSION);
+
+ text = controller_->getVersion(true);
+ EXPECT_NE(std::string::npos, text.find(VERSION));
+ EXPECT_NE(std::string::npos, text.find(EXTENDED_VERSION));
+ EXPECT_NE(std::string::npos, text.find(controller_->getVersionAddendum()));
+}
+
// Tests that the SIGTERM triggers a normal shutdown.
TEST_F(DStubControllerTest, sigtermShutdown) {
// Setup to raise SIGHUP in 1 ms.
/// otherwise it return an empty pointer.
virtual isc::data::ConstElementPtr parseFile(const std::string&);
+public:
+
+ /// @brief Provides addtional extended version text
+ ///
+ /// Overrides the base class implementation so we can
+ /// verify the getting the extended version text
+ /// contains derivaiton specific contributions.
+ virtual std::string getVersionAddendum() {
+ return ("StubController Version Text");
+ }
+
private:
/// @brief Constructor is private to protect singleton integrity.
DStubController();