BIND 10 trac3282, updated. 8534089c1e8a7e3c48a49bf08784ebf05d11b3a1 [3282] Added D2ClientMgr accessor to CfgMgr
BIND 10 source code commits
bind10-changes at lists.isc.org
Mon Jan 20 15:28:11 UTC 2014
The branch, trac3282 has been updated
via 8534089c1e8a7e3c48a49bf08784ebf05d11b3a1 (commit)
from 7f2ef4108043f94170a153174d06323fa2ce9653 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 8534089c1e8a7e3c48a49bf08784ebf05d11b3a1
Author: Thomas Markwalder <tmark at isc.org>
Date: Mon Jan 20 10:26:49 2014 -0500
[3282] Added D2ClientMgr accessor to CfgMgr
Added an accessor to CfgMgr to return a reference to the singlton's
D2ClientMgr instance.
-----------------------------------------------------------------------
Summary of changes:
src/lib/dhcpsrv/cfgmgr.cc | 6 ++++++
src/lib/dhcpsrv/cfgmgr.h | 7 ++++++-
src/lib/dhcpsrv/tests/cfgmgr_unittest.cc | 12 +++++++-----
3 files changed, 19 insertions(+), 6 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/dhcpsrv/cfgmgr.cc b/src/lib/dhcpsrv/cfgmgr.cc
index 6f008f1..b9e48c6 100644
--- a/src/lib/dhcpsrv/cfgmgr.cc
+++ b/src/lib/dhcpsrv/cfgmgr.cc
@@ -363,6 +363,12 @@ CfgMgr::getD2ClientConfig() const {
return (d2_client_mgr_.getD2ClientConfig());
}
+D2ClientMgr&
+CfgMgr::getD2ClientMgr() {
+ return (d2_client_mgr_);
+}
+
+
CfgMgr::CfgMgr()
: datadir_(DHCP_DATA_DIR),
diff --git a/src/lib/dhcpsrv/cfgmgr.h b/src/lib/dhcpsrv/cfgmgr.h
index fcec8bf..0867826 100644
--- a/src/lib/dhcpsrv/cfgmgr.h
+++ b/src/lib/dhcpsrv/cfgmgr.h
@@ -341,7 +341,7 @@ public:
/// pointer.
void setD2ClientConfig(D2ClientConfigPtr& new_config);
- /// @param Convenience method for checking if DHCP-DDNS updates are enabled.
+ /// @brief Convenience method for checking if DHCP-DDNS updates are enabled.
///
/// @return True if the D2 configuration is enabled.
bool ddnsEnabled();
@@ -351,6 +351,11 @@ public:
/// @return a reference to the current configuration pointer.
const D2ClientConfigPtr& getD2ClientConfig() const;
+ /// @brief Fetches the DHCP-DDNS manager.
+ ///
+ /// @return a reference to the DHCP-DDNS manager.
+ D2ClientMgr& getD2ClientMgr();
+
protected:
/// @brief Protected constructor.
diff --git a/src/lib/dhcpsrv/tests/cfgmgr_unittest.cc b/src/lib/dhcpsrv/tests/cfgmgr_unittest.cc
index 8c3d2ea..4a0ccc4 100644
--- a/src/lib/dhcpsrv/tests/cfgmgr_unittest.cc
+++ b/src/lib/dhcpsrv/tests/cfgmgr_unittest.cc
@@ -672,15 +672,17 @@ TEST_F(CfgMgrTest, echoClientId) {
// This test checks the D2ClientMgr wrapper methods.
TEST_F(CfgMgrTest, d2ClientConfig) {
- // After CfgMgr construction, D2 configuration should be disabled.
- // Fetch it and verify this is the case.
+ // After CfgMgr construction, D2ClientMgr member should be initialized
+ // with a D2 configuration that is disabled.
+ // Verify we can Fetch the mgr.
+ D2ClientMgr d2_mgr = CfgMgr::instance().getD2ClientMgr();
+ EXPECT_FALSE(d2_mgr.ddnsEnabled());
+
+ // Make sure the convenience method fetches the config correctly.
D2ClientConfigPtr original_config = CfgMgr::instance().getD2ClientConfig();
ASSERT_TRUE(original_config);
EXPECT_FALSE(original_config->getEnableUpdates());
- // Make sure convenience method agrees.
- EXPECT_FALSE(CfgMgr::instance().ddnsEnabled());
-
// Verify that we cannot set the configuration to an empty pointer.
D2ClientConfigPtr new_cfg;
ASSERT_THROW(CfgMgr::instance().setD2ClientConfig(new_cfg), D2ClientError);
More information about the bind10-changes
mailing list