]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[5208a] setTestHostDataSource() added.
authorTomek Mrugalski <tomasz@isc.org>
Sat, 22 Apr 2017 09:18:42 +0000 (11:18 +0200)
committerTomek Mrugalski <tomasz@isc.org>
Sat, 22 Apr 2017 09:18:42 +0000 (11:18 +0200)
src/lib/dhcpsrv/host_mgr.h

index e00c45147de34e8cc0727e27210a2fc75b46573d..7da6aba4710afb0fafc5e71db116fa2dc554544f 100644 (file)
@@ -269,6 +269,22 @@ public:
         return (alternate_source_);
     }
 
+    /// @brief Sets the alternate host data source.
+    ///
+    /// Note: This should be used only for testing. Do not use
+    /// in production. Normal control flow assumes that
+    /// HostMgr::create(...) is called and it instnatiates
+    /// appropriate host data source. However, some tests
+    /// (e.g. host_cmds) implement their own very simple
+    /// data source. It's not production ready by any means,
+    /// so it does not belong in host_data_source_factory.cc.
+    /// The testing nature of this method is reflected in its name.
+    ///
+    /// @param source new source to be set (may be NULL)
+    void setTestHostDataSource(const HostDataSourcePtr& source) {
+        alternate_source_ = source;
+    }
+
 private:
 
     /// @brief Private default constructor.