BIND 10 trac3033, updated. fb678e639cd130cc718cff735e351f019d0c9164 [3033] Addressed review comments.
BIND 10 source code commits
bind10-changes at lists.isc.org
Fri Jan 10 16:13:47 UTC 2014
The branch, trac3033 has been updated
via fb678e639cd130cc718cff735e351f019d0c9164 (commit)
from 6625b4d9366bd09afc859e88e41d7197c9b7ba06 (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 fb678e639cd130cc718cff735e351f019d0c9164
Author: Thomas Markwalder <tmark at isc.org>
Date: Fri Jan 10 11:11:15 2014 -0500
[3033] Addressed review comments.
Removed configuration parameter allow-client-update.
It was deemed to really just be the inverse of override-client-update.
Renamed convenience method isDhcpDdns to ddnsEnabled.
Made enum to string converion functions case insenstive.
Updated copyright dates and other cosmetic changes.
-----------------------------------------------------------------------
Summary of changes:
src/bin/dhcp4/dhcp4.spec | 31 +++-----
src/bin/dhcp4/tests/config_parser_unittest.cc | 14 ++--
src/lib/dhcp_ddns/ncr_io.cc | 16 ++--
src/lib/dhcp_ddns/ncr_io.h | 4 +
src/lib/dhcp_ddns/ncr_msg.cc | 9 ++-
src/lib/dhcp_ddns/tests/ncr_unittests.cc | 3 +
src/lib/dhcpsrv/cfgmgr.cc | 4 +-
src/lib/dhcpsrv/cfgmgr.h | 2 +-
src/lib/dhcpsrv/d2_client.cc | 50 ++++++-------
src/lib/dhcpsrv/d2_client.h | 30 ++++----
src/lib/dhcpsrv/dhcp_parsers.cc | 4 +-
src/lib/dhcpsrv/dhcp_parsers.h | 2 +-
src/lib/dhcpsrv/tests/alloc_engine_unittest.cc | 6 +-
src/lib/dhcpsrv/tests/cfgmgr_unittest.cc | 12 +--
src/lib/dhcpsrv/tests/d2_client_unittest.cc | 64 +++++++---------
src/lib/dhcpsrv/tests/dhcp_parsers_unittest.cc | 78 ++++++++++++++------
.../dhcpsrv/tests/memfile_lease_mgr_unittest.cc | 4 +-
src/lib/dhcpsrv/tests/mysql_lease_mgr_unittest.cc | 24 +++---
18 files changed, 191 insertions(+), 166 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/bin/dhcp4/dhcp4.spec b/src/bin/dhcp4/dhcp4.spec
index cb4c912..c6d2c32 100644
--- a/src/bin/dhcp4/dhcp4.spec
+++ b/src/bin/dhcp4/dhcp4.spec
@@ -298,37 +298,38 @@
"item_type": "map",
"item_optional": false,
"item_default": {"enable-updates": false},
+ "item_description" : "Contains parameters pertaining DHCP-driven DDNS updates",
"map_item_spec": [
{
"item_name": "enable-updates",
"item_type": "boolean",
"item_optional": false,
- "item_default": False,
+ "item_default": false,
"item_description" : "Enables DDNS update processing"
},
{
- "item_name": "server_ip",
+ "item_name": "server-ip",
"item_type": "string",
"item_optional": true,
"item_default": "127.0.0.1",
- "item_description" : "IP address of b10-dhcp-ddns"
+ "item_description" : "IP address of b10-dhcp-ddns (IPv4 or IPv6)"
},
{
- "item_name": "server_port",
+ "item_name": "server-port",
"item_type": "integer",
"item_optional": true,
- "item_default": 5301,
+ "item_default": 53001,
"item_description" : "port number of b10-dhcp-ddns"
},
{
- "item_name": "ncr_protocol",
+ "item_name": "ncr-protocol",
"item_type": "string",
"item_optional": true,
"item_default": "UDP",
"item_description" : "Socket protocol to use with b10-dhcp-ddns"
},
{
- "item_name": "ncr_format",
+ "item_name": "ncr-format",
"item_type": "string",
"item_optional": true,
"item_default": "JSON",
@@ -339,23 +340,15 @@
"item_type": "boolean",
"item_optional": true,
"item_default": false,
- "item_description": "Should server request a DNS Remove, before a DNS Update on renewals"
+ "item_description": "Enable requesting a DNS Remove, before a DNS Update on renewals"
},
{
"item_name": "always-include-fqdn",
"item_type": "boolean",
"item_optional": true,
- "item_default": False,
- "item_description": "Should server always include the FQDN option in its response"
- },
- {
-
- "item_name": "allow-client-update",
- "item_type": "boolean",
- "item_optional": true,
- "item_default": False,
- "item_description": "Enable AAAA RR update delegation to the client"
+ "item_default": false,
+ "item_description": "Enable always including the FQDN option in its response"
},
{
"item_name": "override-no-update",
@@ -368,7 +361,7 @@
"item_name": "override-client-update",
"item_type": "boolean",
"item_optional": true,
- "item_default": true,
+ "item_default": false,
"item_description": "Server performs an update even if client requested delegation"
},
{
diff --git a/src/bin/dhcp4/tests/config_parser_unittest.cc b/src/bin/dhcp4/tests/config_parser_unittest.cc
index a789b39..de95e64 100644
--- a/src/bin/dhcp4/tests/config_parser_unittest.cc
+++ b/src/bin/dhcp4/tests/config_parser_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2012-2013 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012-2014 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
@@ -64,6 +64,7 @@ std::string specfile(const std::string& name) {
/// Verifies that the BIND10 DHCP-DDNS configuration specification file
// is valid.
TEST(Dhcp4SpecTest, basicSpec) {
+ (isc::config::moduleSpecFromFile(specfile("dhcp4.spec")));
ASSERT_NO_THROW(isc::config::moduleSpecFromFile(specfile("dhcp4.spec")));
}
@@ -2327,7 +2328,7 @@ TEST_F(Dhcp4ParserTest, d2ClientConfig) {
EXPECT_FALSE(d2_client_config->getEnableUpdates());
// Verify that the convenience method agrees.
- ASSERT_FALSE(CfgMgr::instance().isDhcpDdnsEnabled());
+ ASSERT_FALSE(CfgMgr::instance().ddnsEnabled());
string config_str = "{ \"interfaces\": [ \"*\" ],"
"\"rebind-timer\": 2000, "
@@ -2338,7 +2339,7 @@ TEST_F(Dhcp4ParserTest, d2ClientConfig) {
" \"dhcp-ddns\" : {"
" \"enable-updates\" : true, "
" \"server-ip\" : \"192.168.2.1\", "
- " \"server-port\" : 5301, "
+ " \"server-port\" : 777, "
" \"ncr-protocol\" : \"UDP\", "
" \"ncr-format\" : \"JSON\", "
" \"remove-on-renew\" : true, "
@@ -2362,7 +2363,7 @@ TEST_F(Dhcp4ParserTest, d2ClientConfig) {
checkResult(status, 0);
// Verify that DHCP-DDNS updating is enabled.
- EXPECT_TRUE(CfgMgr::instance().isDhcpDdnsEnabled());
+ EXPECT_TRUE(CfgMgr::instance().ddnsEnabled());
// Verify that the D2 configuration can be retrieved.
d2_client_config = CfgMgr::instance().getD2ClientConfig();
@@ -2371,12 +2372,11 @@ TEST_F(Dhcp4ParserTest, d2ClientConfig) {
// Verify that the configuration values are correct.
EXPECT_TRUE(d2_client_config->getEnableUpdates());
EXPECT_EQ("192.168.2.1", d2_client_config->getServerIp().toText());
- EXPECT_EQ(5301, d2_client_config->getServerPort());
+ EXPECT_EQ(777, d2_client_config->getServerPort());
EXPECT_EQ(dhcp_ddns::NCR_UDP, d2_client_config->getNcrProtocol());
EXPECT_EQ(dhcp_ddns::FMT_JSON, d2_client_config->getNcrFormat());
EXPECT_TRUE(d2_client_config->getRemoveOnRenew());
EXPECT_TRUE(d2_client_config->getAlwaysIncludeFqdn());
- EXPECT_TRUE(d2_client_config->getAllowClientUpdate());
EXPECT_TRUE(d2_client_config->getOverrideNoUpdate());
EXPECT_TRUE(d2_client_config->getOverrideClientUpdate());
EXPECT_TRUE(d2_client_config->getReplaceClientName());
@@ -2427,7 +2427,7 @@ TEST_F(Dhcp4ParserTest, invalidD2ClientConfig) {
EXPECT_FALSE(d2_client_config->getEnableUpdates());
// Verify that the convenience method agrees.
- ASSERT_FALSE(CfgMgr::instance().isDhcpDdnsEnabled());
+ ASSERT_FALSE(CfgMgr::instance().ddnsEnabled());
}
}
diff --git a/src/lib/dhcp_ddns/ncr_io.cc b/src/lib/dhcp_ddns/ncr_io.cc
index eee948e..7e7174a 100644
--- a/src/lib/dhcp_ddns/ncr_io.cc
+++ b/src/lib/dhcp_ddns/ncr_io.cc
@@ -15,16 +15,18 @@
#include <dhcp_ddns/dhcp_ddns_log.h>
#include <dhcp_ddns/ncr_io.h>
+#include <boost/algorithm/string/predicate.hpp>
+
namespace isc {
namespace dhcp_ddns {
NameChangeProtocol stringToNcrProtocol(const std::string& protocol_str) {
- if (protocol_str == "UDP") {
- return NCR_UDP;
- }
+ if (boost::iequals(protocol_str, "UDP")) {
+ return (NCR_UDP);
+ }
- if (protocol_str == "TCP") {
- return NCR_TCP;
+ if (boost::iequals(protocol_str, "TCP")) {
+ return (NCR_TCP);
}
isc_throw(BadValue, "Invalid NameChangeRequest protocol:" << protocol_str);
@@ -40,7 +42,9 @@ std::string ncrProtocolToString(NameChangeProtocol protocol) {
break;
}
- return ("UNKNOWN");
+ std::ostringstream stream;
+ stream << "UNKNOWN(" << protocol << ")";
+ return (stream.str());
}
diff --git a/src/lib/dhcp_ddns/ncr_io.h b/src/lib/dhcp_ddns/ncr_io.h
index 50d1c8c..a5e513a 100644
--- a/src/lib/dhcp_ddns/ncr_io.h
+++ b/src/lib/dhcp_ddns/ncr_io.h
@@ -67,6 +67,10 @@ namespace isc {
namespace dhcp_ddns {
/// @brief Defines the list of socket protocols supported.
+/// Currently only UDP is implemented.
+/// @todo TCP is intended to be implemented prior 1.0 release.
+/// @todo Give some thought to an ANY protocol which might try
+/// first as UDP then as TCP, etc.
enum NameChangeProtocol {
NCR_UDP,
NCR_TCP
diff --git a/src/lib/dhcp_ddns/ncr_msg.cc b/src/lib/dhcp_ddns/ncr_msg.cc
index 91c2608..13bc5bc 100644
--- a/src/lib/dhcp_ddns/ncr_msg.cc
+++ b/src/lib/dhcp_ddns/ncr_msg.cc
@@ -18,16 +18,19 @@
#include <asiolink/io_error.h>
#include <cryptolink/cryptolink.h>
+#include <boost/algorithm/string/predicate.hpp>
#include <botan/sha2_32.h>
#include <sstream>
#include <limits>
+
namespace isc {
namespace dhcp_ddns {
+
NameChangeFormat stringToNcrFormat(const std::string& fmt_str) {
- if (fmt_str == "JSON") {
+ if (boost::iequals(fmt_str, "JSON")) {
return FMT_JSON;
}
@@ -40,7 +43,9 @@ std::string ncrFormatToString(NameChangeFormat format) {
return ("JSON");
}
- return ("UNKNOWN");
+ std::ostringstream stream;
+ stream << "UNKNOWN(" << format << ")";
+ return (stream.str());
}
/********************************* D2Dhcid ************************************/
diff --git a/src/lib/dhcp_ddns/tests/ncr_unittests.cc b/src/lib/dhcp_ddns/tests/ncr_unittests.cc
index e71ddda..c66b891 100644
--- a/src/lib/dhcp_ddns/tests/ncr_unittests.cc
+++ b/src/lib/dhcp_ddns/tests/ncr_unittests.cc
@@ -611,6 +611,7 @@ TEST(NameChangeRequestTest, ipAddresses) {
/// @brief Tests conversion of NameChangeFormat between enum and strings.
TEST(NameChangeFormatTest, formatEnumConversion){
ASSERT_EQ(stringToNcrFormat("JSON"), dhcp_ddns::FMT_JSON);
+ ASSERT_EQ(stringToNcrFormat("jSoN"), dhcp_ddns::FMT_JSON);
ASSERT_THROW(stringToNcrFormat("bogus"), isc::BadValue);
ASSERT_EQ(ncrFormatToString(dhcp_ddns::FMT_JSON), "JSON");
@@ -619,7 +620,9 @@ TEST(NameChangeFormatTest, formatEnumConversion){
/// @brief Tests conversion of NameChangeProtocol between enum and strings.
TEST(NameChangeProtocolTest, protocolEnumConversion){
ASSERT_EQ(stringToNcrProtocol("UDP"), dhcp_ddns::NCR_UDP);
+ ASSERT_EQ(stringToNcrProtocol("udP"), dhcp_ddns::NCR_UDP);
ASSERT_EQ(stringToNcrProtocol("TCP"), dhcp_ddns::NCR_TCP);
+ ASSERT_EQ(stringToNcrProtocol("Tcp"), dhcp_ddns::NCR_TCP);
ASSERT_THROW(stringToNcrProtocol("bogus"), isc::BadValue);
ASSERT_EQ(ncrProtocolToString(dhcp_ddns::NCR_UDP), "UDP");
diff --git a/src/lib/dhcpsrv/cfgmgr.cc b/src/lib/dhcpsrv/cfgmgr.cc
index b5bcb66..6f008f1 100644
--- a/src/lib/dhcpsrv/cfgmgr.cc
+++ b/src/lib/dhcpsrv/cfgmgr.cc
@@ -354,8 +354,8 @@ CfgMgr::setD2ClientConfig(D2ClientConfigPtr& new_config) {
}
bool
-CfgMgr::isDhcpDdnsEnabled() {
- return (d2_client_mgr_.isDhcpDdnsEnabled());
+CfgMgr::ddnsEnabled() {
+ return (d2_client_mgr_.ddnsEnabled());
}
const D2ClientConfigPtr&
diff --git a/src/lib/dhcpsrv/cfgmgr.h b/src/lib/dhcpsrv/cfgmgr.h
index 07d4b9c..fcec8bf 100644
--- a/src/lib/dhcpsrv/cfgmgr.h
+++ b/src/lib/dhcpsrv/cfgmgr.h
@@ -344,7 +344,7 @@ public:
/// @param Convenience method for checking if DHCP-DDNS updates are enabled.
///
/// @return True if the D2 configuration is enabled.
- bool isDhcpDdnsEnabled();
+ bool ddnsEnabled();
/// @brief Fetches the DHCP-DDNS configuration pointer.
///
diff --git a/src/lib/dhcpsrv/d2_client.cc b/src/lib/dhcpsrv/d2_client.cc
index 47b6b40..d1b06ae 100644
--- a/src/lib/dhcpsrv/d2_client.cc
+++ b/src/lib/dhcpsrv/d2_client.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
@@ -31,7 +31,6 @@ D2ClientConfig::D2ClientConfig(const bool enable_updates,
NameChangeFormat& ncr_format,
const bool remove_on_renew,
const bool always_include_fqdn,
- const bool allow_client_update,
const bool override_no_update,
const bool override_client_update,
const bool replace_client_name,
@@ -44,29 +43,12 @@ D2ClientConfig::D2ClientConfig(const bool enable_updates,
ncr_format_(ncr_format),
remove_on_renew_(remove_on_renew),
always_include_fqdn_(always_include_fqdn),
- allow_client_update_(allow_client_update),
override_no_update_(override_no_update),
override_client_update_(override_client_update),
replace_client_name_(replace_client_name),
generated_prefix_(generated_prefix),
qualifying_suffix_(qualifying_suffix) {
- if (ncr_format_ != dhcp_ddns::FMT_JSON) {
- isc_throw(D2ClientError, "D2ClientConfig: NCR Format:"
- << dhcp_ddns::ncrFormatToString(ncr_format)
- << " is not yet supported");
- }
-
- if (ncr_protocol_ != dhcp_ddns::NCR_UDP) {
- isc_throw(D2ClientError, "D2ClientConfig: NCR Protocol:"
- << dhcp_ddns::ncrProtocolToString(ncr_protocol)
- << " is not yet supported");
- }
-
- // @todo perhaps more validation we should do yet?
- // Are there any invalid combinations of options we need to test against?
- // For instance are allow_client_update and override_client_update mutually
- // exclusive?
- // Also do we care about validating contents if it's disabled?
+ validateContents();
}
D2ClientConfig::D2ClientConfig()
@@ -77,16 +59,35 @@ D2ClientConfig::D2ClientConfig()
ncr_format_(dhcp_ddns::FMT_JSON),
remove_on_renew_(false),
always_include_fqdn_(false),
- allow_client_update_(false),
override_no_update_(false),
override_client_update_(false),
replace_client_name_(false),
generated_prefix_(""),
qualifying_suffix_("") {
+ validateContents();
}
D2ClientConfig::~D2ClientConfig(){};
+void
+D2ClientConfig::validateContents() {
+ if (ncr_format_ != dhcp_ddns::FMT_JSON) {
+ isc_throw(D2ClientError, "D2ClientConfig: NCR Format:"
+ << dhcp_ddns::ncrFormatToString(ncr_format_)
+ << " is not yet supported");
+ }
+
+ if (ncr_protocol_ != dhcp_ddns::NCR_UDP) {
+ isc_throw(D2ClientError, "D2ClientConfig: NCR Protocol:"
+ << dhcp_ddns::ncrProtocolToString(ncr_protocol_)
+ << " is not yet supported");
+ }
+
+ // @todo perhaps more validation we should do yet?
+ // Are there any invalid combinations of options we need to test against?
+ // Also do we care about validating contents if it's disabled?
+}
+
bool
D2ClientConfig::operator == (const D2ClientConfig& other) const {
return ((enable_updates_ == other.enable_updates_) &&
@@ -96,7 +97,6 @@ D2ClientConfig::operator == (const D2ClientConfig& other) const {
(ncr_format_ == other.ncr_format_) &&
(remove_on_renew_ == other.remove_on_renew_) &&
(always_include_fqdn_ == other.always_include_fqdn_) &&
- (allow_client_update_ == other.allow_client_update_) &&
(override_no_update_ == other.override_no_update_) &&
(override_client_update_ == other.override_client_update_) &&
(replace_client_name_ == other.replace_client_name_) &&
@@ -122,8 +122,6 @@ D2ClientConfig::toText() const {
<< ", remove_on_renew: " << (remove_on_renew_ ? "yes" : "no")
<< ", always_include_fqdn: " << (always_include_fqdn_ ?
"yes" : "no")
- << ", allow_client_update: " << (allow_client_update_ ?
- "yes" : "no")
<< ", override_no_update: " << (override_no_update_ ?
"yes" : "no")
<< ", override_client_update: " << (override_client_update_ ?
@@ -169,12 +167,12 @@ D2ClientMgr::setD2ClientConfig(D2ClientConfigPtr& new_config) {
// For now we just update the configuration.
d2_client_config_ = new_config;
LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE, DHCPSRV_CFGMGR_CFG_DHCP_DDNS)
- .arg(!isDhcpDdnsEnabled() ? "DHCP-DDNS updates disabled" :
+ .arg(!ddnsEnabled() ? "DHCP-DDNS updates disabled" :
"DHCP_DDNS updates enabled");
}
bool
-D2ClientMgr::isDhcpDdnsEnabled() {
+D2ClientMgr::ddnsEnabled() {
return (d2_client_config_->getEnableUpdates());
}
diff --git a/src/lib/dhcpsrv/d2_client.h b/src/lib/dhcpsrv/d2_client.h
index 6e02a21..2f84515 100644
--- a/src/lib/dhcpsrv/d2_client.h
+++ b/src/lib/dhcpsrv/d2_client.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
@@ -58,7 +58,7 @@ public:
/// @brief Constructor
///
/// @param enable_updates Enables DHCP-DDNS updates
- /// @param server_ip IP address of the b10-dhcp-ddns server
+ /// @param server_ip IP address of the b10-dhcp-ddns server (IPv4 or IPv6)
/// @param server_port IP port of the b10-dhcp-ddns server
/// @param ncr_protocol Socket protocol to use with b10-dhcp-ddns
/// Currently only UDP is supported.
@@ -71,7 +71,6 @@ public:
/// is unnecessary).
/// @param always_include_fqdn Enables always including the FQDN option in
/// DHCP responses.
- /// @param allow_client_update Enables delegation of updates to clients
/// @param override_no_update Enables updates, even if clients request no
/// updates.
/// @param override_client_update Perform updates, even if client requested
@@ -89,7 +88,6 @@ public:
const dhcp_ddns::NameChangeFormat& ncr_format,
const bool remove_on_renew,
const bool always_include_fqdn,
- const bool allow_client_update,
const bool override_no_update,
const bool override_client_update,
const bool replace_client_name,
@@ -108,7 +106,7 @@ public:
return(enable_updates_);
}
- /// @brief Return the IP address of b10-dhcp-ddns.
+ /// @brief Return the IP address of b10-dhcp-ddns (IPv4 or IPv6).
const isc::asiolink::IOAddress& getServerIp() const {
return(server_ip_);
}
@@ -138,11 +136,6 @@ public:
return(always_include_fqdn_);
}
- /// @brief Return whether or not updates can be delegated to clients.
- bool getAllowClientUpdate() const {
- return(allow_client_update_);
- }
-
/// @brief Return if updates are done even if clients request no updates.
bool getOverrideNoUpdate() const {
return(override_no_update_);
@@ -177,11 +170,19 @@ public:
/// @brief Generates a string representation of the class contents.
std::string toText() const;
+protected:
+ /// @brief Validates member values.
+ ///
+ /// Method is used by the constructor to validate member contents.
+ ///
+ /// @throw D2ClientError if given an invalid protocol or format.
+ virtual void validateContents();
+
private:
/// @brief Indicates whether or not DHCP DDNS updating is enabled.
bool enable_updates_;
- /// @brief IP address of the b10-dhcp-ddns server.
+ /// @brief IP address of the b10-dhcp-ddns server (IPv4 or IPv6).
isc::asiolink::IOAddress server_ip_;
/// @brief IP port of the b10-dhcp-ddns server.
@@ -205,9 +206,6 @@ private:
/// @brief Should Kea always include the FQDN option in its response.
bool always_include_fqdn_;
- /// @brief Should Kea permit the client to do updates.
- bool allow_client_update_;
-
/// @brief Should Kea perform updates, even if client requested no updates.
/// Overrides the client request for no updates via the N flag.
bool override_no_update_;
@@ -236,7 +234,7 @@ typedef boost::shared_ptr<D2ClientConfig> D2ClientConfigPtr;
/// Provides services for managing the current D2ClientConfig and managing
/// communications with D2. (@todo The latter will be added once communication
/// with D2 is implemented through the integration of
-/// dhcp_ddns::NameChangeSender interface(s).
+/// dhcp_ddns::NameChangeSender interface(s)).
///
class D2ClientMgr {
public:
@@ -258,7 +256,7 @@ public:
/// @brief Convenience method for checking if DHCP-DDNS is enabled.
///
/// @return True if the D2 configuration is enabled.
- bool isDhcpDdnsEnabled();
+ bool ddnsEnabled();
/// @brief Fetches the DHCP-DDNS configuration pointer.
///
diff --git a/src/lib/dhcpsrv/dhcp_parsers.cc b/src/lib/dhcpsrv/dhcp_parsers.cc
index 7a9aee7..c647954 100644
--- a/src/lib/dhcpsrv/dhcp_parsers.cc
+++ b/src/lib/dhcpsrv/dhcp_parsers.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
@@ -1209,7 +1209,6 @@ D2ClientConfigParser::build(isc::data::ConstElementPtr client_config) {
bool remove_on_renew = boolean_values_->getParam("remove-on-renew");
bool always_include_fqdn = boolean_values_->getParam("always-include-fqdn");
- bool allow_client_update = boolean_values_->getParam("allow-client-update");
bool override_no_update = boolean_values_->getParam("override-no-update");
bool override_client_update = boolean_values_->
getParam("override-client-update");
@@ -1220,7 +1219,6 @@ D2ClientConfigParser::build(isc::data::ConstElementPtr client_config) {
server_port, ncr_protocol,
ncr_format, remove_on_renew,
always_include_fqdn,
- allow_client_update,
override_no_update,
override_client_update,
replace_client_name,
diff --git a/src/lib/dhcpsrv/dhcp_parsers.h b/src/lib/dhcpsrv/dhcp_parsers.h
index a489f49..00a07a0 100644
--- a/src/lib/dhcpsrv/dhcp_parsers.h
+++ b/src/lib/dhcpsrv/dhcp_parsers.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
diff --git a/src/lib/dhcpsrv/tests/alloc_engine_unittest.cc b/src/lib/dhcpsrv/tests/alloc_engine_unittest.cc
index fda8d59..8f952b4 100644
--- a/src/lib/dhcpsrv/tests/alloc_engine_unittest.cc
+++ b/src/lib/dhcpsrv/tests/alloc_engine_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2012-2013 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012-2014 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
@@ -154,7 +154,7 @@ public:
EXPECT_TRUE(false == lease->fqdn_fwd_);
EXPECT_TRUE(false == lease->fqdn_rev_);
EXPECT_TRUE(*lease->duid_ == *duid_);
- // @todo: check cltt
+ /// @todo: check cltt
}
/// @brief Checks if specified address is increased properly
@@ -408,7 +408,7 @@ public:
EXPECT_TRUE(*lease->client_id_ == *clientid_);
}
EXPECT_TRUE(lease->hwaddr_ == hwaddr_->hwaddr_);
- // @todo: check cltt
+ /// @todo: check cltt
}
virtual ~AllocEngine4Test() {
diff --git a/src/lib/dhcpsrv/tests/cfgmgr_unittest.cc b/src/lib/dhcpsrv/tests/cfgmgr_unittest.cc
index 974fb2f..8c3d2ea 100644
--- a/src/lib/dhcpsrv/tests/cfgmgr_unittest.cc
+++ b/src/lib/dhcpsrv/tests/cfgmgr_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2012-2013 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012-2014 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
@@ -538,7 +538,7 @@ TEST_F(CfgMgrTest, optionSpace4) {
cfg_mgr.addOptionSpace4(space3), isc::dhcp::InvalidOptionSpace
);
- // @todo decode if a duplicate vendor space is allowed.
+ /// @todo decode if a duplicate vendor space is allowed.
}
// This test verifies that new DHCPv6 option spaces can be added to
@@ -571,7 +571,7 @@ TEST_F(CfgMgrTest, optionSpace6) {
cfg_mgr.addOptionSpace6(space3), isc::dhcp::InvalidOptionSpace
);
- // @todo decide if a duplicate vendor space is allowed.
+ /// @todo decide if a duplicate vendor space is allowed.
}
// This test verifies that it is possible to specify interfaces that server
@@ -679,7 +679,7 @@ TEST_F(CfgMgrTest, d2ClientConfig) {
EXPECT_FALSE(original_config->getEnableUpdates());
// Make sure convenience method agrees.
- EXPECT_FALSE(CfgMgr::instance().isDhcpDdnsEnabled());
+ EXPECT_FALSE(CfgMgr::instance().ddnsEnabled());
// Verify that we cannot set the configuration to an empty pointer.
D2ClientConfigPtr new_cfg;
@@ -689,7 +689,7 @@ TEST_F(CfgMgrTest, d2ClientConfig) {
ASSERT_NO_THROW(new_cfg.reset(new D2ClientConfig(true,
isc::asiolink::IOAddress("127.0.0.1"), 477,
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
- true, true, true, true, true, true,
+ true, true, true, true, true,
"pre-fix", "suf-fix")));
// Verify that we can assign a new, non-empty configuration.
@@ -701,7 +701,7 @@ TEST_F(CfgMgrTest, d2ClientConfig) {
EXPECT_TRUE(updated_config->getEnableUpdates());
// Make sure convenience method agrees with updated configuration.
- EXPECT_TRUE(CfgMgr::instance().isDhcpDdnsEnabled());
+ EXPECT_TRUE(CfgMgr::instance().ddnsEnabled());
// Make sure the configuration we fetched is the one we assigned,
// and not the original configuration.
diff --git a/src/lib/dhcpsrv/tests/d2_client_unittest.cc b/src/lib/dhcpsrv/tests/d2_client_unittest.cc
index 6b32755..bd8f061 100644
--- a/src/lib/dhcpsrv/tests/d2_client_unittest.cc
+++ b/src/lib/dhcpsrv/tests/d2_client_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2012-2013 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012-2014 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
@@ -26,7 +26,7 @@ using namespace isc;
namespace {
-// brief Checks constructors and accessors of D2ClientConfig.
+/// @brief Checks constructors and accessors of D2ClientConfig.
TEST(D2ClientConfigTest, constructorsAndAccessors) {
D2ClientConfigPtr d2_client_config;
@@ -43,7 +43,6 @@ TEST(D2ClientConfigTest, constructorsAndAccessors) {
dhcp_ddns::NameChangeFormat ncr_format = dhcp_ddns::FMT_JSON;
bool remove_on_renew = true;
bool always_include_fqdn = true;
- bool allow_client_update = true;
bool override_no_update = true;
bool override_client_update = true;
bool replace_client_name = true;
@@ -59,7 +58,6 @@ TEST(D2ClientConfigTest, constructorsAndAccessors) {
ncr_format,
remove_on_renew,
always_include_fqdn,
- allow_client_update,
override_no_update,
override_client_update,
replace_client_name,
@@ -77,7 +75,6 @@ TEST(D2ClientConfigTest, constructorsAndAccessors) {
EXPECT_EQ(d2_client_config->getNcrFormat(), ncr_format);
EXPECT_EQ(d2_client_config->getRemoveOnRenew(), remove_on_renew);
EXPECT_EQ(d2_client_config->getAlwaysIncludeFqdn(), always_include_fqdn);
- EXPECT_EQ(d2_client_config->getAllowClientUpdate(), allow_client_update);
EXPECT_EQ(d2_client_config->getOverrideNoUpdate(), override_no_update);
EXPECT_EQ(d2_client_config->getOverrideClientUpdate(),
override_client_update);
@@ -90,7 +87,7 @@ TEST(D2ClientConfigTest, constructorsAndAccessors) {
*d2_client_config << std::endl);
// Verify that constructor does not allow use of NCR_TCP.
- // @todo obviously this becomes invalid once TCP is supported.
+ /// @todo obviously this becomes invalid once TCP is supported.
ASSERT_THROW(d2_client_config.reset(new
D2ClientConfig(enable_updates,
server_ip,
@@ -99,7 +96,6 @@ TEST(D2ClientConfigTest, constructorsAndAccessors) {
ncr_format,
remove_on_renew,
always_include_fqdn,
- allow_client_update,
override_no_update,
override_client_update,
replace_client_name,
@@ -107,11 +103,11 @@ TEST(D2ClientConfigTest, constructorsAndAccessors) {
qualifying_suffix)),
D2ClientError);
- // @todo if additional validation is added to ctor, this test needs to
- // expand accordingly.
+ /// @todo if additional validation is added to ctor, this test needs to
+ /// expand accordingly.
}
-// Tests the equality and inequality operators of D2ClientConfig.
+/// @brief Tests the equality and inequality operators of D2ClientConfig.
TEST(D2ClientConfigTest, equalityOperator) {
D2ClientConfigPtr ref_config;
D2ClientConfigPtr test_config;
@@ -123,7 +119,7 @@ TEST(D2ClientConfigTest, equalityOperator) {
ASSERT_NO_THROW(ref_config.reset(new D2ClientConfig(true,
ref_address, 477,
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
- true, true, true, true, true, true,
+ true, true, true, true, true,
"pre-fix", "suf-fix")));
ASSERT_TRUE(ref_config);
@@ -131,7 +127,7 @@ TEST(D2ClientConfigTest, equalityOperator) {
ASSERT_NO_THROW(test_config.reset(new D2ClientConfig(true,
ref_address, 477,
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
- true, true, true, true, true, true,
+ true, true, true, true, true,
"pre-fix", "suf-fix")));
ASSERT_TRUE(test_config);
EXPECT_TRUE(*ref_config == *test_config);
@@ -141,7 +137,7 @@ TEST(D2ClientConfigTest, equalityOperator) {
ASSERT_NO_THROW(test_config.reset(new D2ClientConfig(false,
ref_address, 477,
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
- true, true, true, true, true, true,
+ true, true, true, true, true,
"pre-fix", "suf-fix")));
ASSERT_TRUE(test_config);
EXPECT_FALSE(*ref_config == *test_config);
@@ -151,7 +147,7 @@ TEST(D2ClientConfigTest, equalityOperator) {
ASSERT_NO_THROW(test_config.reset(new D2ClientConfig(true,
test_address, 477,
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
- true, true, true, true, true, true,
+ true, true, true, true, true,
"pre-fix", "suf-fix")));
ASSERT_TRUE(test_config);
EXPECT_FALSE(*ref_config == *test_config);
@@ -161,7 +157,7 @@ TEST(D2ClientConfigTest, equalityOperator) {
ASSERT_NO_THROW(test_config.reset(new D2ClientConfig(true,
ref_address, 333,
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
- true, true, true, true, true, true,
+ true, true, true, true, true,
"pre-fix", "suf-fix")));
ASSERT_TRUE(test_config);
EXPECT_FALSE(*ref_config == *test_config);
@@ -171,7 +167,7 @@ TEST(D2ClientConfigTest, equalityOperator) {
ASSERT_NO_THROW(test_config.reset(new D2ClientConfig(true,
ref_address, 477,
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
- false, true, true, true, true, true,
+ false, true, true, true, true,
"pre-fix", "suf-fix")));
ASSERT_TRUE(test_config);
EXPECT_FALSE(*ref_config == *test_config);
@@ -181,17 +177,7 @@ TEST(D2ClientConfigTest, equalityOperator) {
ASSERT_NO_THROW(test_config.reset(new D2ClientConfig(true,
ref_address, 477,
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
- true, false, true, true, true, true,
- "pre-fix", "suf-fix")));
- ASSERT_TRUE(test_config);
- EXPECT_FALSE(*ref_config == *test_config);
- EXPECT_TRUE(*ref_config != *test_config);
-
- // Check a configuration that differs only by allow_client_update.
- ASSERT_NO_THROW(test_config.reset(new D2ClientConfig(true,
- ref_address, 477,
- dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
- true, true, false, true, true, true,
+ true, false, true, true, true,
"pre-fix", "suf-fix")));
ASSERT_TRUE(test_config);
EXPECT_FALSE(*ref_config == *test_config);
@@ -201,7 +187,7 @@ TEST(D2ClientConfigTest, equalityOperator) {
ASSERT_NO_THROW(test_config.reset(new D2ClientConfig(true,
ref_address, 477,
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
- true, true, true, false, true, true,
+ true, true, false, true, true,
"pre-fix", "suf-fix")));
ASSERT_TRUE(test_config);
EXPECT_FALSE(*ref_config == *test_config);
@@ -211,7 +197,7 @@ TEST(D2ClientConfigTest, equalityOperator) {
ASSERT_NO_THROW(test_config.reset(new D2ClientConfig(true,
ref_address, 477,
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
- true, true, true, true, false, true,
+ true, true, true, false, true,
"pre-fix", "suf-fix")));
ASSERT_TRUE(test_config);
EXPECT_FALSE(*ref_config == *test_config);
@@ -221,7 +207,7 @@ TEST(D2ClientConfigTest, equalityOperator) {
ASSERT_NO_THROW(test_config.reset(new D2ClientConfig(true,
ref_address, 477,
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
- true, true, true, true, true, false,
+ true, true, true, true, false,
"pre-fix", "suf-fix")));
ASSERT_TRUE(test_config);
EXPECT_FALSE(*ref_config == *test_config);
@@ -231,7 +217,7 @@ TEST(D2ClientConfigTest, equalityOperator) {
ASSERT_NO_THROW(test_config.reset(new D2ClientConfig(true,
ref_address, 477,
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
- true, true, true, true, true, true,
+ true, true, true, true, true,
"bogus", "suf-fix")));
ASSERT_TRUE(test_config);
EXPECT_FALSE(*ref_config == *test_config);
@@ -241,14 +227,14 @@ TEST(D2ClientConfigTest, equalityOperator) {
ASSERT_NO_THROW(test_config.reset(new D2ClientConfig(true,
ref_address, 477,
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
- true, true, true, true, true, true,
+ true, true, true, true, true,
"pre-fix", "bogus")));
ASSERT_TRUE(test_config);
EXPECT_FALSE(*ref_config == *test_config);
EXPECT_TRUE(*ref_config != *test_config);
}
-// This test checks the D2ClientMgr constructor.
+/// @brief Checks the D2ClientMgr constructor.
TEST(D2ClientMgr, constructor) {
D2ClientMgrPtr d2_client_mgr;
@@ -262,12 +248,12 @@ TEST(D2ClientMgr, constructor) {
EXPECT_FALSE(original_config->getEnableUpdates());
// Make sure convenience method agrees.
- EXPECT_FALSE(d2_client_mgr->isDhcpDdnsEnabled());
+ EXPECT_FALSE(d2_client_mgr->ddnsEnabled());
}
-// This test checks passing the D2ClientMgr a valid D2 client configuration.
-// @todo Once NameChangeSender is integrated, this test needs to expand, and
-// additional scenario tests will need to be written.
+/// @brief Checks passing the D2ClientMgr a valid D2 client configuration.
+/// @todo Once NameChangeSender is integrated, this test needs to expand, and
+/// additional scenario tests will need to be written.
TEST(D2ClientMgr, validConfig) {
D2ClientMgrPtr d2_client_mgr;
@@ -284,7 +270,7 @@ TEST(D2ClientMgr, validConfig) {
ASSERT_NO_THROW(new_cfg.reset(new D2ClientConfig(true,
isc::asiolink::IOAddress("127.0.0.1"), 477,
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
- true, true, true, true, true, true,
+ true, true, true, true, true,
"pre-fix", "suf-fix")));
// Verify that we can assign a new, non-empty configuration.
@@ -296,7 +282,7 @@ TEST(D2ClientMgr, validConfig) {
EXPECT_TRUE(updated_config->getEnableUpdates());
// Make sure convenience method agrees with the updated configuration.
- EXPECT_TRUE(d2_client_mgr->isDhcpDdnsEnabled());
+ EXPECT_TRUE(d2_client_mgr->ddnsEnabled());
// Make sure the configuration we fetched is the one we assigned,
// and not the original configuration.
diff --git a/src/lib/dhcpsrv/tests/dhcp_parsers_unittest.cc b/src/lib/dhcpsrv/tests/dhcp_parsers_unittest.cc
index c539678..eb5ec8f 100644
--- a/src/lib/dhcpsrv/tests/dhcp_parsers_unittest.cc
+++ b/src/lib/dhcpsrv/tests/dhcp_parsers_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2012-2013 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012-2014 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
@@ -682,7 +682,7 @@ TEST_F(ParseConfigTest, validHooksLibrariesTest) {
// Check with a set of libraries, some of which are invalid.
TEST_F(ParseConfigTest, invalidHooksLibrariesTest) {
- // @todo Initialize global library context to null
+ /// @todo Initialize global library context to null
// Configuration string. This contains an invalid library which should
// trigger an error in the "build" stage.
@@ -711,18 +711,17 @@ TEST_F(ParseConfigTest, invalidHooksLibrariesTest) {
/// @brief Checks that a valid, enabled D2 client configuration works correctly.
TEST_F(ParseConfigTest, validD2Config) {
- // Configuration string. This contains a set of valid libraries.
+ // Configuration string containing valid values.
std::string config_str =
"{ \"dhcp-ddns\" :"
" {"
" \"enable-updates\" : true, "
" \"server-ip\" : \"192.168.2.1\", "
- " \"server-port\" : 5301, "
+ " \"server-port\" : 3432, "
" \"ncr-protocol\" : \"UDP\", "
" \"ncr-format\" : \"JSON\", "
" \"remove-on-renew\" : true, "
" \"always-include-fqdn\" : true, "
- " \"allow-client-update\" : true, "
" \"override-no-update\" : true, "
" \"override-client-update\" : true, "
" \"replace-client-name\" : true, "
@@ -736,7 +735,7 @@ TEST_F(ParseConfigTest, validD2Config) {
ASSERT_TRUE(rcode == 0) << error_text_;
// Verify that DHCP-DDNS is enabled and we can fetch the configuration.
- EXPECT_TRUE(CfgMgr::instance().isDhcpDdnsEnabled());
+ EXPECT_TRUE(CfgMgr::instance().ddnsEnabled());
D2ClientConfigPtr d2_client_config;
ASSERT_NO_THROW(d2_client_config = CfgMgr::instance().getD2ClientConfig());
ASSERT_TRUE(d2_client_config);
@@ -744,17 +743,60 @@ TEST_F(ParseConfigTest, validD2Config) {
// Verify that the configuration values are as expected.
EXPECT_TRUE(d2_client_config->getEnableUpdates());
EXPECT_EQ("192.168.2.1", d2_client_config->getServerIp().toText());
- EXPECT_EQ(5301, d2_client_config->getServerPort());
+ EXPECT_EQ(3432, d2_client_config->getServerPort());
EXPECT_EQ(dhcp_ddns::NCR_UDP, d2_client_config->getNcrProtocol());
EXPECT_EQ(dhcp_ddns::FMT_JSON, d2_client_config->getNcrFormat());
EXPECT_TRUE(d2_client_config->getRemoveOnRenew());
EXPECT_TRUE(d2_client_config->getAlwaysIncludeFqdn());
- EXPECT_TRUE(d2_client_config->getAllowClientUpdate());
EXPECT_TRUE(d2_client_config->getOverrideNoUpdate());
EXPECT_TRUE(d2_client_config->getOverrideClientUpdate());
EXPECT_TRUE(d2_client_config->getReplaceClientName());
EXPECT_EQ("test.prefix", d2_client_config->getGeneratedPrefix());
EXPECT_EQ("test.suffix.", d2_client_config->getQualifyingSuffix());
+
+ // Another valid Configuration string.
+ // This one has IPV6 server ip, control flags false,
+ // empty prefix/suffix
+ std::string config_str2 =
+ "{ \"dhcp-ddns\" :"
+ " {"
+ " \"enable-updates\" : true, "
+ " \"server-ip\" : \"3005::1\", "
+ " \"server-port\" : 43567, "
+ " \"ncr-protocol\" : \"UDP\", "
+ " \"ncr-format\" : \"JSON\", "
+ " \"remove-on-renew\" : false, "
+ " \"always-include-fqdn\" : false, "
+ " \"override-no-update\" : false, "
+ " \"override-client-update\" : false, "
+ " \"replace-client-name\" : false, "
+ " \"generated-prefix\" : \"\", "
+ " \"qualifying-suffix\" : \"\" "
+ " }"
+ "}";
+
+ // Verify that the configuration string parses.
+ rcode = parseConfiguration(config_str2);
+ ASSERT_TRUE(rcode == 0) << error_text_;
+
+ // Verify that DHCP-DDNS is enabled and we can fetch the configuration.
+ EXPECT_TRUE(CfgMgr::instance().ddnsEnabled());
+ ASSERT_NO_THROW(d2_client_config = CfgMgr::instance().getD2ClientConfig());
+ ASSERT_TRUE(d2_client_config);
+
+ // Verify that the configuration values are as expected.
+ EXPECT_TRUE(d2_client_config->getEnableUpdates());
+ EXPECT_EQ("3005::1", d2_client_config->getServerIp().toText());
+ EXPECT_EQ(43567, d2_client_config->getServerPort());
+ EXPECT_EQ(dhcp_ddns::NCR_UDP, d2_client_config->getNcrProtocol());
+ EXPECT_EQ(dhcp_ddns::FMT_JSON, d2_client_config->getNcrFormat());
+ EXPECT_FALSE(d2_client_config->getRemoveOnRenew());
+ EXPECT_FALSE(d2_client_config->getAlwaysIncludeFqdn());
+ EXPECT_FALSE(d2_client_config->getOverrideNoUpdate());
+ EXPECT_FALSE(d2_client_config->getOverrideClientUpdate());
+ EXPECT_FALSE(d2_client_config->getReplaceClientName());
+ EXPECT_EQ("", d2_client_config->getGeneratedPrefix());
+ EXPECT_EQ("", d2_client_config->getQualifyingSuffix());
}
/// @brief Checks that D2 client can be configured with enable flag of
@@ -774,7 +816,7 @@ TEST_F(ParseConfigTest, validDisabledD2Config) {
ASSERT_TRUE(rcode == 0) << error_text_;
// Verify that DHCP-DDNS is disabled.
- EXPECT_FALSE(CfgMgr::instance().isDhcpDdnsEnabled());
+ EXPECT_FALSE(CfgMgr::instance().ddnsEnabled());
// Make sure fetched config agrees.
D2ClientConfigPtr d2_client_config;
@@ -797,12 +839,11 @@ TEST_F(ParseConfigTest, invalidD2Config) {
" {"
" \"enable-updates\" : true, "
//" \"server-ip\" : \"192.168.2.1\", "
- " \"server-port\" : 5301, "
+ " \"server-port\" : 53001, "
" \"ncr-protocol\" : \"UDP\", "
" \"ncr-format\" : \"JSON\", "
" \"remove-on-renew\" : true, "
" \"always-include-fqdn\" : true, "
- " \"allow-client-update\" : true, "
" \"override-no-update\" : true, "
" \"override-client-update\" : true, "
" \"replace-client-name\" : true, "
@@ -815,12 +856,11 @@ TEST_F(ParseConfigTest, invalidD2Config) {
" {"
" \"enable-updates\" : true, "
" \"server-ip\" : \"x192.168.2.1\", "
- " \"server-port\" : 5301, "
+ " \"server-port\" : 53001, "
" \"ncr-protocol\" : \"UDP\", "
" \"ncr-format\" : \"JSON\", "
" \"remove-on-renew\" : true, "
" \"always-include-fqdn\" : true, "
- " \"allow-client-update\" : true, "
" \"override-no-update\" : true, "
" \"override-client-update\" : true, "
" \"replace-client-name\" : true, "
@@ -833,12 +873,11 @@ TEST_F(ParseConfigTest, invalidD2Config) {
" {"
" \"enable-updates\" : true, "
" \"server-ip\" : \"192.168.2.1\", "
- " \"server-port\" : 5301, "
+ " \"server-port\" : 53001, "
" \"ncr-protocol\" : \"Bogus\", "
" \"ncr-format\" : \"JSON\", "
" \"remove-on-renew\" : true, "
" \"always-include-fqdn\" : true, "
- " \"allow-client-update\" : true, "
" \"override-no-update\" : true, "
" \"override-client-update\" : true, "
" \"replace-client-name\" : true, "
@@ -851,12 +890,11 @@ TEST_F(ParseConfigTest, invalidD2Config) {
" {"
" \"enable-updates\" : true, "
" \"server-ip\" : \"192.168.2.1\", "
- " \"server-port\" : 5301, "
+ " \"server-port\" : 53001, "
" \"ncr-protocol\" : \"TCP\", "
" \"ncr-format\" : \"JSON\", "
" \"remove-on-renew\" : true, "
" \"always-include-fqdn\" : true, "
- " \"allow-client-update\" : true, "
" \"override-no-update\" : true, "
" \"override-client-update\" : true, "
" \"replace-client-name\" : true, "
@@ -869,12 +907,11 @@ TEST_F(ParseConfigTest, invalidD2Config) {
" {"
" \"enable-updates\" : true, "
" \"server-ip\" : \"192.168.2.1\", "
- " \"server-port\" : 5301, "
+ " \"server-port\" : 53001, "
" \"ncr-protocol\" : \"UDP\", "
" \"ncr-format\" : \"Bogus\", "
" \"remove-on-renew\" : true, "
" \"always-include-fqdn\" : true, "
- " \"allow-client-update\" : true, "
" \"override-no-update\" : true, "
" \"override-client-update\" : true, "
" \"replace-client-name\" : true, "
@@ -887,12 +924,11 @@ TEST_F(ParseConfigTest, invalidD2Config) {
" {"
" \"enable-updates\" : true, "
" \"server-ip\" : \"192.168.2.1\", "
- // " \"server-port\" : 5301, "
+ // " \"server-port\" : 53001, "
" \"ncr-protocol\" : \"UDP\", "
" \"ncr-format\" : \"JSON\", "
" \"remove-on-renew\" : true, "
" \"always-include-fqdn\" : true, "
- " \"allow-client-update\" : true, "
" \"override-no-update\" : true, "
" \"override-client-update\" : true, "
" \"replace-client-name\" : true, "
diff --git a/src/lib/dhcpsrv/tests/memfile_lease_mgr_unittest.cc b/src/lib/dhcpsrv/tests/memfile_lease_mgr_unittest.cc
index 85015f6..5712604 100644
--- a/src/lib/dhcpsrv/tests/memfile_lease_mgr_unittest.cc
+++ b/src/lib/dhcpsrv/tests/memfile_lease_mgr_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2012-2013 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012-2014 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
@@ -144,7 +144,7 @@ TEST_F(MemfileLeaseMgrTest, addGetDelete6) {
EXPECT_EQ(Lease6Ptr(), x);
}
-// @todo Write more memfile tests
+/// @todo Write more memfile tests
// Simple test about lease4 retrieval through client id method
TEST_F(MemfileLeaseMgrTest, getLease4ClientId) {
diff --git a/src/lib/dhcpsrv/tests/mysql_lease_mgr_unittest.cc b/src/lib/dhcpsrv/tests/mysql_lease_mgr_unittest.cc
index d5e00ab..578ef3c 100644
--- a/src/lib/dhcpsrv/tests/mysql_lease_mgr_unittest.cc
+++ b/src/lib/dhcpsrv/tests/mysql_lease_mgr_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2012-2013 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012-2014 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
@@ -549,7 +549,7 @@ TEST_F(MySqlLeaseMgrTest, getLease4Hwaddr) {
}
// Get the leases matching the hardware address of lease 1
- // @todo: Simply use HWAddr directly once 2589 is implemented
+ /// @todo: Simply use HWAddr directly once 2589 is implemented
HWAddr tmp(leases[1]->hwaddr_, HTYPE_ETHER);
Lease4Collection returned = lmptr_->getLease4(tmp);
@@ -568,14 +568,14 @@ TEST_F(MySqlLeaseMgrTest, getLease4Hwaddr) {
EXPECT_EQ(straddress4_[5], addresses[2]);
// Repeat test with just one expected match
- // @todo: Simply use HWAddr directly once 2589 is implemented
+ /// @todo: Simply use HWAddr directly once 2589 is implemented
returned = lmptr_->getLease4(HWAddr(leases[2]->hwaddr_, HTYPE_ETHER));
ASSERT_EQ(1, returned.size());
detailCompareLease(leases[2], *returned.begin());
// Check that an empty vector is valid
EXPECT_TRUE(leases[7]->hwaddr_.empty());
- // @todo: Simply use HWAddr directly once 2589 is implemented
+ /// @todo: Simply use HWAddr directly once 2589 is implemented
returned = lmptr_->getLease4(HWAddr(leases[7]->hwaddr_, HTYPE_ETHER));
ASSERT_EQ(1, returned.size());
detailCompareLease(leases[7], *returned.begin());
@@ -599,7 +599,7 @@ TEST_F(MySqlLeaseMgrTest, getLease4HwaddrSize) {
for (uint8_t i = 0; i <= HWAddr::MAX_HWADDR_LEN; ++i) {
leases[1]->hwaddr_.resize(i, i);
EXPECT_TRUE(lmptr_->addLease(leases[1]));
- // @todo: Simply use HWAddr directly once 2589 is implemented
+ /// @todo: Simply use HWAddr directly once 2589 is implemented
Lease4Collection returned =
lmptr_->getLease4(HWAddr(leases[1]->hwaddr_, HTYPE_ETHER));
@@ -610,7 +610,7 @@ TEST_F(MySqlLeaseMgrTest, getLease4HwaddrSize) {
// Database should not let us add one that is too big
// (The 42 is a random value put in each byte of the address.)
- // @todo: 2589 will make this test impossible
+ /// @todo: 2589 will make this test impossible
leases[1]->hwaddr_.resize(HWAddr::MAX_HWADDR_LEN + 100, 42);
EXPECT_THROW(lmptr_->addLease(leases[1]), isc::dhcp::DbOperationError);
}
@@ -628,7 +628,7 @@ TEST_F(MySqlLeaseMgrTest, getLease4HwaddrSubnetId) {
// Get the leases matching the hardware address of lease 1 and
// subnet ID of lease 1. Result should be a single lease - lease 1.
- // @todo: Simply use HWAddr directly once 2589 is implemented
+ /// @todo: Simply use HWAddr directly once 2589 is implemented
Lease4Ptr returned = lmptr_->getLease4(HWAddr(leases[1]->hwaddr_,
HTYPE_ETHER), leases[1]->subnet_id_);
@@ -637,7 +637,7 @@ TEST_F(MySqlLeaseMgrTest, getLease4HwaddrSubnetId) {
// Try for a match to the hardware address of lease 1 and the wrong
// subnet ID.
- // @todo: Simply use HWAddr directly once 2589 is implemented
+ /// @todo: Simply use HWAddr directly once 2589 is implemented
returned = lmptr_->getLease4(HWAddr(leases[1]->hwaddr_, HTYPE_ETHER),
leases[1]->subnet_id_ + 1);
EXPECT_FALSE(returned);
@@ -645,14 +645,14 @@ TEST_F(MySqlLeaseMgrTest, getLease4HwaddrSubnetId) {
// Try for a match to the subnet ID of lease 1 (and lease 4) but
// the wrong hardware address.
vector<uint8_t> invalid_hwaddr(15, 0x77);
- // @todo: Simply use HWAddr directly once 2589 is implemented
+ /// @todo: Simply use HWAddr directly once 2589 is implemented
returned = lmptr_->getLease4(HWAddr(invalid_hwaddr, HTYPE_ETHER),
leases[1]->subnet_id_);
EXPECT_FALSE(returned);
// Try for a match to an unknown hardware address and an unknown
// subnet ID.
- // @todo: Simply use HWAddr directly once 2589 is implemented
+ /// @todo: Simply use HWAddr directly once 2589 is implemented
returned = lmptr_->getLease4(HWAddr(invalid_hwaddr, HTYPE_ETHER),
leases[1]->subnet_id_ + 1);
EXPECT_FALSE(returned);
@@ -665,7 +665,7 @@ TEST_F(MySqlLeaseMgrTest, getLease4HwaddrSubnetId) {
EXPECT_TRUE(lmptr_->deleteLease(leases[2]->addr_));
leases[1]->addr_ = leases[2]->addr_;
EXPECT_TRUE(lmptr_->addLease(leases[1]));
- // @todo: Simply use HWAddr directly once 2589 is implemented
+ /// @todo: Simply use HWAddr directly once 2589 is implemented
EXPECT_THROW(returned = lmptr_->getLease4(HWAddr(leases[1]->hwaddr_,
HTYPE_ETHER),
leases[1]->subnet_id_),
@@ -687,7 +687,7 @@ TEST_F(MySqlLeaseMgrTest, getLease4HwaddrSubnetIdSize) {
for (uint8_t i = 0; i <= HWAddr::MAX_HWADDR_LEN; ++i) {
leases[1]->hwaddr_.resize(i, i);
EXPECT_TRUE(lmptr_->addLease(leases[1]));
- // @todo: Simply use HWAddr directly once 2589 is implemented
+ /// @todo: Simply use HWAddr directly once 2589 is implemented
Lease4Ptr returned = lmptr_->getLease4(HWAddr(leases[1]->hwaddr_,
HTYPE_ETHER),
leases[1]->subnet_id_);
More information about the bind10-changes
mailing list