D2CfgContext::D2CfgContext()
: d2_params_(new D2Params()),
- forward_mgr_(new DdnsDomainListMgr("forward_mgr")),
- reverse_mgr_(new DdnsDomainListMgr("reverse_mgr")),
+ forward_mgr_(new DdnsDomainListMgr("forward-ddns")),
+ reverse_mgr_(new DdnsDomainListMgr("reverse-ddns")),
keys_(new TSIGKeyInfoMap()) {
}
D2CfgMgr::D2CfgMgr() : DCfgMgrBase(DCfgContextBasePtr(new D2CfgContext())) {
// TSIG keys need to parse before the Domains, so we can catch Domains
// that specify undefined keys. Create the necessary parsing order now.
- addToParseOrder("tsig_keys");
- addToParseOrder("forward_ddns");
- addToParseOrder("reverse_ddns");
+ addToParseOrder("tsig-keys");
+ addToParseOrder("forward-ddns");
+ addToParseOrder("reverse-ddns");
}
D2CfgMgr::~D2CfgMgr() {
isc::dhcp::StringStoragePtr strings = context->getStringStorage();
asiolink::IOAddress ip_address(D2Params::DFT_IP_ADDRESS);
- std::string ip_address_str = strings->getOptionalParam("ip_address",
+ std::string ip_address_str = strings->getOptionalParam("ip-address",
D2Params::
DFT_IP_ADDRESS);
try {
} catch (const std::exception& ex) {
isc_throw(D2CfgError, "IP address invalid : \""
<< ip_address_str << "\" ("
- << strings->getPosition("ip_address") << ")");
+ << strings->getPosition("ip-address") << ")");
}
if ((ip_address.toText() == "0.0.0.0") || (ip_address.toText() == "::")) {
isc_throw(D2CfgError, "IP address cannot be \"" << ip_address << "\" ("
- << strings->getPosition("ip_address") << ")");
+ << strings->getPosition("ip-address") << ")");
}
// Fetch and validate port.
// Fetch and validate dns_server_timeout.
uint32_t dns_server_timeout
- = ints->getOptionalParam("dns_server_timeout",
+ = ints->getOptionalParam("dns-server-timeout",
D2Params::DFT_DNS_SERVER_TIMEOUT);
if (dns_server_timeout < 1) {
isc_throw(D2CfgError, "DNS server timeout must be larger than 0 ("
- << ints->getPosition("dns_server_timeout") << ")");
+ << ints->getPosition("dns-server-timeout") << ")");
}
// Fetch and validate ncr_protocol.
try {
ncr_protocol = dhcp_ddns::
stringToNcrProtocol(strings->
- getOptionalParam("ncr_protocol",
+ getOptionalParam("ncr-protocol",
D2Params::
DFT_NCR_PROTOCOL));
} catch (const std::exception& ex) {
- isc_throw(D2CfgError, "ncr_protocol : "
+ isc_throw(D2CfgError, "ncr-protocol : "
<< ex.what() << " ("
- << strings->getPosition("ncr_protocol") << ")");
+ << strings->getPosition("ncr-protocol") << ")");
}
if (ncr_protocol != dhcp_ddns::NCR_UDP) {
- isc_throw(D2CfgError, "ncr_protocol : "
+ isc_throw(D2CfgError, "ncr-protocol : "
<< dhcp_ddns::ncrProtocolToString(ncr_protocol)
<< " is not yet supported ("
- << strings->getPosition("ncr_protocol") << ")");
+ << strings->getPosition("ncr-protocol") << ")");
}
// Fetch and validate ncr_format.
try {
ncr_format = dhcp_ddns::
stringToNcrFormat(strings->
- getOptionalParam("ncr_format",
+ getOptionalParam("ncr-format",
D2Params::
DFT_NCR_FORMAT));
} catch (const std::exception& ex) {
- isc_throw(D2CfgError, "ncr_format : "
+ isc_throw(D2CfgError, "ncr-format : "
<< ex.what() << " ("
- << strings->getPosition("ncr_format") << ")");
+ << strings->getPosition("ncr-format") << ")");
}
if (ncr_format != dhcp_ddns::FMT_JSON) {
isc_throw(D2CfgError, "NCR Format:"
<< dhcp_ddns::ncrFormatToString(ncr_format)
<< " is not yet supported ("
- << strings->getPosition("ncr_format") << ")");
+ << strings->getPosition("ncr-format") << ")");
}
// Attempt to create the new client config. This ought to fly as
// Create parser instance based on element_id.
isc::dhcp::ParserPtr parser;
if ((config_id.compare("port") == 0) ||
- (config_id.compare("dns_server_timeout") == 0)) {
+ (config_id.compare("dns-server-timeout") == 0)) {
parser.reset(new isc::dhcp::Uint32Parser(config_id,
context->getUint32Storage()));
- } else if ((config_id.compare("ip_address") == 0) ||
- (config_id.compare("ncr_protocol") == 0) ||
- (config_id.compare("ncr_format") == 0)) {
+ } else if ((config_id.compare("ip-address") == 0) ||
+ (config_id.compare("ncr-protocol") == 0) ||
+ (config_id.compare("ncr-format") == 0)) {
parser.reset(new isc::dhcp::StringParser(config_id,
context->getStringStorage()));
- } else if (config_id == "forward_ddns") {
- parser.reset(new DdnsDomainListMgrParser("forward_mgr",
+ } else if (config_id == "forward-ddns") {
+ parser.reset(new DdnsDomainListMgrParser("forward-ddns",
context->getForwardMgr(),
context->getKeys()));
- } else if (config_id == "reverse_ddns") {
- parser.reset(new DdnsDomainListMgrParser("reverse_mgr",
+ } else if (config_id == "reverse-ddns") {
+ parser.reset(new DdnsDomainListMgrParser("reverse-ddns",
context->getReverseMgr(),
context->getKeys()));
- } else if (config_id == "tsig_keys") {
- parser.reset(new TSIGKeyInfoListParser("tsig_key_list",
+ } else if (config_id == "tsig-keys") {
+ parser.reset(new TSIGKeyInfoListParser("tsig-key-list",
context->getKeys()));
} else {
isc_throw(NotImplemented,
D2Params::toText() const {
std::ostringstream stream;
- stream << ", ip_address: " << ip_address_.toText()
+ stream << ", ip-address: " << ip_address_.toText()
<< ", port: " << port_
- << ", dns_server_timeout_: " << dns_server_timeout_
- << ", ncr_protocol: "
+ << ", dns-server-timeout_: " << dns_server_timeout_
+ << ", ncr-protocol: "
<< dhcp_ddns::ncrProtocolToString(ncr_protocol_)
- << ", ncr_format: " << ncr_format_
+ << ", ncr-format: " << ncr_format_
<< dhcp_ddns::ncrFormatToString(ncr_format_);
return (stream.str());
try {
pos["name"] = local_scalars_.getParam("name", name);
pos["algorithm"] = local_scalars_.getParam("algorithm", algorithm);
- pos["digest_bits"] = local_scalars_.getParam("digest_bits", digestbits,
+ pos["digest-bits"] = local_scalars_.getParam("digest-bits", digestbits,
DCfgContextBase::OPTIONAL);
pos["secret"] = local_scalars_.getParam("secret", secret);
} catch (const std::exception& ex) {
if (digestbits > 0) {
if ((digestbits % 8) != 0) {
isc_throw(D2CfgError, "Invalid TSIG key digest_bits specified : " <<
- digestbits << " (" << pos["digest_bits"] << ")");
+ digestbits << " (" << pos["digest-bits"] << ")");
}
if (digestbits < 80) {
isc_throw(D2CfgError, "TSIG key digest_bits too small : " <<
- digestbits << " (" << pos["digest_bits"] << ")");
+ digestbits << " (" << pos["digest-bits"] << ")");
}
if (boost::iequals(algorithm, TSIGKeyInfo::HMAC_SHA224_STR)) {
if (digestbits < 112) {
isc_throw(D2CfgError, "TSIG key digest_bits too small : " <<
- digestbits << " (" << pos["digest_bits"]
+ digestbits << " (" << pos["digest-bits"]
<< ")");
}
} else if (boost::iequals(algorithm, TSIGKeyInfo::HMAC_SHA256_STR)) {
if (digestbits < 128) {
isc_throw(D2CfgError, "TSIG key digest_bits too small : " <<
- digestbits << " (" << pos["digest_bits"]
+ digestbits << " (" << pos["digest-bits"]
<< ")");
}
} else if (boost::iequals(algorithm, TSIGKeyInfo::HMAC_SHA384_STR)) {
if (digestbits < 192) {
isc_throw(D2CfgError, "TSIG key digest_bits too small : " <<
- digestbits << " (" << pos["digest_bits"]
+ digestbits << " (" << pos["digest-bits"]
<< ")");
}
} else if (boost::iequals(algorithm, TSIGKeyInfo::HMAC_SHA512_STR)) {
if (digestbits < 256) {
isc_throw(D2CfgError, "TSIG key digest_bits too small : " <<
- digestbits << " (" << pos["digest_bits"]
+ digestbits << " (" << pos["digest-bits"]
<< ")");
}
}
(config_id == "secret")) {
parser = new isc::dhcp::StringParser(config_id,
local_scalars_.getStringStorage());
- } else if (config_id == "digest_bits") {
+ } else if (config_id == "digest-bits") {
parser = new isc::dhcp::Uint32Parser(config_id,
local_scalars_.getUint32Storage());
} else {
// local storage. They're all optional, so no try-catch here.
pos["hostname"] = local_scalars_.getParam("hostname", hostname,
DCfgContextBase::OPTIONAL);
- pos["ip_address"] = local_scalars_.getParam("ip_address", ip_address,
+ pos["ip-address"] = local_scalars_.getParam("ip-address", ip_address,
DCfgContextBase::OPTIONAL);
pos["port"] = local_scalars_.getParam("port", port,
DCfgContextBase::OPTIONAL);
serverInfo.reset(new DnsServerInfo(hostname, io_addr, port));
} catch (const isc::asiolink::IOError& ex) {
isc_throw(D2CfgError, "Dns Server : invalid IP address : "
- << ip_address << " (" << pos["ip_address"] << ")");
+ << ip_address << " (" << pos["ip-address"] << ")");
}
}
// Based on the configuration id of the element, create the appropriate
// parser. Scalars are set to use the parser's local scalar storage.
if ((config_id == "hostname") ||
- (config_id == "ip_address")) {
+ (config_id == "ip-address")) {
parser = new isc::dhcp::StringParser(config_id,
local_scalars_.getStringStorage());
} else if (config_id == "port") {
// Any required that are missing will throw.
try {
pos["name"] = local_scalars_.getParam("name", name);
- pos["key_name"] = local_scalars_.getParam("key_name", key_name,
+ pos["key-name"] = local_scalars_.getParam("key-name", key_name,
DCfgContextBase::OPTIONAL);
} catch (const std::exception& ex) {
isc_throw(D2CfgError, "DdnsDomain incomplete : " << ex.what()
if (!tsig_key_info) {
isc_throw(D2CfgError, "DdnsDomain : " << name
<< " specifies an undefined key: " << key_name
- << " (" << pos["key_name"] << ")");
+ << " (" << pos["key-name"] << ")");
}
}
// Based on the configuration id of the element, create the appropriate
// parser. Scalars are set to use the parser's local scalar storage.
if ((config_id == "name") ||
- (config_id == "key_name")) {
+ (config_id == "key-name")) {
parser = new isc::dhcp::StringParser(config_id,
local_scalars_.getStringStorage());
- } else if (config_id == "dns_servers") {
+ } else if (config_id == "dns-servers") {
// Server list parser is given in our local server storage. It will pass
// this down to its server parsers and is where they will write their
// server instances upon commit.
const isc::data::Element::
Position& pos) {
DhcpConfigParser* parser = NULL;
- if (config_id == "ddns_domains") {
+ if (config_id == "ddns-domains") {
// Domain list parser is given our local domain storage. It will pass
// this down to its domain parsers and is where they will write their
// domain instances upon commit.
/// @code
/// {
/// "interface" : "eth1" ,
-/// "ip_address" : "192.168.1.33" ,
+/// "ip-address" : "192.168.1.33" ,
/// "port" : 88 ,
-/// "tsig_keys":
+/// "tsig-keys":
//// [
/// {
/// "name": "d2_key.tmark.org" ,
/// "secret": "0123456989"
/// }
/// ],
-/// "forward_ddns" :
+/// "forward-ddns" :
/// {
-/// "ddns_domains":
+/// "ddns-domains":
/// [
/// {
/// "name": "tmark.org." ,
-/// "key_name": "d2_key.tmark.org" ,
-/// "dns_servers" :
+/// "key-name": "d2_key.tmark.org" ,
+/// "dns-servers" :
/// [
/// { "hostname": "fserver.tmark.org" },
/// { "hostname": "f2server.tmark.org" }
/// },
/// {
/// "name": "pub.tmark.org." ,
-/// "key_name": "d2_key.tmark.org" ,
-/// "dns_servers" :
+/// "key-name": "d2_key.tmark.org" ,
+/// "dns-servers" :
/// [
/// { "hostname": "f3server.tmark.org" }
/// ]
/// }
/// ]
/// },
-/// "reverse_ddns" :
+/// "reverse-ddns" :
/// {
-/// "ddns_domains":
+/// "ddns-domains":
/// [
/// {
/// "name": " 0.168.192.in.addr.arpa." ,
-/// "key_name": "d2_key.tmark.org" ,
-/// "dns_servers" :
+/// "key-name": "d2_key.tmark.org" ,
+/// "dns-servers" :
/// [
-/// { "ip_address": "127.0.0.101" , "port": 100 }
+/// { "ip-address": "127.0.0.101" , "port": 100 }
/// ]
/// }
/// ]
/// @brief Parser for TSIGKeyInfo
///
-/// This class parses the configuration element "tsig_key" defined in
+/// This class parses the configuration element "tsig-key" defined in
/// src/bin/d2/dhcp-ddns.spec and creates an instance of a TSIGKeyInfo.
class TSIGKeyInfoParser : public isc::dhcp::DhcpConfigParser {
public:
/// @brief Destructor
virtual ~TSIGKeyInfoParser();
- /// @brief Performs the actual parsing of the given "tsig_key" element.
+ /// @brief Performs the actual parsing of the given "tsig-key" element.
///
/// Parses a configuration for the elements needed to instantiate a
/// TSIGKeyInfo, validates those entries, creates a TSIGKeyInfo instance
/// then attempts to add to a list of keys
///
- /// @param key_config is the "tsig_key" configuration to parse
+ /// @param key_config is the "tsig-key" configuration to parse
virtual void build(isc::data::ConstElementPtr key_config);
- /// @brief Creates a parser for the given "tsig_key" member element id.
+ /// @brief Creates a parser for the given "tsig-key" member element id.
///
/// The key elements currently supported are(see dhcp-ddns.spec):
/// 1. name
/// 4. secret
///
/// @param config_id is the "item_name" for a specific member element of
- /// the "tsig_key" specification.
+ /// the "tsig-key" specification.
/// @param pos position within the configuration text (or file) of element
/// to be parsed. This is passed for error messaging.
///
/// @brief Parser for a list of TSIGKeyInfos
///
-/// This class parses a list of "tsig_key" configuration elements.
+/// This class parses a list of "tsig-key" configuration elements.
/// (see src/bin/d2/dhcp-ddns.spec). The TSIGKeyInfo instances are added
/// to the given storage upon commit.
class TSIGKeyInfoListParser : public isc::dhcp::DhcpConfigParser {
/// @brief Destructor
virtual ~TSIGKeyInfoListParser();
- /// @brief Performs the parsing of the given list "tsig_key" elements.
+ /// @brief Performs the parsing of the given list "tsig-key" elements.
///
/// It iterates over each key entry in the list:
/// 1. Instantiate a TSIGKeyInfoParser for the entry
/// @brief Parser for DnsServerInfo
///
-/// This class parses the configuration element "dns_server" defined in
+/// This class parses the configuration element "dns-server" defined in
/// src/bin/d2/dhcp-ddns.spec and creates an instance of a DnsServerInfo.
class DnsServerInfoParser : public isc::dhcp::DhcpConfigParser {
public:
/// @brief Destructor
virtual ~DnsServerInfoParser();
- /// @brief Performs the actual parsing of the given "dns_server" element.
+ /// @brief Performs the actual parsing of the given "dns-server" element.
///
/// Parses a configuration for the elements needed to instantiate a
/// DnsServerInfo, validates those entries, creates a DnsServerInfo instance
/// then attempts to add to a list of servers.
///
- /// @param server_config is the "dns_server" configuration to parse
+ /// @param server_config is the "dns-server" configuration to parse
///
/// @throw D2CfgError if:
/// -# hostname is not blank, hostname is not yet supported
/// -# port is 0
virtual void build(isc::data::ConstElementPtr server_config);
- /// @brief Creates a parser for the given "dns_server" member element id.
+ /// @brief Creates a parser for the given "dns-server" member element id.
///
/// The server elements currently supported are(see dhcp-ddns.spec):
/// 1. hostname
/// 3. port
///
/// @param config_id is the "item_name" for a specific member element of
- /// the "dns_server" specification.
+ /// the "dns-server" specification.
/// @param pos position within the configuration text (or file) of element
/// to be parsed. This is passed for error messaging.
///
/// @brief Parser for a list of DnsServerInfos
///
-/// This class parses a list of "dns_server" configuration elements.
+/// This class parses a list of "dns-server" configuration elements.
/// (see src/bin/d2/dhcp-ddns.spec). The DnsServerInfo instances are added
/// to the given storage upon commit.
class DnsServerInfoListParser : public isc::dhcp::DhcpConfigParser {
/// @brief Destructor
virtual ~DnsServerInfoListParser();
- /// @brief Performs the actual parsing of the given list "dns_server"
+ /// @brief Performs the actual parsing of the given list "dns-server"
/// elements.
/// It iterates over each server entry in the list:
/// 1. Instantiate a DnsServerInfoParser for the entry
/// The net effect is to parse all of the server entries in the list
/// prepping them for commit.
///
- /// @param server_list_config is the list of "dns_server" elements to parse.
+ /// @param server_list_config is the list of "dns-server" elements to parse.
virtual void build(isc::data::ConstElementPtr server_list_config);
/// @brief Commits the list of DnsServerInfos
/// @brief Parser for DdnsDomain
///
-/// This class parses the configuration element "ddns_domain" defined in
+/// This class parses the configuration element "ddns-domain" defined in
/// src/bin/d2/dhcp-ddns.spec and creates an instance of a DdnsDomain.
class DdnsDomainParser : public isc::dhcp::DhcpConfigParser {
public:
///
/// @param entry_name is an arbitrary label assigned to this configuration
/// definition. Since domains are specified in a list this value is likely
- /// be something akin to "forward_ddns:0", set during parsing.
+ /// be something akin to "forward-ddns:0", set during parsing.
/// @param domains is a pointer to the storage area to which the parser
/// @param keys is a pointer to a map of the defined TSIG keys.
/// should commit the newly created DdnsDomain instance.
/// @brief Destructor
virtual ~DdnsDomainParser();
- /// @brief Performs the actual parsing of the given "ddns_domain" element.
+ /// @brief Performs the actual parsing of the given "ddns-domain" element.
///
/// Parses a configuration for the elements needed to instantiate a
/// DdnsDomain, validates those entries, creates a DdnsDomain instance
/// then attempts to add it to a list of domains.
///
- /// @param domain_config is the "ddns_domain" configuration to parse
+ /// @param domain_config is the "ddns-domain" configuration to parse
virtual void build(isc::data::ConstElementPtr domain_config);
- /// @brief Creates a parser for the given "ddns_domain" member element id.
+ /// @brief Creates a parser for the given "ddns-domain" member element id.
///
/// The domain elements currently supported are(see dhcp-ddns.spec):
/// 1. name
/// 3. dns_servers
///
/// @param config_id is the "item_name" for a specific member element of
- /// the "ddns_domain" specification.
+ /// the "ddns-domain" specification.
/// @param pos position within the configuration text (or file) of element
/// to be parsed. This is passed for error messaging.
///
/// @brief Parser for a list of DdnsDomains
///
-/// This class parses a list of "ddns_domain" configuration elements.
+/// This class parses a list of "ddns-domain" configuration elements.
/// (see src/bin/d2/dhcp-ddns.spec). The DdnsDomain instances are added
/// to the given storage upon commit.
class DdnsDomainListParser : public isc::dhcp::DhcpConfigParser {
/// @brief Destructor
virtual ~DdnsDomainListParser();
- /// @brief Performs the actual parsing of the given list "ddns_domain"
+ /// @brief Performs the actual parsing of the given list "ddns-domain"
/// elements.
/// It iterates over each domain entry in the list:
/// 1. Instantiate a DdnsDomainParser for the entry
/// The net effect is to parse all of the domain entries in the list
/// prepping them for commit.
///
- /// @param domain_list_config is the list of "ddns_domain" elements to
+ /// @param domain_list_config is the list of "ddns-domain" elements to
/// parse.
virtual void build(isc::data::ConstElementPtr domain_list_config);
/// @brief Parser for DdnsDomainListMgr
///
-/// This class parses the configuration elements "forward_ddns" and
-/// "reverse_ddns" as defined in src/bin/d2/dhcp-ddns.spec. It populates the
+/// This class parses the configuration elements "forward-ddns" and
+/// "reverse-ddns" as defined in src/bin/d2/dhcp-ddns.spec. It populates the
/// given DdnsDomainListMgr with parsed information upon commit. Note that
/// unlike other parsers, this parser does NOT instantiate the final object
/// during the commit phase, it populates it. It must pre-exist.
"module_description": "DHPC-DDNS Service",
"config_data": [
{
- "item_name": "ip_address",
+ "item_name": "ip-address",
"item_type": "string",
"item_optional": false,
"item_default": "127.0.0.1"
"item_default": 53001
},
{
- "item_name": "dns_server_timeout",
+ "item_name": "dns-server-timeout",
"item_type": "integer",
"item_optional": true,
"item_default": 100
},
{
- "item_name": "ncr_protocol",
+ "item_name": "ncr-protocol",
"item_type": "string",
"item_optional": true,
"item_default": "UDP"
},
{
- "item_name": "ncr_format",
+ "item_name": "ncr-format",
"item_type": "string",
"item_optional": true,
"item_default": "JSON"
},
{
- "item_name": "tsig_keys",
+ "item_name": "tsig-keys",
"item_type": "list",
"item_optional": true,
"item_default": [],
"list_item_spec":
{
- "item_name": "tsig_key",
+ "item_name": "tsig-key",
"item_type": "map",
"item_optional": false,
"item_default": {"algorithm" : "HMAC-MD5"},
"item_default": ""
},
{
- "item_name": "digest_bits",
+ "item_name": "digest-bits",
"item_type": "integer",
"item_optional": true,
"item_default": 0
}
},
{
- "item_name": "forward_ddns",
+ "item_name": "forward-ddns",
"item_type": "map",
"item_optional": true,
"item_default": {},
"map_item_spec": [
{
- "item_name": "ddns_domains",
+ "item_name": "ddns-domains",
"item_type": "list",
"item_optional": false,
"item_default": [],
"list_item_spec":
{
- "item_name": "ddns_domain",
+ "item_name": "ddns-domain",
"item_type": "map",
"item_optional": false,
"item_default": {},
},
{
- "item_name": "key_name",
+ "item_name": "key-name",
"item_type": "string",
"item_optional": true,
"item_default": ""
},
{
- "item_name": "dns_servers",
+ "item_name": "dns-servers",
"item_type": "list",
"item_optional": false,
"item_default": [],
"list_item_spec":
{
- "item_name": "dns_server",
+ "item_name": "dns-server",
"item_type": "map",
"item_optional": false,
"item_default": {},
"item_default": ""
},
{
- "item_name": "ip_address",
+ "item_name": "ip-address",
"item_type": "string",
"item_optional": true,
"item_default": ""
},
{
- "item_name": "reverse_ddns",
+ "item_name": "reverse-ddns",
"item_type": "map",
"item_optional": true,
"item_default": {},
"map_item_spec": [
{
- "item_name": "ddns_domains",
+ "item_name": "ddns-domains",
"item_type": "list",
"item_optional": false,
"item_default": [],
"list_item_spec":
{
- "item_name": "ddns_domain",
+ "item_name": "ddns-domain",
"item_type": "map",
"item_optional": false,
"item_default": {},
},
{
- "item_name": "key_name",
+ "item_name": "key-name",
"item_type": "string",
"item_optional": true,
"item_default": ""
},
{
- "item_name": "dns_servers",
+ "item_name": "dns-servers",
"item_type": "list",
"item_optional": false,
"item_default": [],
"list_item_spec":
{
- "item_name": "dns_server",
+ "item_name": "dns-server",
"item_type": "map",
"item_optional": false,
"item_default": {},
"item_default": ""
},
{
- "item_name": "ip_address",
+ "item_name": "ip-address",
"item_type": "string",
"item_optional": true,
"item_default": ""
std::ostringstream config;
config <<
"{"
- " \"ip_address\": \"" << ip_address << "\" , "
+ " \"ip-address\": \"" << ip_address << "\" , "
" \"port\": " << port << " , "
- " \"dns_server_timeout\": " << dns_server_timeout << " , "
- " \"ncr_protocol\": \"" << ncr_protocol << "\" , "
- " \"ncr_format\": \"" << ncr_format << "\", "
- "\"tsig_keys\": [], "
- "\"forward_ddns\" : {}, "
- "\"reverse_ddns\" : {} "
+ " \"dns-server-timeout\": " << dns_server_timeout << " , "
+ " \"ncr-protocol\": \"" << ncr_protocol << "\" , "
+ " \"ncr-format\": \"" << ncr_format << "\", "
+ "\"tsig-keys\": [], "
+ "\"forward-ddns\" : {}, "
+ "\"reverse-ddns\" : {} "
"}";
return (config.str());
std::string config =
"{"
" \"port\": 777 , "
- " \"dns_server_timeout\": 333 , "
- " \"ncr_protocol\": \"UDP\" , "
- " \"ncr_format\": \"JSON\", "
- "\"tsig_keys\": [], "
- "\"forward_ddns\" : {}, "
- "\"reverse_ddns\" : {} "
+ " \"dns-server-timeout\": 333 , "
+ " \"ncr-protocol\": \"UDP\" , "
+ " \"ncr-format\": \"JSON\", "
+ "\"tsig-keys\": [], "
+ "\"forward-ddns\" : {}, "
+ "\"reverse-ddns\" : {} "
"}";
runConfig(config);
// Check that omitting port gets you its default
config =
"{"
- " \"ip_address\": \"192.0.0.1\" , "
- " \"dns_server_timeout\": 333 , "
- " \"ncr_protocol\": \"UDP\" , "
- " \"ncr_format\": \"JSON\", "
- "\"tsig_keys\": [], "
- "\"forward_ddns\" : {}, "
- "\"reverse_ddns\" : {} "
+ " \"ip-address\": \"192.0.0.1\" , "
+ " \"dns-server-timeout\": 333 , "
+ " \"ncr-protocol\": \"UDP\" , "
+ " \"ncr-format\": \"JSON\", "
+ "\"tsig-keys\": [], "
+ "\"forward-ddns\" : {}, "
+ "\"reverse-ddns\" : {} "
"}";
runConfig(config);
// Check that omitting timeout gets you its default
config =
"{"
- " \"ip_address\": \"192.0.0.1\" , "
+ " \"ip-address\": \"192.0.0.1\" , "
" \"port\": 777 , "
- " \"ncr_protocol\": \"UDP\" , "
- " \"ncr_format\": \"JSON\", "
- "\"tsig_keys\": [], "
- "\"forward_ddns\" : {}, "
- "\"reverse_ddns\" : {} "
+ " \"ncr-protocol\": \"UDP\" , "
+ " \"ncr-format\": \"JSON\", "
+ "\"tsig-keys\": [], "
+ "\"forward-ddns\" : {}, "
+ "\"reverse-ddns\" : {} "
"}";
runConfig(config);
// Check that protocol timeout gets you its default
config =
"{"
- " \"ip_address\": \"192.0.0.1\" , "
+ " \"ip-address\": \"192.0.0.1\" , "
" \"port\": 777 , "
- " \"dns_server_timeout\": 333 , "
- " \"ncr_format\": \"JSON\", "
- "\"tsig_keys\": [], "
- "\"forward_ddns\" : {}, "
- "\"reverse_ddns\" : {} "
+ " \"dns-server-timeout\": 333 , "
+ " \"ncr-format\": \"JSON\", "
+ "\"tsig-keys\": [], "
+ "\"forward-ddns\" : {}, "
+ "\"reverse-ddns\" : {} "
"}";
runConfig(config);
// Check that format timeout gets you its default
config =
"{"
- " \"ip_address\": \"192.0.0.1\" , "
+ " \"ip-address\": \"192.0.0.1\" , "
" \"port\": 777 , "
- " \"dns_server_timeout\": 333 , "
- " \"ncr_protocol\": \"UDP\", "
- "\"tsig_keys\": [], "
- "\"forward_ddns\" : {}, "
- "\"reverse_ddns\" : {} "
+ " \"dns-server-timeout\": 333 , "
+ " \"ncr-protocol\": \"UDP\", "
+ "\"tsig-keys\": [], "
+ "\"forward-ddns\" : {}, "
+ "\"reverse-ddns\" : {} "
"}";
runConfig(config);
// Check that an unsupported top level parameter fails.
std::string config =
"{"
- " \"ip_address\": \"127.0.0.1\", "
+ " \"ip-address\": \"127.0.0.1\", "
" \"port\": 777 , "
- " \"dns_server_timeout\": 333 , "
- " \"ncr_protocol\": \"UDP\" , "
- " \"ncr_format\": \"JSON\", "
- "\"tsig_keys\": [], "
- "\"forward_ddns\" : {}, "
- "\"reverse_ddns\" : {}, "
- "\"bogus_param\" : true "
+ " \"dns-server-timeout\": 333 , "
+ " \"ncr-protocol\": \"UDP\" , "
+ " \"ncr-format\": \"JSON\", "
+ "\"tsig-keys\": [], "
+ "\"forward-ddns\" : {}, "
+ "\"reverse-ddns\" : {}, "
+ "\"bogus-param\" : true "
"}";
runConfig(config, SHOULD_FAIL);
// D2 these fail as they are not in the parse order.
config =
"{"
- " \"ip_address\": \"127.0.0.1\", "
+ " \"ip-address\": \"127.0.0.1\", "
" \"port\": 777 , "
- " \"dns_server_timeout\": 333 , "
- " \"ncr_protocol\": \"UDP\" , "
- " \"ncr_format\": \"JSON\", "
- "\"tsig_keys\": [], "
- "\"bogus_object_one\" : {}, "
- "\"forward_ddns\" : {}, "
- "\"reverse_ddns\" : {}, "
- "\"bogus_object_two\" : {} "
+ " \"dns-server-timeout\": 333 , "
+ " \"ncr-protocol\": \"UDP\" , "
+ " \"ncr-format\": \"JSON\", "
+ "\"tsig-keys\": [], "
+ "\"bogus-object-one\" : {}, "
+ "\"forward-ddns\" : {}, "
+ "\"reverse-ddns\" : {}, "
+ "\"bogus-object-two\" : {} "
"}";
runConfig(config, SHOULD_FAIL);
std::string config = "{"
" \"name\": \"d2_key_one\" , "
" \"algorithm\": \"HMAC-MD5\" , "
- " \"digest_bits\": 120 , "
+ " \"digest-bits\": 120 , "
" \"secret\": \"dGhpcyBrZXkgd2lsbCBtYXRjaA==\" "
"}";
ASSERT_TRUE(fromJSON(config));
" { \"name\": \"key1\" , "
" \"algorithm\": \"HMAC-MD5\" ,"
- " \"digest_bits\": 120 , "
+ " \"digest-bits\": 120 , "
" \"secret\": \"GWG/Xfbju4O2iXGqkSu4PQ==\" "
" },"
// this entry has an invalid algorithm
" { \"name\": \"key2\" , "
" \"algorithm\": \"\" ,"
- " \"digest_bits\": 120 , "
+ " \"digest-bits\": 120 , "
" \"secret\": \"GWG/Xfbju4O2iXGqkSu4PQ==\" "
" },"
" { \"name\": \"key3\" , "
" { \"name\": \"key1\" , "
" \"algorithm\": \"HMAC-MD5\" ,"
- " \"digest_bits\": 120 , "
+ " \"digest-bits\": 120 , "
" \"secret\": \"GWG/Xfbju4O2iXGqkSu4PQ==\" "
" },"
" { \"name\": \"key2\" , "
" \"algorithm\": \"HMAC-MD5\" ,"
- " \"digest_bits\": 120 , "
+ " \"digest-bits\": 120 , "
" \"secret\": \"GWG/Xfbju4O2iXGqkSu4PQ==\" "
" },"
" { \"name\": \"key1\" , "
" { \"name\": \"key1\" , "
" \"algorithm\": \"HMAC-MD5\" ,"
- " \"digest_bits\": 80 , "
+ " \"digest-bits\": 80 , "
" \"secret\": \"dGhpcyBrZXkgd2lsbCBtYXRjaA==\" "
" },"
" { \"name\": \"key2\" , "
" \"algorithm\": \"HMAC-SHA1\" ,"
- " \"digest_bits\": 80 , "
+ " \"digest-bits\": 80 , "
" \"secret\": \"dGhpcyBrZXkgd2lsbCBtYXRjaA==\" "
" },"
" { \"name\": \"key3\" , "
" \"algorithm\": \"HMAC-SHA256\" ,"
- " \"digest_bits\": 128 , "
+ " \"digest-bits\": 128 , "
" \"secret\": \"dGhpcyBrZXkgd2lsbCBtYXRjaA==\" "
" },"
" { \"name\": \"key4\" , "
" \"algorithm\": \"HMAC-SHA224\" ,"
- " \"digest_bits\": 112 , "
+ " \"digest-bits\": 112 , "
" \"secret\": \"dGhpcyBrZXkgd2lsbCBtYXRjaA==\" "
" },"
" { \"name\": \"key5\" , "
" \"algorithm\": \"HMAC-SHA384\" ,"
- " \"digest_bits\": 192 , "
+ " \"digest-bits\": 192 , "
" \"secret\": \"dGhpcyBrZXkgd2lsbCBtYXRjaA==\" "
" },"
" { \"name\": \"key6\" , "
" \"algorithm\": \"HMAC-SHA512\" ,"
- " \"digest_bits\": 256 , "
+ " \"digest-bits\": 256 , "
" \"secret\": \"dGhpcyBrZXkgd2lsbCBtYXRjaA==\" "
" }"
" ]";
// Create a config in which both host and ip address are supplied.
// Verify that build fails.
std::string config = "{ \"hostname\": \"pegasus.tmark\", "
- " \"ip_address\": \"127.0.0.1\" } ";
+ " \"ip-address\": \"127.0.0.1\" } ";
ASSERT_TRUE(fromJSON(config));
EXPECT_THROW(parser_->build(config_set_), D2CfgError);
// Neither host nor ip address supplied
// Verify that builds fails.
config = "{ \"hostname\": \"\", "
- " \"ip_address\": \"\" } ";
+ " \"ip-address\": \"\" } ";
ASSERT_TRUE(fromJSON(config));
EXPECT_THROW(parser_->build(config_set_), D2CfgError);
// Create a config with a negative port number.
// Verify that build fails.
- config = "{ \"ip_address\": \"192.168.5.6\" ,"
+ config = "{ \"ip-address\": \"192.168.5.6\" ,"
" \"port\": -100 }";
ASSERT_TRUE(fromJSON(config));
EXPECT_THROW (parser_->build(config_set_), isc::BadValue);
/// reset();
// Valid entries for static ip
- std::string config = " { \"ip_address\": \"127.0.0.1\" , "
+ std::string config = " { \"ip-address\": \"127.0.0.1\" , "
" \"port\": 100 }";
ASSERT_TRUE(fromJSON(config));
reset();
// Valid entries for static ip, no port
- config = " { \"ip_address\": \"192.168.2.5\" }";
+ config = " { \"ip-address\": \"192.168.2.5\" }";
ASSERT_TRUE(fromJSON(config));
// Verify that it builds and commits without throwing.
/// entries is detected.
TEST_F(ConfigParseTest, invalidServerList) {
// Construct a list of servers with an invalid server entry.
- std::string config = "[ { \"ip_address\": \"127.0.0.1\" }, "
- "{ \"ip_address\": \"\" }, "
- "{ \"ip_address\": \"127.0.0.2\" } ]";
+ std::string config = "[ { \"ip-address\": \"127.0.0.1\" }, "
+ "{ \"ip-address\": \"\" }, "
+ "{ \"ip-address\": \"127.0.0.2\" } ]";
ASSERT_TRUE(fromJSON(config));
// Create the server storage and list parser.
/// a valid configuration.
TEST_F(ConfigParseTest, validServerList) {
// Create a valid list of servers.
- std::string config = "[ { \"ip_address\": \"127.0.0.1\" }, "
- "{ \"ip_address\": \"127.0.0.2\" }, "
- "{ \"ip_address\": \"127.0.0.3\" } ]";
+ std::string config = "[ { \"ip-address\": \"127.0.0.1\" }, "
+ "{ \"ip-address\": \"127.0.0.2\" }, "
+ "{ \"ip-address\": \"127.0.0.3\" } ]";
ASSERT_TRUE(fromJSON(config));
// Create the server storage and list parser.
new DdnsDomainParser("test", domains, keys_)), D2CfgError);
// Create a domain configuration without a name
- std::string config = "{ \"key_name\": \"d2_key.tmark.org\" , "
- " \"dns_servers\" : [ "
- " { \"ip_address\": \"127.0.0.1\" , "
+ std::string config = "{ \"key-name\": \"d2_key.tmark.org\" , "
+ " \"dns-servers\" : [ "
+ " { \"ip-address\": \"127.0.0.1\" , "
" \"port\": 100 },"
- " { \"ip_address\": \"127.0.0.2\" , "
+ " { \"ip-address\": \"127.0.0.2\" , "
" \"port\": 200 },"
- " { \"ip_address\": \"127.0.0.3\" , "
+ " { \"ip-address\": \"127.0.0.3\" , "
" \"port\": 300 } ] } ";
ASSERT_TRUE(fromJSON(config));
// Create a domain configuration with an empty server list.
config = "{ \"name\": \"tmark.org\" , "
- " \"key_name\": \"d2_key.tmark.org\" , "
- " \"dns_servers\" : [ "
+ " \"key-name\": \"d2_key.tmark.org\" , "
+ " \"dns-servers\" : [ "
" ] } ";
ASSERT_TRUE(fromJSON(config));
// Create a domain configuration with a mal-formed server entry.
config = "{ \"name\": \"tmark.org\" , "
- " \"key_name\": \"d2_key.tmark.org\" , "
- " \"dns_servers\" : [ "
- " { \"ip_address\": \"127.0.0.3\" , "
+ " \"key-name\": \"d2_key.tmark.org\" , "
+ " \"dns-servers\" : [ "
+ " { \"ip-address\": \"127.0.0.3\" , "
" \"port\": -1 } ] } ";
ASSERT_TRUE(fromJSON(config));
// Create a domain configuration without an defined key name
config = "{ \"name\": \"tmark.org\" , "
- " \"key_name\": \"d2_key.tmark.org\" , "
- " \"dns_servers\" : [ "
- " { \"ip_address\": \"127.0.0.3\" , "
+ " \"key-name\": \"d2_key.tmark.org\" , "
+ " \"dns-servers\" : [ "
+ " { \"ip-address\": \"127.0.0.3\" , "
" \"port\": 300 } ] } ";
ASSERT_TRUE(fromJSON(config));
// servers.
std::string config =
"{ \"name\": \"tmark.org\" , "
- " \"key_name\": \"d2_key.tmark.org\" , "
- " \"dns_servers\" : [ "
- " { \"ip_address\": \"127.0.0.1\" , "
+ " \"key-name\": \"d2_key.tmark.org\" , "
+ " \"dns-servers\" : [ "
+ " { \"ip-address\": \"127.0.0.1\" , "
" \"port\": 100 },"
- " { \"ip_address\": \"127.0.0.2\" , "
+ " { \"ip-address\": \"127.0.0.2\" , "
" \"port\": 200 },"
- " { \"ip_address\": \"127.0.0.3\" , "
+ " { \"ip-address\": \"127.0.0.3\" , "
" \"port\": 300 } ] } ";
ASSERT_TRUE(fromJSON(config));
std::string config =
"[ "
"{ \"name\": \"tmark.org\" , "
- " \"key_name\": \"d2_key.tmark.org\" , "
- " \"dns_servers\" : [ "
- " { \"ip_address\": \"127.0.0.1\" , "
+ " \"key-name\": \"d2_key.tmark.org\" , "
+ " \"dns-servers\" : [ "
+ " { \"ip-address\": \"127.0.0.1\" , "
" \"port\": 100 },"
- " { \"ip_address\": \"127.0.0.2\" , "
+ " { \"ip-address\": \"127.0.0.2\" , "
" \"port\": 200 },"
- " { \"ip_address\": \"127.0.0.3\" , "
+ " { \"ip-address\": \"127.0.0.3\" , "
" \"port\": 300 } ] } "
", "
"{ \"name\": \"billcat.net\" , "
- " \"key_name\": \"d2_key.billcat.net\" , "
- " \"dns_servers\" : [ "
- " { \"ip_address\": \"127.0.0.4\" , "
+ " \"key-name\": \"d2_key.billcat.net\" , "
+ " \"dns-servers\" : [ "
+ " { \"ip-address\": \"127.0.0.4\" , "
" \"port\": 400 },"
- " { \"ip_address\": \"127.0.0.5\" , "
+ " { \"ip-address\": \"127.0.0.5\" , "
" \"port\": 500 },"
- " { \"ip_address\": \"127.0.0.6\" , "
+ " { \"ip-address\": \"127.0.0.6\" , "
" \"port\": 600 } ] } "
"] ";
std::string config =
"[ "
"{ \"name\": \"tmark.org\" , "
- " \"dns_servers\" : [ "
- " { \"ip_address\": \"127.0.0.3\" , "
+ " \"dns-servers\" : [ "
+ " { \"ip-address\": \"127.0.0.3\" , "
" \"port\": 300 } ] } "
", "
"{ \"name\": \"tmark.org\" , "
- " \"dns_servers\" : [ "
- " { \"ip_address\": \"127.0.0.3\" , "
+ " \"dns-servers\" : [ "
+ " { \"ip-address\": \"127.0.0.3\" , "
" \"port\": 300 } ] } "
"] ";
ASSERT_TRUE(fromJSON(config));
// both the forward and reverse ddns managers. Both managers have two
// domains with three servers per domain.
std::string config = "{ "
- "\"ip_address\" : \"192.168.1.33\" , "
+ "\"ip-address\" : \"192.168.1.33\" , "
"\"port\" : 88 , "
- " \"dns_server_timeout\": 333 , "
- " \"ncr_protocol\": \"UDP\" , "
- " \"ncr_format\": \"JSON\", "
- "\"tsig_keys\": ["
+ " \"dns-server-timeout\": 333 , "
+ " \"ncr-protocol\": \"UDP\" , "
+ " \"ncr-format\": \"JSON\", "
+ "\"tsig-keys\": ["
"{"
" \"name\": \"d2_key.tmark.org\" , "
" \"algorithm\": \"hmac-md5\" , "
"{"
" \"name\": \"d2_key.billcat.net\" , "
" \"algorithm\": \"hmac-md5\" , "
- " \"digest_bits\": 120 , "
+ " \"digest-bits\": 120 , "
" \"secret\": \"LSWXnfkKZjdPJI5QxlpnfQ==\" "
"}"
"],"
- "\"forward_ddns\" : {"
- "\"ddns_domains\": [ "
+ "\"forward-ddns\" : {"
+ "\"ddns-domains\": [ "
"{ \"name\": \"tmark.org\" , "
- " \"key_name\": \"d2_key.tmark.org\" , "
- " \"dns_servers\" : [ "
- " { \"ip_address\": \"127.0.0.1\" } , "
- " { \"ip_address\": \"127.0.0.2\" } , "
- " { \"ip_address\": \"127.0.0.3\"} "
+ " \"key-name\": \"d2_key.tmark.org\" , "
+ " \"dns-servers\" : [ "
+ " { \"ip-address\": \"127.0.0.1\" } , "
+ " { \"ip-address\": \"127.0.0.2\" } , "
+ " { \"ip-address\": \"127.0.0.3\"} "
" ] } "
", "
"{ \"name\": \"billcat.net\" , "
- " \"key_name\": \"d2_key.billcat.net\" , "
- " \"dns_servers\" : [ "
- " { \"ip_address\": \"127.0.0.4\" } , "
- " { \"ip_address\": \"127.0.0.5\" } , "
- " { \"ip_address\": \"127.0.0.6\" } "
+ " \"key-name\": \"d2_key.billcat.net\" , "
+ " \"dns-servers\" : [ "
+ " { \"ip-address\": \"127.0.0.4\" } , "
+ " { \"ip-address\": \"127.0.0.5\" } , "
+ " { \"ip-address\": \"127.0.0.6\" } "
" ] } "
"] },"
- "\"reverse_ddns\" : {"
- "\"ddns_domains\": [ "
+ "\"reverse-ddns\" : {"
+ "\"ddns-domains\": [ "
"{ \"name\": \" 0.168.192.in.addr.arpa.\" , "
- " \"key_name\": \"d2_key.tmark.org\" , "
- " \"dns_servers\" : [ "
- " { \"ip_address\": \"127.0.1.1\" } , "
- " { \"ip_address\": \"127.0.2.1\" } , "
- " { \"ip_address\": \"127.0.3.1\" } "
+ " \"key-name\": \"d2_key.tmark.org\" , "
+ " \"dns-servers\" : [ "
+ " { \"ip-address\": \"127.0.1.1\" } , "
+ " { \"ip-address\": \"127.0.2.1\" } , "
+ " { \"ip-address\": \"127.0.3.1\" } "
" ] } "
", "
"{ \"name\": \" 0.247.106.in.addr.arpa.\" , "
- " \"key_name\": \"d2_key.billcat.net\" , "
- " \"dns_servers\" : [ "
- " { \"ip_address\": \"127.0.4.1\" }, "
- " { \"ip_address\": \"127.0.5.1\" } , "
- " { \"ip_address\": \"127.0.6.1\" } "
+ " \"key-name\": \"d2_key.billcat.net\" , "
+ " \"dns-servers\" : [ "
+ " { \"ip-address\": \"127.0.4.1\" }, "
+ " { \"ip-address\": \"127.0.5.1\" } , "
+ " { \"ip-address\": \"127.0.6.1\" } "
" ] } "
"] } }";
// Create configuration with one domain, one sub domain, and the wild
// card.
std::string config = "{ "
- "\"ip_address\" : \"192.168.1.33\" , "
+ "\"ip-address\" : \"192.168.1.33\" , "
"\"port\" : 88 , "
- "\"tsig_keys\": [] ,"
- "\"forward_ddns\" : {"
- "\"ddns_domains\": [ "
+ "\"tsig-keys\": [] ,"
+ "\"forward-ddns\" : {"
+ "\"ddns-domains\": [ "
"{ \"name\": \"tmark.org\" , "
- " \"dns_servers\" : [ "
- " { \"ip_address\": \"127.0.0.1\" } "
+ " \"dns-servers\" : [ "
+ " { \"ip-address\": \"127.0.0.1\" } "
" ] } "
", "
"{ \"name\": \"one.tmark.org\" , "
- " \"dns_servers\" : [ "
- " { \"ip_address\": \"127.0.0.2\" } "
+ " \"dns-servers\" : [ "
+ " { \"ip-address\": \"127.0.0.2\" } "
" ] } "
", "
"{ \"name\": \"*\" , "
- " \"dns_servers\" : [ "
- " { \"ip_address\": \"127.0.0.3\" } "
+ " \"dns-servers\" : [ "
+ " { \"ip-address\": \"127.0.0.3\" } "
" ] } "
"] }, "
- "\"reverse_ddns\" : {} "
+ "\"reverse-ddns\" : {} "
"}";
TEST_F(D2CfgMgrTest, matchNoWildcard) {
// Create a configuration with one domain, one sub-domain, and NO wild card.
std::string config = "{ "
- "\"ip_address\" : \"192.168.1.33\" , "
+ "\"ip-address\" : \"192.168.1.33\" , "
"\"port\" : 88 , "
- "\"tsig_keys\": [] ,"
- "\"forward_ddns\" : {"
- "\"ddns_domains\": [ "
+ "\"tsig-keys\": [] ,"
+ "\"forward-ddns\" : {"
+ "\"ddns-domains\": [ "
"{ \"name\": \"tmark.org\" , "
- " \"dns_servers\" : [ "
- " { \"ip_address\": \"127.0.0.1\" } "
+ " \"dns-servers\" : [ "
+ " { \"ip-address\": \"127.0.0.1\" } "
" ] } "
", "
"{ \"name\": \"one.tmark.org\" , "
- " \"dns_servers\" : [ "
- " { \"ip_address\": \"127.0.0.2\" } "
+ " \"dns-servers\" : [ "
+ " { \"ip-address\": \"127.0.0.2\" } "
" ] } "
"] }, "
- "\"reverse_ddns\" : {} "
+ "\"reverse-ddns\" : {} "
" }";
ASSERT_TRUE(fromJSON(config));
/// This test verifies that any FQDN matches the wild card.
TEST_F(D2CfgMgrTest, matchAll) {
std::string config = "{ "
- "\"ip_address\" : \"192.168.1.33\" , "
+ "\"ip-address\" : \"192.168.1.33\" , "
"\"port\" : 88 , "
- "\"tsig_keys\": [] ,"
- "\"forward_ddns\" : {"
- "\"ddns_domains\": [ "
+ "\"tsig-keys\": [] ,"
+ "\"forward-ddns\" : {"
+ "\"ddns-domains\": [ "
"{ \"name\": \"*\" , "
- " \"dns_servers\" : [ "
- " { \"ip_address\": \"127.0.0.1\" } "
+ " \"dns-servers\" : [ "
+ " { \"ip-address\": \"127.0.0.1\" } "
" ] } "
"] }, "
- "\"reverse_ddns\" : {} "
+ "\"reverse-ddns\" : {} "
"}";
ASSERT_TRUE(fromJSON(config));
/// as a match.
TEST_F(D2CfgMgrTest, matchReverse) {
std::string config = "{ "
- "\"ip_address\" : \"192.168.1.33\" , "
+ "\"ip-address\" : \"192.168.1.33\" , "
"\"port\" : 88 , "
- "\"tsig_keys\": [] ,"
- "\"forward_ddns\" : {}, "
- "\"reverse_ddns\" : {"
- "\"ddns_domains\": [ "
+ "\"tsig-keys\": [] ,"
+ "\"forward-ddns\" : {}, "
+ "\"reverse-ddns\" : {"
+ "\"ddns-domains\": [ "
"{ \"name\": \"5.100.168.192.in-addr.arpa.\" , "
- " \"dns_servers\" : [ "
- " { \"ip_address\": \"127.0.0.1\" } "
+ " \"dns-servers\" : [ "
+ " { \"ip-address\": \"127.0.0.1\" } "
" ] }, "
"{ \"name\": \"100.200.192.in-addr.arpa.\" , "
- " \"dns_servers\" : [ "
- " { \"ip_address\": \"127.0.0.1\" } "
+ " \"dns-servers\" : [ "
+ " { \"ip-address\": \"127.0.0.1\" } "
" ] }, "
"{ \"name\": \"170.192.in-addr.arpa.\" , "
- " \"dns_servers\" : [ "
- " { \"ip_address\": \"127.0.0.1\" } "
+ " \"dns-servers\" : [ "
+ " { \"ip-address\": \"127.0.0.1\" } "
" ] }, "
// Note mixed case to test case insensitivity.
"{ \"name\": \"2.0.3.0.8.b.d.0.1.0.0.2.IP6.ARPA.\" , "
- " \"dns_servers\" : [ "
- " { \"ip_address\": \"127.0.0.1\" } "
+ " \"dns-servers\" : [ "
+ " { \"ip-address\": \"127.0.0.1\" } "
" ] },"
"{ \"name\": \"*\" , "
- " \"dns_servers\" : [ "
- " { \"ip_address\": \"127.0.0.1\" } "
+ " \"dns-servers\" : [ "
+ " { \"ip-address\": \"127.0.0.1\" } "
" ] } "
"] } }";
///
/// # Each test has:
/// # 1. description - optional text description
-/// # 2. should_fail - bool indicator if parsing is expected to file
+/// # 2. should-fail - bool indicator if parsing is expected to file
/// # (defaults to false)
/// # 3. data - configuration text to parse
/// #
// Read in each test For each test, read:
// 1. description - optional text description
- // 2. should_fail - bool indicator if parsing is expected to file (defaults
+ // 2. should-fail - bool indicator if parsing is expected to file (defaults
// to false
// 3. data - configuration text to parse
//
// Next attempt to parse the configuration by passing it into
// D2CfgMgr::parseConfig(). Then check the parsing outcome against the
- // expected outcome as given by should_fail.
+ // expected outcome as given by should-fail.
isc::data::ConstElementPtr test;
- BOOST_FOREACH(test, tests->get("test_list")->listValue()) {
+ ASSERT_TRUE(tests->get("test-list"));
+ BOOST_FOREACH(test, tests->get("test-list")->listValue()) {
// Grab the description.
std::string description = "<no desc>";
elem->getValue(description);
}
- // Grab the outcome flag, should_fail, defaults to false if it's
+ // Grab the outcome flag, should-fail, defaults to false if it's
// not specified.
bool should_fail = false;
- elem = test->get("should_fail");
+ elem = test->get("should-fail");
if (elem) {
elem->getValue(should_fail);
}
// Define a replacement config.
const char* second_cfg =
"{"
- " \"ip_address\": \"192.168.77.1\" , "
+ " \"ip-address\": \"192.168.77.1\" , "
" \"port\": 777 , "
- "\"tsig_keys\": [], "
- "\"forward_ddns\" : {}, "
- "\"reverse_ddns\" : {} "
+ "\"tsig-keys\": [], "
+ "\"forward-ddns\" : {}, "
+ "\"reverse-ddns\" : {} "
"}";
// Schedule to replace the configuration file after launch. This way the
/// @brief Valid configuration containing an unavailable IP address.
const char* bad_ip_d2_config = "{ "
- "\"ip_address\" : \"1.1.1.1\" , "
+ "\"ip-address\" : \"1.1.1.1\" , "
"\"port\" : 5031, "
- "\"tsig_keys\": ["
+ "\"tsig-keys\": ["
"{ \"name\": \"d2_key.tmark.org\" , "
" \"algorithm\": \"HMAC-MD5\" ,"
" \"secret\": \"LSWXnfkKZjdPJI5QxlpnfQ==\" "
"} ],"
- "\"forward_ddns\" : {"
- "\"ddns_domains\": [ "
+ "\"forward-ddns\" : {"
+ "\"ddns-domains\": [ "
"{ \"name\": \"tmark.org\" , "
- " \"key_name\": \"d2_key.tmark.org\" , "
- " \"dns_servers\" : [ "
- " { \"ip_address\": \"127.0.0.101\" } "
+ " \"key-name\": \"d2_key.tmark.org\" , "
+ " \"dns-servers\" : [ "
+ " { \"ip-address\": \"127.0.0.101\" } "
"] } ] }, "
- "\"reverse_ddns\" : {"
- "\"ddns_domains\": [ "
+ "\"reverse-ddns\" : {"
+ "\"ddns-domains\": [ "
"{ \"name\": \" 0.168.192.in.addr.arpa.\" , "
- " \"key_name\": \"d2_key.tmark.org\" , "
- " \"dns_servers\" : [ "
- " { \"ip_address\": \"127.0.0.101\" , "
+ " \"key-name\": \"d2_key.tmark.org\" , "
+ " \"dns-servers\" : [ "
+ " { \"ip-address\": \"127.0.0.101\" , "
" \"port\": 100 } ] } "
"] } }";
/// loopback.
TEST_F(D2ProcessTest, notLoopbackTest) {
const char* config = "{ "
- "\"ip_address\" : \"0.0.0.0\" , "
+ "\"ip-address\" : \"0.0.0.0\" , "
"\"port\" : 53001, "
- "\"tsig_keys\": [],"
- "\"forward_ddns\" : {},"
- "\"reverse_ddns\" : {}"
+ "\"tsig-keys\": [],"
+ "\"forward-ddns\" : {},"
+ "\"reverse-ddns\" : {}"
"}";
// Note we don't care nor can we predict if this
/// DHCP_DDNS_NOT_ON_LOOPBACK is not issued.
TEST_F(D2ProcessTest, v4LoopbackTest) {
const char* config = "{ "
- "\"ip_address\" : \"127.0.0.1\" , "
+ "\"ip-address\" : \"127.0.0.1\" , "
"\"port\" : 53001, "
- "\"tsig_keys\": [],"
- "\"forward_ddns\" : {},"
- "\"reverse_ddns\" : {}"
+ "\"tsig-keys\": [],"
+ "\"forward-ddns\" : {},"
+ "\"reverse-ddns\" : {}"
"}";
ASSERT_TRUE(runWithConfig(config));
}
/// DHCP_DDNS_NOT_ON_LOOPBACK is not issued.
TEST_F(D2ProcessTest, v6LoopbackTest) {
const char* config = "{ "
- "\"ip_address\" : \"::1\" , "
+ "\"ip-address\" : \"::1\" , "
"\"port\" : 53001, "
- "\"tsig_keys\": [],"
- "\"forward_ddns\" : {},"
- "\"reverse_ddns\" : {}"
+ "\"tsig-keys\": [],"
+ "\"forward-ddns\" : {},"
+ "\"reverse-ddns\" : {}"
"}";
ASSERT_TRUE(runWithConfig(config));
}
void makeCannedConfig() {
std::string canned_config_ =
"{ "
- "\"ip_address\" : \"192.168.1.33\" , "
+ "\"ip-address\" : \"192.168.1.33\" , "
"\"port\" : 88 , "
- "\"tsig_keys\": [] ,"
- "\"forward_ddns\" : {"
- "\"ddns_domains\": [ "
+ "\"tsig-keys\": [] ,"
+ "\"forward-ddns\" : {"
+ "\"ddns-domains\": [ "
"{ \"name\": \"example.com.\" , "
- " \"dns_servers\" : [ "
- " { \"ip_address\": \"127.0.0.1\", \"port\" : 5301 } "
+ " \"dns-servers\" : [ "
+ " { \"ip-address\": \"127.0.0.1\", \"port\" : 5301 } "
" ] },"
"{ \"name\": \"org.\" , "
- " \"dns_servers\" : [ "
- " { \"ip_address\": \"127.0.0.1\" } "
+ " \"dns-servers\" : [ "
+ " { \"ip-address\": \"127.0.0.1\" } "
" ] }, "
"] }, "
- "\"reverse_ddns\" : { "
- "\"ddns_domains\": [ "
+ "\"reverse-ddns\" : { "
+ "\"ddns-domains\": [ "
"{ \"name\": \"1.168.192.in-addr.arpa.\" , "
- " \"dns_servers\" : [ "
- " { \"ip_address\": \"127.0.0.1\", \"port\" : 5301 } "
+ " \"dns-servers\" : [ "
+ " { \"ip-address\": \"127.0.0.1\", \"port\" : 5301 } "
" ] }, "
"{ \"name\": \"2.0.3.0.8.B.D.0.1.0.0.2.ip6.arpa.\" , "
- " \"dns_servers\" : [ "
- " { \"ip_address\": \"127.0.0.1\" } "
+ " \"dns-servers\" : [ "
+ " { \"ip-address\": \"127.0.0.1\" } "
" ] } "
"] } }";
namespace d2 {
const char* valid_d2_config = "{ "
- "\"ip_address\" : \"127.0.0.1\" , "
+ "\"ip-address\" : \"127.0.0.1\" , "
"\"port\" : 5031, "
- "\"tsig_keys\": ["
+ "\"tsig-keys\": ["
"{ \"name\": \"d2_key.tmark.org\" , "
" \"algorithm\": \"HMAC-MD5\" ,"
" \"secret\": \"LSWXnfkKZjdPJI5QxlpnfQ==\" "
"} ],"
- "\"forward_ddns\" : {"
- "\"ddns_domains\": [ "
+ "\"forward-ddns\" : {"
+ "\"ddns-domains\": [ "
"{ \"name\": \"tmark.org.\" , "
- " \"key_name\": \"d2_key.tmark.org\" , "
- " \"dns_servers\" : [ "
- " { \"ip_address\": \"127.0.0.101\" } "
+ " \"key-name\": \"d2_key.tmark.org\" , "
+ " \"dns-servers\" : [ "
+ " { \"ip-address\": \"127.0.0.101\" } "
"] } ] }, "
- "\"reverse_ddns\" : {"
- "\"ddns_domains\": [ "
+ "\"reverse-ddns\" : {"
+ "\"ddns-domains\": [ "
"{ \"name\": \" 0.168.192.in.addr.arpa.\" , "
- " \"key_name\": \"d2_key.tmark.org\" , "
- " \"dns_servers\" : [ "
- " { \"ip_address\": \"127.0.0.101\" , "
+ " \"key-name\": \"d2_key.tmark.org\" , "
+ " \"dns-servers\" : [ "
+ " { \"ip-address\": \"127.0.0.101\" , "
" \"port\": 100 } ] } "
"] } }";
# Each test entry consists of:
#
# description - text describing the test (optional)
-# should_fail - indicates whether parsing is expected to fail, defaults to
+# should-fail - indicates whether parsing is expected to fail, defaults to
# false
# data {} - Configuration text to submit for parsing.
#
# to fail. There are some that should succeed and are used more or less
# as sanity checks.
-{ "test_list" : [
+{ "test-list" : [
#-----
{
# This test is a bit of sanity check for the "file of configs" test mechanism,
# as well as validating this as the smallest config which makes writing
# permutations easier.
"description" : "D2 smallest, valid config",
-"should_fail" : false,
+"should-fail" : false,
"data" :
{
- "forward_ddns" : {},
- "reverse_ddns" : {},
- "tsig_keys" : []
+ "forward-ddns" : {},
+ "reverse-ddns" : {},
+ "tsig-keys" : []
}
}
#-----
,{
-"description" : "D2 missing forward_ddns map",
-"should_fail" : true,
+"description" : "D2 missing forward-ddns map",
+"should-fail" : true,
"data" :
{
- "reverse_ddns" : {},
- "tsig_keys" : []
+ "reverse-ddns" : {},
+ "tsig-keys" : []
}
}
#-----
,{
-"description" : "D2 missing reverse_ddns map",
-"should_fail" : true,
+"description" : "D2 missing reverse-ddns map",
+"should-fail" : true,
"data" :
{
- "forward_ddns" : {},
- "tsig_keys" : []
+ "forward-ddns" : {},
+ "tsig-keys" : []
}
}
#-----
,{
-"description" : "D2 missing tsig_keys list",
-"should_fail" : true,
+"description" : "D2 missing tsig-keys list",
+"should-fail" : true,
"data" :
{
- "forward_ddns" : {},
- "reverse_ddns" : {}
+ "forward-ddns" : {},
+ "reverse-ddns" : {}
}
}
#-----
,{
"description" : "D2 unknown scalar",
-"should_fail" : true,
+"should-fail" : true,
"data" :
{
- "bogus_scalar" : true,
- "forward_ddns" : {},
- "reverse_ddns" : {},
- "tsig_keys" : []
+ "bogus-scalar" : true,
+ "forward-ddns" : {},
+ "reverse-ddns" : {},
+ "tsig-keys" : []
}
}
#-----
,{
"description" : "D2 unknown map",
-"should_fail" : true,
+"should-fail" : true,
"data" :
{
- "bogus_map" : {},
- "forward_ddns" : {},
- "reverse_ddns" : {},
- "tsig_keys" : []
+ "bogus-map" : {},
+ "forward-ddns" : {},
+ "reverse-ddns" : {},
+ "tsig-keys" : []
}
}
#-----
,{
"description" : "D2 unknown list",
-"should_fail" : true,
+"should-fail" : true,
"data" :
{
- "bogus_list" : [],
- "forward_ddns" : {},
- "reverse_ddns" : {},
- "tsig_keys" : []
+ "bogus-list" : [],
+ "forward-ddns" : {},
+ "reverse-ddns" : {},
+ "tsig-keys" : []
}
}
#----- D2Params Test
-#----- D2Params.ip_address
+#----- D2Params.ip-address
,{
-"description" : "D2Params.ip_address: valid v4",
+"description" : "D2Params.ip-address: valid v4",
"data" :
{
- "ip_address" : "192.168.0.1",
- "forward_ddns" : {},
- "reverse_ddns" : {},
- "tsig_keys" : []
+ "ip-address" : "192.168.0.1",
+ "forward-ddns" : {},
+ "reverse-ddns" : {},
+ "tsig-keys" : []
}
}
#-----
,{
-"description" : "D2Params.ip_address: valid v6",
+"description" : "D2Params.ip-address: valid v6",
"data" :
{
- "ip_address" : "2001:db8::1",
- "forward_ddns" : {},
- "reverse_ddns" : {},
- "tsig_keys" : []
+ "ip-address" : "2001:db8::1",
+ "forward-ddns" : {},
+ "reverse-ddns" : {},
+ "tsig-keys" : []
}
}
#-----
,{
-"description" : "D2Params.ip_address invalid value",
-"should_fail" : true,
+"description" : "D2Params.ip-address invalid value",
+"should-fail" : true,
"data" :
{
- "ip_address" : "bogus",
- "forward_ddns" : {},
- "reverse_ddns" : {},
- "tsig_keys" : []
+ "ip-address" : "bogus",
+ "forward-ddns" : {},
+ "reverse-ddns" : {},
+ "tsig-keys" : []
}
#-----
}
"data" :
{
"port" : 100,
- "forward_ddns" : {},
- "reverse_ddns" : {},
- "tsig_keys" : []
+ "forward-ddns" : {},
+ "reverse-ddns" : {},
+ "tsig-keys" : []
}
}
#-----
,{
"description" : "D2Params.port can't be 0",
-"should_fail" : true,
+"should-fail" : true,
"data" :
{
"port" : 0,
- "forward_ddns" : {},
- "reverse_ddns" : {},
- "tsig_keys" : []
+ "forward-ddns" : {},
+ "reverse-ddns" : {},
+ "tsig-keys" : []
}
}
#-----
,{
"description" : "D2Params.port, non numeric",
-"should_fail" : true,
+"should-fail" : true,
"data" :
{
"port" : "bogus",
- "forward_ddns" : {},
- "reverse_ddns" : {},
- "tsig_keys" : []
+ "forward-ddns" : {},
+ "reverse-ddns" : {},
+ "tsig-keys" : []
}
}
-#----- D2Params.dns_server_timeout
+#----- D2Params.dns-server-timeout
,{
-"description" : "D2Params.dns_server_timeout, valid value",
+"description" : "D2Params.dns-server-timeout, valid value",
"data" :
{
- "dns_server_timeout" : 1000,
- "forward_ddns" : {},
- "reverse_ddns" : {},
- "tsig_keys" : []
+ "dns-server-timeout" : 1000,
+ "forward-ddns" : {},
+ "reverse-ddns" : {},
+ "tsig-keys" : []
}
}
#-----
,{
-"description" : "D2Params.dns_server_timeout can't be 0",
-"should_fail" : true,
+"description" : "D2Params.dns-server-timeout can't be 0",
+"should-fail" : true,
"data" :
{
- "dns_server_timeout" : 0,
- "forward_ddns" : {},
- "reverse_ddns" : {},
- "tsig_keys" : []
+ "dns-server-timeout" : 0,
+ "forward-ddns" : {},
+ "reverse-ddns" : {},
+ "tsig-keys" : []
}
}
#-----
,{
-"description" : "D2Params.dns_server_timeout, non numeric",
-"should_fail" : true,
+"description" : "D2Params.dns-server-timeout, non numeric",
+"should-fail" : true,
"data" :
{
- "dns_server_timeout" : "bogus",
- "forward_ddns" : {},
- "reverse_ddns" : {},
- "tsig_keys" : []
+ "dns-server-timeout" : "bogus",
+ "forward-ddns" : {},
+ "reverse-ddns" : {},
+ "tsig-keys" : []
}
}
#-----
-#----- D2Params.ncr_protocol
+#----- D2Params.ncr-protocol
,{
-"description" : "D2Params.ncr_protocol, valid UDP",
+"description" : "D2Params.ncr-protocol, valid UDP",
"data" :
{
- "ncr_protocol" : "UDP",
- "forward_ddns" : {},
- "reverse_ddns" : {},
- "tsig_keys" : []
+ "ncr-protocol" : "UDP",
+ "forward-ddns" : {},
+ "reverse-ddns" : {},
+ "tsig-keys" : []
}
}
#-----
,{
-"description" : "D2Params.ncr_protocol, unsupported TCP",
-"should_fail" : true,
+"description" : "D2Params.ncr-protocol, unsupported TCP",
+"should-fail" : true,
"data" :
{
- "ncr_protocol" : "TCP",
- "forward_ddns" : {},
- "reverse_ddns" : {},
- "tsig_keys" : []
+ "ncr-protocol" : "TCP",
+ "forward-ddns" : {},
+ "reverse-ddns" : {},
+ "tsig-keys" : []
}
}
#-----
,{
-"description" : "D2Params.ncr_protocol, invalid value",
-"should_fail" : true,
+"description" : "D2Params.ncr-protocol, invalid value",
+"should-fail" : true,
"data" :
{
- "ncr_protocol" : "bogus",
- "forward_ddns" : {},
- "reverse_ddns" : {},
- "tsig_keys" : []
+ "ncr-protocol" : "bogus",
+ "forward-ddns" : {},
+ "reverse-ddns" : {},
+ "tsig-keys" : []
}
}
-#----- D2Params.ncr_format tests
+#----- D2Params.ncr-format tests
,{
-"description" : "D2Params.ncr_format, valid JSON",
+"description" : "D2Params.ncr-format, valid JSON",
"data" :
{
- "ncr_format" : "JSON",
- "forward_ddns" : {},
- "reverse_ddns" : {},
- "tsig_keys" : []
+ "ncr-format" : "JSON",
+ "forward-ddns" : {},
+ "reverse-ddns" : {},
+ "tsig-keys" : []
}
}
#-----
,{
-"description" : "D2Params.ncr_format, invalid value",
-"should_fail" : true,
+"description" : "D2Params.ncr-format, invalid value",
+"should-fail" : true,
"data" :
{
- "ncr_format" : "bogus",
- "forward_ddns" : {},
- "reverse_ddns" : {},
- "tsig_keys" : []
+ "ncr-format" : "bogus",
+ "forward-ddns" : {},
+ "reverse-ddns" : {},
+ "tsig-keys" : []
}
}
#-----
,{
# This test is a sanity check that valid TSIG entries work.
-"description" : "D2.tsig_keys, valid key",
+"description" : "D2.tsig-keys, valid key",
"data" :
{
- "forward_ddns" : {},
- "reverse_ddns" : {},
- "tsig_keys" :
+ "forward-ddns" : {},
+ "reverse-ddns" : {},
+ "tsig-keys" :
[
{
"name" : "d2.md5.key",
#-----
,{
-"description" : "D2.tsig_keys, missing key name",
-"should_fail" : true,
+"description" : "D2.tsig-keys, missing key name",
+"should-fail" : true,
"data" :
{
- "forward_ddns" : {},
- "reverse_ddns" : {},
- "tsig_keys" :
+ "forward-ddns" : {},
+ "reverse-ddns" : {},
+ "tsig-keys" :
[
{
"algorithm" : "HMAC-MD5",
#-----
,{
-"description" : "D2.tsig_keys, blank key name",
-"should_fail" : true,
+"description" : "D2.tsig-keys, blank key name",
+"should-fail" : true,
"data" :
{
- "forward_ddns" : {},
- "reverse_ddns" : {},
- "tsig_keys" :
+ "forward-ddns" : {},
+ "reverse-ddns" : {},
+ "tsig-keys" :
[
{
"name" : "",
#-----
,{
-"description" : "D2.tsig_keys, duplicate key name",
-"should_fail" : true,
+"description" : "D2.tsig-keys, duplicate key name",
+"should-fail" : true,
"data" :
{
- "forward_ddns" : {},
- "reverse_ddns" : {},
- "tsig_keys" :
+ "forward-ddns" : {},
+ "reverse-ddns" : {},
+ "tsig-keys" :
[
{
"name" : "first.key",
}
}
-#----- D2.tsig_keys, algorithm tests
+#----- D2.tsig-keys, algorithm tests
,{
-"description" : "D2.tsig_keys, all valid algorthms",
+"description" : "D2.tsig-keys, all valid algorthms",
"data" :
{
- "forward_ddns" : {},
- "reverse_ddns" : {},
- "tsig_keys" :
+ "forward-ddns" : {},
+ "reverse-ddns" : {},
+ "tsig-keys" :
[
{
"name" : "d2.md5.key",
}
}
-#----- D2.tsig_keys, algorithm tests
+#----- D2.tsig-keys, algorithm tests
,{
-"description" : "D2.tsig_keys, missing algorithm",
-"should_fail" : true,
+"description" : "D2.tsig-keys, missing algorithm",
+"should-fail" : true,
"data" :
{
- "forward_ddns" : {},
- "reverse_ddns" : {},
- "tsig_keys" :
+ "forward-ddns" : {},
+ "reverse-ddns" : {},
+ "tsig-keys" :
[
{
"name" : "first.key",
#-----
,{
-"description" : "D2.tsig_keys, blank algorithm",
-"should_fail" : true,
+"description" : "D2.tsig-keys, blank algorithm",
+"should-fail" : true,
"data" :
{
- "forward_ddns" : {},
- "reverse_ddns" : {},
- "tsig_keys" :
+ "forward-ddns" : {},
+ "reverse-ddns" : {},
+ "tsig-keys" :
[
{
"name" : "first.key",
#-----
,{
-"description" : "D2.tsig_keys, invalid algorithm",
-"should_fail" : true,
+"description" : "D2.tsig-keys, invalid algorithm",
+"should-fail" : true,
"data" :
{
- "forward_ddns" : {},
- "reverse_ddns" : {},
- "tsig_keys" :
+ "forward-ddns" : {},
+ "reverse-ddns" : {},
+ "tsig-keys" :
[
{
"name" : "first.key",
}
}
-#----- D2.tsig_keys, digest_bits tests
+#----- D2.tsig-keys, digest-bits tests
,{
-"description" : "D2.tsig_keys, all valid algorthms",
+"description" : "D2.tsig-keys, all valid algorthms",
"data" :
{
- "forward_ddns" : {},
- "reverse_ddns" : {},
- "tsig_keys" :
+ "forward-ddns" : {},
+ "reverse-ddns" : {},
+ "tsig-keys" :
[
{
"name" : "d2.md5.key",
"algorithm" : "HMAC-MD5",
- "digest_bits" : 80,
+ "digest-bits" : 80,
"secret" : "LSWXnfkKZjdPJI5QxlpnfQ=="
},
{
"name" : "d2.sha1.key",
"algorithm" : "HMAC-SHA1",
- "digest_bits" : 80,
+ "digest-bits" : 80,
"secret" : "hRrp29wzUv3uzSNRLlY68w=="
},
{
"name" : "d2.sha224.key",
"algorithm" : "HMAC-SHA224",
- "digest_bits" : 112,
+ "digest-bits" : 112,
"secret" : "bZEG7Ow8OgAUPfLWV3aAUQ=="
},
{
"name" : "d2.sha256.key",
"algorithm" : "hmac-sha256",
- "digest_bits" : 128,
+ "digest-bits" : 128,
"secret" : "bjF4hYhTfQ5MX0siagelsw=="
},
{
"name" : "d2.sha384.key",
"algorithm" : "hmac-sha384",
- "digest_bits" : 192,
+ "digest-bits" : 192,
"secret" : "Gwk53fvy3CmbupoI9TgigA=="
},
{
"name" : "d2.sha512.key",
"algorithm" : "hmac-sha512",
- "digest_bits" : 256,
+ "digest-bits" : 256,
"secret" : "wP+5FqMnKXCxBWljU/BZAA=="
}
]
#-----
,{
-"description" : "D2.tsig_keys, invalid digest_bits",
-"should_fail" : true,
+"description" : "D2.tsig-keys, invalid digest-bits",
+"should-fail" : true,
"data" :
{
- "forward_ddns" : {},
- "reverse_ddns" : {},
- "tsig_keys" :
+ "forward-ddns" : {},
+ "reverse-ddns" : {},
+ "tsig-keys" :
[
{
"name" : "d2.md5.key",
"algorithm" : "HMAC-MD5",
- "digest_bits" : 84,
+ "digest-bits" : 84,
"secret" : "LSWXnfkKZjdPJI5QxlpnfQ=="
},
]
#-----
,{
-"description" : "D2.tsig_keys, too small truncated HMAC-MD5",
-"should_fail" : true,
+"description" : "D2.tsig-keys, too small truncated HMAC-MD5",
+"should-fail" : true,
"data" :
{
- "forward_ddns" : {},
- "reverse_ddns" : {},
- "tsig_keys" :
+ "forward-ddns" : {},
+ "reverse-ddns" : {},
+ "tsig-keys" :
[
{
"name" : "d2.md5.key",
"algorithm" : "HMAC-MD5",
- "digest_bits" : 72,
+ "digest-bits" : 72,
"secret" : "LSWXnfkKZjdPJI5QxlpnfQ=="
},
]
#-----
,{
-"description" : "D2.tsig_keys, too small truncated HMAC-SHA1",
-"should_fail" : true,
+"description" : "D2.tsig-keys, too small truncated HMAC-SHA1",
+"should-fail" : true,
"data" :
{
- "forward_ddns" : {},
- "reverse_ddns" : {},
- "tsig_keys" :
+ "forward-ddns" : {},
+ "reverse-ddns" : {},
+ "tsig-keys" :
[
{
"name" : "d2.sha1.key",
"algorithm" : "HMAC-SHA1",
- "digest_bits" : 72,
+ "digest-bits" : 72,
"secret" : "hRrp29wzUv3uzSNRLlY68w=="
},
]
#-----
,{
-"description" : "D2.tsig_keys, too small truncated HMAC-SHA224",
-"should_fail" : true,
+"description" : "D2.tsig-keys, too small truncated HMAC-SHA224",
+"should-fail" : true,
"data" :
{
- "forward_ddns" : {},
- "reverse_ddns" : {},
- "tsig_keys" :
+ "forward-ddns" : {},
+ "reverse-ddns" : {},
+ "tsig-keys" :
[
{
"name" : "d2.sha224.key",
"algorithm" : "HMAC-SHA224",
- "digest_bits" : 104,
+ "digest-bits" : 104,
"secret" : "bZEG7Ow8OgAUPfLWV3aAUQ=="
},
]
#-----
,{
-"description" : "D2.tsig_keys, too small truncated HMAC-SHA256",
-"should_fail" : true,
+"description" : "D2.tsig-keys, too small truncated HMAC-SHA256",
+"should-fail" : true,
"data" :
{
- "forward_ddns" : {},
- "reverse_ddns" : {},
- "tsig_keys" :
+ "forward-ddns" : {},
+ "reverse-ddns" : {},
+ "tsig-keys" :
[
{
"name" : "d2.sha256.key",
"algorithm" : "hmac-sha256",
- "digest_bits" : 120,
+ "digest-bits" : 120,
"secret" : "bjF4hYhTfQ5MX0siagelsw=="
},
]
#-----
,{
-"description" : "D2.tsig_keys, too small truncated HMAC-SHA384",
-"should_fail" : true,
+"description" : "D2.tsig-keys, too small truncated HMAC-SHA384",
+"should-fail" : true,
"data" :
{
- "forward_ddns" : {},
- "reverse_ddns" : {},
- "tsig_keys" :
+ "forward-ddns" : {},
+ "reverse-ddns" : {},
+ "tsig-keys" :
[
{
"name" : "d2.sha384.key",
"algorithm" : "hmac-sha384",
- "digest_bits" : 184,
+ "digest-bits" : 184,
"secret" : "Gwk53fvy3CmbupoI9TgigA=="
},
]
#-----
,{
-"description" : "D2.tsig_keys, too small truncated HMAC-SHA512",
-"should_fail" : true,
+"description" : "D2.tsig-keys, too small truncated HMAC-SHA512",
+"should-fail" : true,
"data" :
{
- "forward_ddns" : {},
- "reverse_ddns" : {},
- "tsig_keys" :
+ "forward-ddns" : {},
+ "reverse-ddns" : {},
+ "tsig-keys" :
[
{
"name" : "d2.sha512.key",
"algorithm" : "hmac-sha512",
- "digest_bits" : 248,
+ "digest-bits" : 248,
"secret" : "wP+5FqMnKXCxBWljU/BZAA=="
}
]
}
}
-#----- D2.tsig_keys, secret tests
+#----- D2.tsig-keys, secret tests
,{
-"description" : "D2.tsig_keys, missing secret",
-"should_fail" : true,
+"description" : "D2.tsig-keys, missing secret",
+"should-fail" : true,
"data" :
{
- "forward_ddns" : {},
- "reverse_ddns" : {},
- "tsig_keys" :
+ "forward-ddns" : {},
+ "reverse-ddns" : {},
+ "tsig-keys" :
[
{
"name" : "first.key",
#-----
,{
-"description" : "D2.tsig_keys, blank secret",
-"should_fail" : true,
+"description" : "D2.tsig-keys, blank secret",
+"should-fail" : true,
"data" :
{
- "forward_ddns" : {},
- "reverse_ddns" : {},
- "tsig_keys" :
+ "forward-ddns" : {},
+ "reverse-ddns" : {},
+ "tsig-keys" :
[
{
"name" : "first.key",
#-----
,{
-"description" : "D2.tsig_keys, invalid secret",
-"should_fail" : true,
+"description" : "D2.tsig-keys, invalid secret",
+"should-fail" : true,
"data" :
{
- "forward_ddns" : {},
- "reverse_ddns" : {},
- "tsig_keys" :
+ "forward-ddns" : {},
+ "reverse-ddns" : {},
+ "tsig-keys" :
[
{
"name" : "first.key",
}
}
-#----- D2.forward_ddns tests
+#----- D2.forward-ddns tests
,{
-"description" : "D2.forward_ddns, valid, empty ddns_domains",
+"description" : "D2.forward-ddns, valid, empty ddns-domains",
"data" :
{
- "forward_ddns" :
+ "forward-ddns" :
{
- "ddns_domains" : []
+ "ddns-domains" : []
},
- "reverse_ddns" : {},
- "tsig_keys" : []
+ "reverse-ddns" : {},
+ "tsig-keys" : []
}
}
#------
,{
-"description" : "D2.forward_ddns, unknown parameter",
-"should_fail" : true,
+"description" : "D2.forward-ddns, unknown parameter",
+"should-fail" : true,
"data" :
{
- "forward_ddns" :
+ "forward-ddns" :
{
"bogus" : true,
- "ddns_domains" : []
+ "ddns-domains" : []
},
- "reverse_ddns" : {},
- "tsig_keys" : []
+ "reverse-ddns" : {},
+ "tsig-keys" : []
}
}
#------
,{
-"description" : "D2.forward_ddns, one valid, domain",
+"description" : "D2.forward-ddns, one valid, domain",
"data" :
{
- "forward_ddns" :
+ "forward-ddns" :
{
- "ddns_domains" :
+ "ddns-domains" :
[
{
"name" : "four.example.com.",
- "key_name" : "d2.md5.key",
- "dns_servers" :
+ "key-name" : "d2.md5.key",
+ "dns-servers" :
[
{
- "ip_address" : "172.16.1.1"
+ "ip-address" : "172.16.1.1"
}
]
}
]
},
- "reverse_ddns" : {},
- "tsig_keys" :
+ "reverse-ddns" : {},
+ "tsig-keys" :
[
{
"name" : "d2.md5.key",
#------
,{
-"description" : "D2.forward_ddns, duplicate domain",
-"should_fail" : true,
+"description" : "D2.forward-ddns, duplicate domain",
+"should-fail" : true,
"data" :
{
- "forward_ddns" :
+ "forward-ddns" :
{
- "ddns_domains" :
+ "ddns-domains" :
[
{
"name" : "four.example.com.",
- "dns_servers" :
+ "dns-servers" :
[
{
- "ip_address" : "172.16.1.1"
+ "ip-address" : "172.16.1.1"
}
]
},
{
"name" : "four.example.com.",
- "dns_servers" :
+ "dns-servers" :
[
{
- "ip_address" : "172.16.1.2"
+ "ip-address" : "172.16.1.2"
}
]
}
]
},
- "reverse_ddns" : {},
- "tsig_keys" : []
+ "reverse-ddns" : {},
+ "tsig-keys" : []
}
}
-#----- D2.forward_ddns.dhcp_ddns tests
+#----- D2.forward-ddns.dhcp-ddns tests
,{
-"description" : "D2.forward_ddns.dhcp_ddns, unknown parameter",
-"should_fail" : true,
+"description" : "D2.forward-ddns.dhcp-ddns, unknown parameter",
+"should-fail" : true,
"data" :
{
- "forward_ddns" :
+ "forward-ddns" :
{
- "ddns_domains" :
+ "ddns-domains" :
[
{
"bogus" : true
}
]
},
- "reverse_ddns" : {},
- "tsig_keys" : []
+ "reverse-ddns" : {},
+ "tsig-keys" : []
}
}
-#----- D2.forward_ddns.dhcp_ddns.name tests
+#----- D2.forward-ddns.dhcp-ddns.name tests
,{
-"description" : "D2.forward_ddns.dhcp_ddns, no name",
-"should_fail" : true,
+"description" : "D2.forward-ddns.dhcp-ddns, no name",
+"should-fail" : true,
"data" :
{
- "forward_ddns" :
+ "forward-ddns" :
{
- "ddns_domains" :
+ "ddns-domains" :
[
{
}
]
},
- "reverse_ddns" : {},
- "tsig_keys" : []
+ "reverse-ddns" : {},
+ "tsig-keys" : []
}
}
#-----
,{
-"description" : "D2.forward_ddns.dhcp_ddns, blank name",
-"should_fail" : true,
+"description" : "D2.forward-ddns.dhcp-ddns, blank name",
+"should-fail" : true,
"data" :
{
- "forward_ddns" :
+ "forward-ddns" :
{
- "ddns_domains" :
+ "ddns-domains" :
[
{
"name" : ""
}
]
},
- "reverse_ddns" : {},
- "tsig_keys" : []
+ "reverse-ddns" : {},
+ "tsig-keys" : []
}
}
-#------ "D2.forward_ddns.dhcp_ddns, key_name tests
+#------ "D2.forward-ddns.dhcp-ddns, key-name tests
,{
-"description" : "D2.forward_ddns, no matching key name",
-"should_fail" : true,
+"description" : "D2.forward-ddns, no matching key name",
+"should-fail" : true,
"data" :
{
- "forward_ddns" :
+ "forward-ddns" :
{
- "ddns_domains" :
+ "ddns-domains" :
[
{
"name" : "four.example.com.",
- "key_name" : "no.such.key",
- "dns_servers" :
+ "key-name" : "no.such.key",
+ "dns-servers" :
[
{
- "ip_address" : "172.16.1.1"
+ "ip-address" : "172.16.1.1"
}
]
}
]
},
- "reverse_ddns" : {},
- "tsig_keys" :
+ "reverse-ddns" : {},
+ "tsig-keys" :
[
{
"name" : "d2.md5.key",
}
}
-#----- D2.forward_ddns.dhcp_ddns.dns_servers tests
+#----- D2.forward-ddns.dhcp-ddns.dns-servers tests
,{
-"description" : "D2.forward_ddns.dhcp_ddns.dns_servers, no servers",
-"should_fail" : true,
+"description" : "D2.forward-ddns.dhcp-ddns.dns-servers, no servers",
+"should-fail" : true,
"data" :
{
- "forward_ddns" :
+ "forward-ddns" :
{
- "ddns_domains" :
+ "ddns-domains" :
[
{
"name" : "four.example.com.",
- "dns_servers" : []
+ "dns-servers" : []
}
]
},
- "reverse_ddns" : {},
- "tsig_keys" : []
+ "reverse-ddns" : {},
+ "tsig-keys" : []
}
}
-#----- D2.forward_ddns.dhcp_ddns.dns_servers tests
+#----- D2.forward-ddns.dhcp-ddns.dns-servers tests
,{
-"description" : "D2.forward_ddns.dhcp_ddns.dns_servers, unknown parameter",
-"should_fail" : true,
+"description" : "D2.forward-ddns.dhcp-ddns.dns-servers, unknown parameter",
+"should-fail" : true,
"data" :
{
- "forward_ddns" :
+ "forward-ddns" :
{
- "ddns_domains" :
+ "ddns-domains" :
[
{
"name" : "four.example.com.",
- "dns_servers" :
+ "dns-servers" :
[
{
"bogus" : true
}
]
},
- "reverse_ddns" : {},
- "tsig_keys" : []
+ "reverse-ddns" : {},
+ "tsig-keys" : []
}
}
#-----
,{
-"description" : "D2.forward_ddns.dhcp_ddns.dns_servers.hostname unsupported",
-"should_fail" : true,
+"description" : "D2.forward-ddns.dhcp-ddns.dns-servers.hostname unsupported",
+"should-fail" : true,
"data" :
{
- "forward_ddns" :
+ "forward-ddns" :
{
- "ddns_domains" :
+ "ddns-domains" :
[
{
"name" : "four.example.com.",
- "dns_servers" :
+ "dns-servers" :
[
{
"hostname" : "myhost.com"
}
]
},
- "reverse_ddns" : {},
- "tsig_keys" : []
+ "reverse-ddns" : {},
+ "tsig-keys" : []
}
}
#-----
,{
-"description" : "D2.forward_ddns.dhcp_ddns.dns_servers.ip_address v4 address ",
+"description" : "D2.forward-ddns.dhcp-ddns.dns-servers.ip-address v4 address ",
"data" :
{
- "forward_ddns" :
+ "forward-ddns" :
{
- "ddns_domains" :
+ "ddns-domains" :
[
{
"name" : "four.example.com.",
- "dns_servers" :
+ "dns-servers" :
[
{
- "ip_address" : "172.16.1.1"
+ "ip-address" : "172.16.1.1"
}
]
}
]
},
- "reverse_ddns" : {},
- "tsig_keys" : []
+ "reverse-ddns" : {},
+ "tsig-keys" : []
}
}
#-----
,{
-"description" : "D2.forward_ddns.dhcp_ddns.dns_servers.ip_address v6 address ",
+"description" : "D2.forward-ddns.dhcp-ddns.dns-servers.ip-address v6 address ",
"data" :
{
- "forward_ddns" :
+ "forward-ddns" :
{
- "ddns_domains" :
+ "ddns-domains" :
[
{
"name" : "four.example.com.",
- "dns_servers" :
+ "dns-servers" :
[
{
- "ip_address" : "2001:db8::1"
+ "ip-address" : "2001:db8::1"
}
]
}
]
},
- "reverse_ddns" : {},
- "tsig_keys" : []
+ "reverse-ddns" : {},
+ "tsig-keys" : []
}
}
#-----
,{
-"description" : "D2.forward_ddns.dhcp_ddns.dns_servers.ip_address invalid address ",
-"should_fail" : true,
+"description" : "D2.forward-ddns.dhcp-ddns.dns-servers.ip-address invalid address ",
+"should-fail" : true,
"data" :
{
- "forward_ddns" :
+ "forward-ddns" :
{
- "ddns_domains" :
+ "ddns-domains" :
[
{
"name" : "four.example.com.",
- "dns_servers" :
+ "dns-servers" :
[
{
- "ip_address" : "bogus"
+ "ip-address" : "bogus"
}
]
}
]
},
- "reverse_ddns" : {},
- "tsig_keys" : []
+ "reverse-ddns" : {},
+ "tsig-keys" : []
}
}
#-----
,{
-"description" : "D2.forward_ddns.dhcp_ddns.dns_servers.port valid value ",
+"description" : "D2.forward-ddns.dhcp-ddns.dns-servers.port valid value ",
"data" :
{
- "forward_ddns" :
+ "forward-ddns" :
{
- "ddns_domains" :
+ "ddns-domains" :
[
{
"name" : "four.example.com.",
- "dns_servers" :
+ "dns-servers" :
[
{
- "ip_address" : "2001:db8::1",
+ "ip-address" : "2001:db8::1",
"port" : 77
}
]
}
]
},
- "reverse_ddns" : {},
- "tsig_keys" : []
+ "reverse-ddns" : {},
+ "tsig-keys" : []
}
}
#-----
,{
-"description" : "D2.forward_ddns.dhcp_ddns.dns_servers.port cannot be 0 ",
-"should_fail" : true,
+"description" : "D2.forward-ddns.dhcp-ddns.dns-servers.port cannot be 0 ",
+"should-fail" : true,
"data" :
{
- "forward_ddns" :
+ "forward-ddns" :
{
- "ddns_domains" :
+ "ddns-domains" :
[
{
"name" : "four.example.com.",
- "dns_servers" :
+ "dns-servers" :
[
{
- "ip_address" : "2001:db8::1",
+ "ip-address" : "2001:db8::1",
"port" : 0
}
]
}
]
},
- "reverse_ddns" : {},
- "tsig_keys" : []
+ "reverse-ddns" : {},
+ "tsig-keys" : []
}
}
-#----- D2.reverse_ddns tests
+#----- D2.reverse-ddns tests
,{
-"description" : "D2.reverse_ddns, valid, empty ddns_domains",
+"description" : "D2.reverse-ddns, valid, empty ddns-domains",
"data" :
{
- "forward_ddns" : {},
- "reverse_ddns" :
+ "forward-ddns" : {},
+ "reverse-ddns" :
{
- "ddns_domains" : []
+ "ddns-domains" : []
},
- "tsig_keys" : []
+ "tsig-keys" : []
}
}
#------
,{
-"description" : "D2.reverse_ddns, unknown parameter",
-"should_fail" : true,
+"description" : "D2.reverse-ddns, unknown parameter",
+"should-fail" : true,
"data" :
{
- "forward_ddns" : {},
- "reverse_ddns" :
+ "forward-ddns" : {},
+ "reverse-ddns" :
{
"bogus" : true,
- "ddns_domains" : []
+ "ddns-domains" : []
},
- "tsig_keys" : []
+ "tsig-keys" : []
}
}
#------
,{
-"description" : "D2.reverse_ddns, one valid, domain",
+"description" : "D2.reverse-ddns, one valid, domain",
"data" :
{
- "forward_ddns" : {},
- "reverse_ddns" :
+ "forward-ddns" : {},
+ "reverse-ddns" :
{
- "ddns_domains" :
+ "ddns-domains" :
[
{
"name" : "2.0.192.in-addra.arpa.",
- "key_name" : "d2.md5.key",
- "dns_servers" :
+ "key-name" : "d2.md5.key",
+ "dns-servers" :
[
{
- "ip_address" : "172.16.1.1"
+ "ip-address" : "172.16.1.1"
}
]
}
]
},
- "tsig_keys" :
+ "tsig-keys" :
[
{
"name" : "d2.md5.key",
#------
,{
-"description" : "D2.reverse_ddns, duplicate domain",
-"should_fail" : true,
+"description" : "D2.reverse-ddns, duplicate domain",
+"should-fail" : true,
"data" :
{
- "forward_ddns" : {},
- "reverse_ddns" :
+ "forward-ddns" : {},
+ "reverse-ddns" :
{
- "ddns_domains" :
+ "ddns-domains" :
[
{
"name" : "2.0.192.in-addra.arpa.",
- "dns_servers" :
+ "dns-servers" :
[
{
- "ip_address" : "172.16.1.1"
+ "ip-address" : "172.16.1.1"
}
]
},
{
"name" : "2.0.192.in-addra.arpa.",
- "dns_servers" :
+ "dns-servers" :
[
{
- "ip_address" : "172.16.1.2"
+ "ip-address" : "172.16.1.2"
}
]
}
]
},
- "tsig_keys" : []
+ "tsig-keys" : []
}
}
-#----- D2.reverse_ddns.dhcp_ddns tests
+#----- D2.reverse-ddns.dhcp-ddns tests
,{
-"description" : "D2.reverse_ddns.dhcp_ddns, unknown parameter",
-"should_fail" : true,
+"description" : "D2.reverse-ddns.dhcp-ddns, unknown parameter",
+"should-fail" : true,
"data" :
{
- "forward_ddns" : {},
- "reverse_ddns" :
+ "forward-ddns" : {},
+ "reverse-ddns" :
{
- "ddns_domains" :
+ "ddns-domains" :
[
{
"bogus" : true
}
]
},
- "tsig_keys" : []
+ "tsig-keys" : []
}
}
-#----- D2.reverse_ddns.dhcp_ddns.name tests
+#----- D2.reverse-ddns.dhcp-ddns.name tests
,{
-"description" : "D2.reverse_ddns.dhcp_ddns, no name",
-"should_fail" : true,
+"description" : "D2.reverse-ddns.dhcp-ddns, no name",
+"should-fail" : true,
"data" :
{
- "forward_ddns" : {},
- "reverse_ddns" :
+ "forward-ddns" : {},
+ "reverse-ddns" :
{
- "ddns_domains" :
+ "ddns-domains" :
[
{
}
]
},
- "tsig_keys" : []
+ "tsig-keys" : []
}
}
#-----
,{
-"description" : "D2.reverse_ddns.dhcp_ddns, blank name",
-"should_fail" : true,
+"description" : "D2.reverse-ddns.dhcp-ddns, blank name",
+"should-fail" : true,
"data" :
{
- "forward_ddns" : {},
- "reverse_ddns" :
+ "forward-ddns" : {},
+ "reverse-ddns" :
{
- "ddns_domains" :
+ "ddns-domains" :
[
{
"name" : ""
}
]
},
- "tsig_keys" : []
+ "tsig-keys" : []
}
}
-#------ "D2.reverse_ddns.dhcp_ddns, key_name tests
+#------ "D2.reverse-ddns.dhcp-ddns, key-name tests
,{
-"description" : "D2.reverse_ddns, no matching key name",
-"should_fail" : true,
+"description" : "D2.reverse-ddns, no matching key name",
+"should-fail" : true,
"data" :
{
- "forward_ddns" : {},
- "reverse_ddns" :
+ "forward-ddns" : {},
+ "reverse-ddns" :
{
- "ddns_domains" :
+ "ddns-domains" :
[
{
"name" : "2.0.192.in-addr.arpa.",
- "key_name" : "no.such.key",
- "dns_servers" :
+ "key-name" : "no.such.key",
+ "dns-servers" :
[
{
- "ip_address" : "172.16.1.1"
+ "ip-address" : "172.16.1.1"
}
]
}
]
},
- "tsig_keys" :
+ "tsig-keys" :
[
{
"name" : "d2.md5.key",
}
}
-#----- D2.reverse_ddns.dhcp_ddns.dns_servers tests
+#----- D2.reverse-ddns.dhcp-ddns.dns-servers tests
,{
-"description" : "D2.reverse_ddns.dhcp_ddns.dns_servers, no servers",
-"should_fail" : true,
+"description" : "D2.reverse-ddns.dhcp-ddns.dns-servers, no servers",
+"should-fail" : true,
"data" :
{
- "forward_ddns" : {},
- "reverse_ddns" :
+ "forward-ddns" : {},
+ "reverse-ddns" :
{
- "ddns_domains" :
+ "ddns-domains" :
[
{
"name" : "2.0.192.in-addr.arpa.",
- "dns_servers" : []
+ "dns-servers" : []
}
]
},
- "tsig_keys" : []
+ "tsig-keys" : []
}
}
-#----- D2.reverse_ddns.dhcp_ddns.dns_servers tests
+#----- D2.reverse-ddns.dhcp-ddns.dns-servers tests
,{
-"description" : "D2.reverse_ddns.dhcp_ddns.dns_servers, unknown parameter",
-"should_fail" : true,
+"description" : "D2.reverse-ddns.dhcp-ddns.dns-servers, unknown parameter",
+"should-fail" : true,
"data" :
{
- "forward_ddns" : {},
- "reverse_ddns" :
+ "forward-ddns" : {},
+ "reverse-ddns" :
{
- "ddns_domains" :
+ "ddns-domains" :
[
{
"name" : "2.0.192.in-addr.arpa.",
- "dns_servers" :
+ "dns-servers" :
[
{
"bogus" : true
}
]
},
- "tsig_keys" : []
+ "tsig-keys" : []
}
}
#-----
,{
-"description" : "D2.reverse_ddns.dhcp_ddns.dns_servers.hostname unsupported",
-"should_fail" : true,
+"description" : "D2.reverse-ddns.dhcp-ddns.dns-servers.hostname unsupported",
+"should-fail" : true,
"data" :
{
- "forward_ddns" : {},
- "reverse_ddns" :
+ "forward-ddns" : {},
+ "reverse-ddns" :
{
- "ddns_domains" :
+ "ddns-domains" :
[
{
"name" : "2.0.192.in-addr.arpa.",
- "dns_servers" :
+ "dns-servers" :
[
{
"hostname" : "myhost.com"
}
]
},
- "tsig_keys" : []
+ "tsig-keys" : []
}
}
#-----
,{
-"description" : "D2.reverse_ddns.dhcp_ddns.dns_servers.ip_address v4 address ",
+"description" : "D2.reverse-ddns.dhcp-ddns.dns-servers.ip-address v4 address ",
"data" :
{
- "forward_ddns" : {},
- "reverse_ddns" :
+ "forward-ddns" : {},
+ "reverse-ddns" :
{
- "ddns_domains" :
+ "ddns-domains" :
[
{
"name" : "2.0.192.in-addr.arpa.",
- "dns_servers" :
+ "dns-servers" :
[
{
- "ip_address" : "172.16.1.1"
+ "ip-address" : "172.16.1.1"
}
]
}
]
},
- "tsig_keys" : []
+ "tsig-keys" : []
}
}
#-----
,{
-"description" : "D2.reverse_ddns.dhcp_ddns.dns_servers.ip_address v6 address ",
+"description" : "D2.reverse-ddns.dhcp-ddns.dns-servers.ip-address v6 address ",
"data" :
{
- "forward_ddns" : {},
- "reverse_ddns" :
+ "forward-ddns" : {},
+ "reverse-ddns" :
{
- "ddns_domains" :
+ "ddns-domains" :
[
{
"name" : "2.0.192.in-addr.arpa.",
- "dns_servers" :
+ "dns-servers" :
[
{
- "ip_address" : "2001:db8::1"
+ "ip-address" : "2001:db8::1"
}
]
}
]
},
- "tsig_keys" : []
+ "tsig-keys" : []
}
}
#-----
,{
-"description" : "D2.reverse_ddns.dhcp_ddns.dns_servers.ip_address invalid value",
-"should_fail" : true,
+"description" : "D2.reverse-ddns.dhcp-ddns.dns-servers.ip-address invalid value",
+"should-fail" : true,
"data" :
{
- "forward_ddns" : {},
- "reverse_ddns" :
+ "forward-ddns" : {},
+ "reverse-ddns" :
{
- "ddns_domains" :
+ "ddns-domains" :
[
{
"name" : "2.0.192.in-addr.arpa.",
- "dns_servers" :
+ "dns-servers" :
[
{
- "ip_address" : "bogus"
+ "ip-address" : "bogus"
}
]
}
]
},
- "tsig_keys" : []
+ "tsig-keys" : []
}
}
#-----
,{
-"description" : "D2.reverse_ddns.dhcp_ddns.dns_servers.port valid value ",
+"description" : "D2.reverse-ddns.dhcp-ddns.dns-servers.port valid value ",
"data" :
{
- "forward_ddns" : {},
- "reverse_ddns" :
+ "forward-ddns" : {},
+ "reverse-ddns" :
{
- "ddns_domains" :
+ "ddns-domains" :
[
{
"name" : "2.0.192.in-addr.arpa.",
- "dns_servers" :
+ "dns-servers" :
[
{
- "ip_address" : "2001:db8::1",
+ "ip-address" : "2001:db8::1",
"port" : 77
}
]
}
]
},
- "tsig_keys" : []
+ "tsig-keys" : []
}
}
#-----
,{
-"description" : "D2.reverse_ddns.dhcp_ddns.dns_servers.port cannot be 0 ",
-"should_fail" : true,
+"description" : "D2.reverse-ddns.dhcp-ddns.dns-servers.port cannot be 0 ",
+"should-fail" : true,
"data" :
{
- "forward_ddns" : {},
- "reverse_ddns" :
+ "forward-ddns" : {},
+ "reverse-ddns" :
{
- "ddns_domains" :
+ "ddns-domains" :
[
{
"name" : "2.0.192.in-addr.arpa.",
- "dns_servers" :
+ "dns-servers" :
[
{
- "ip_address" : "2001:db8::1",
+ "ip-address" : "2001:db8::1",
"port" : 0
}
]
}
]
},
- "tsig_keys" : []
+ "tsig-keys" : []
}
}