Browse Source

[5208a] setTestHostDataSource() added.

Tomek Mrugalski 8 years ago
parent
commit
6702a3631f
1 changed files with 16 additions and 0 deletions
  1. 16 0
      src/lib/dhcpsrv/host_mgr.h

+ 16 - 0
src/lib/dhcpsrv/host_mgr.h

@@ -269,6 +269,22 @@ public:
         return (alternate_source_);
         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:
 private:
 
 
     /// @brief Private default constructor.
     /// @brief Private default constructor.