|
@@ -1,4 +1,4 @@
|
|
|
-// Copyright (C) 2012-2015 Internet Systems Consortium, Inc. ("ISC")
|
|
|
+// Copyright (C) 2012-2016 Internet Systems Consortium, Inc. ("ISC")
|
|
|
//
|
|
|
// This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
@@ -20,6 +20,34 @@ using namespace isc;
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
+/// @brief Tests conversion of NameChangeFormat between enum and strings.
|
|
|
+TEST(ReplaceClientNameModeTest, formatEnumConversion){
|
|
|
+ ASSERT_EQ(D2ClientConfig::stringToReplaceClientNameMode("never"),
|
|
|
+ D2ClientConfig::RCM_NEVER);
|
|
|
+ ASSERT_EQ(D2ClientConfig::stringToReplaceClientNameMode("always"),
|
|
|
+ D2ClientConfig::RCM_ALWAYS);
|
|
|
+ ASSERT_EQ(D2ClientConfig::stringToReplaceClientNameMode("when-present"),
|
|
|
+ D2ClientConfig::RCM_WHEN_PRESENT);
|
|
|
+ ASSERT_EQ(D2ClientConfig::stringToReplaceClientNameMode("when-not-present"),
|
|
|
+ D2ClientConfig::RCM_WHEN_NOT_PRESENT);
|
|
|
+ ASSERT_THROW(D2ClientConfig::stringToReplaceClientNameMode("BOGUS"),
|
|
|
+ isc::BadValue);
|
|
|
+
|
|
|
+ ASSERT_EQ(D2ClientConfig::
|
|
|
+ replaceClientNameModeToString(D2ClientConfig::RCM_NEVER),
|
|
|
+ "never");
|
|
|
+ ASSERT_EQ(D2ClientConfig::
|
|
|
+ replaceClientNameModeToString(D2ClientConfig::RCM_ALWAYS),
|
|
|
+ "always");
|
|
|
+ ASSERT_EQ(D2ClientConfig::
|
|
|
+ replaceClientNameModeToString(D2ClientConfig::RCM_WHEN_PRESENT),
|
|
|
+ "when-present");
|
|
|
+ ASSERT_EQ(D2ClientConfig::
|
|
|
+ replaceClientNameModeToString(D2ClientConfig::
|
|
|
+ RCM_WHEN_NOT_PRESENT),
|
|
|
+ "when-not-present");
|
|
|
+}
|
|
|
+
|
|
|
/// @brief Checks constructors and accessors of D2ClientConfig.
|
|
|
TEST(D2ClientConfigTest, constructorsAndAccessors) {
|
|
|
D2ClientConfigPtr d2_client_config;
|
|
@@ -47,7 +75,8 @@ TEST(D2ClientConfigTest, constructorsAndAccessors) {
|
|
|
bool always_include_fqdn = true;
|
|
|
bool override_no_update = true;
|
|
|
bool override_client_update = true;
|
|
|
- bool replace_client_name = true;
|
|
|
+ D2ClientConfig::ReplaceClientNameMode replace_client_name_mode = D2ClientConfig::
|
|
|
+ RCM_WHEN_PRESENT;
|
|
|
std::string generated_prefix = "the_prefix";
|
|
|
std::string qualifying_suffix = "the.suffix.";
|
|
|
|
|
@@ -63,8 +92,8 @@ TEST(D2ClientConfigTest, constructorsAndAccessors) {
|
|
|
ncr_format,
|
|
|
always_include_fqdn,
|
|
|
override_no_update,
|
|
|
- override_client_update,
|
|
|
- replace_client_name,
|
|
|
+ override_client_update,
|
|
|
+ replace_client_name_mode,
|
|
|
generated_prefix,
|
|
|
qualifying_suffix)));
|
|
|
|
|
@@ -84,7 +113,7 @@ TEST(D2ClientConfigTest, constructorsAndAccessors) {
|
|
|
EXPECT_EQ(d2_client_config->getOverrideNoUpdate(), override_no_update);
|
|
|
EXPECT_EQ(d2_client_config->getOverrideClientUpdate(),
|
|
|
override_client_update);
|
|
|
- EXPECT_EQ(d2_client_config->getReplaceClientName(), replace_client_name);
|
|
|
+ EXPECT_EQ(d2_client_config->getReplaceClientNameMode(), replace_client_name_mode);
|
|
|
EXPECT_EQ(d2_client_config->getGeneratedPrefix(), generated_prefix);
|
|
|
EXPECT_EQ(d2_client_config->getQualifyingSuffix(), qualifying_suffix);
|
|
|
|
|
@@ -106,7 +135,7 @@ TEST(D2ClientConfigTest, constructorsAndAccessors) {
|
|
|
always_include_fqdn,
|
|
|
override_no_update,
|
|
|
override_client_update,
|
|
|
- replace_client_name,
|
|
|
+ replace_client_name_mode,
|
|
|
generated_prefix,
|
|
|
qualifying_suffix)),
|
|
|
D2ClientError);
|
|
@@ -127,7 +156,7 @@ TEST(D2ClientConfigTest, equalityOperator) {
|
|
|
ASSERT_NO_THROW(ref_config.reset(new D2ClientConfig(true,
|
|
|
ref_address, 477, ref_address, 478, 1024,
|
|
|
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
|
|
|
- true, true, true, true,
|
|
|
+ true, true, true, D2ClientConfig::RCM_WHEN_PRESENT,
|
|
|
"pre-fix", "suf-fix")));
|
|
|
ASSERT_TRUE(ref_config);
|
|
|
|
|
@@ -135,7 +164,7 @@ TEST(D2ClientConfigTest, equalityOperator) {
|
|
|
ASSERT_NO_THROW(test_config.reset(new D2ClientConfig(true,
|
|
|
ref_address, 477, ref_address, 478, 1024,
|
|
|
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
|
|
|
- true, true, true, true,
|
|
|
+ true, true, true, D2ClientConfig::RCM_WHEN_PRESENT,
|
|
|
"pre-fix", "suf-fix")));
|
|
|
ASSERT_TRUE(test_config);
|
|
|
EXPECT_TRUE(*ref_config == *test_config);
|
|
@@ -145,7 +174,7 @@ TEST(D2ClientConfigTest, equalityOperator) {
|
|
|
ASSERT_NO_THROW(test_config.reset(new D2ClientConfig(false,
|
|
|
ref_address, 477, ref_address, 478, 1024,
|
|
|
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
|
|
|
- true, true, true, true,
|
|
|
+ true, true, true, D2ClientConfig::RCM_WHEN_PRESENT,
|
|
|
"pre-fix", "suf-fix")));
|
|
|
ASSERT_TRUE(test_config);
|
|
|
EXPECT_FALSE(*ref_config == *test_config);
|
|
@@ -155,7 +184,7 @@ TEST(D2ClientConfigTest, equalityOperator) {
|
|
|
ASSERT_NO_THROW(test_config.reset(new D2ClientConfig(true,
|
|
|
test_address, 477, ref_address, 478, 1024,
|
|
|
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
|
|
|
- true, true, true, true,
|
|
|
+ true, true, true, D2ClientConfig::RCM_WHEN_PRESENT,
|
|
|
"pre-fix", "suf-fix")));
|
|
|
ASSERT_TRUE(test_config);
|
|
|
EXPECT_FALSE(*ref_config == *test_config);
|
|
@@ -165,7 +194,7 @@ TEST(D2ClientConfigTest, equalityOperator) {
|
|
|
ASSERT_NO_THROW(test_config.reset(new D2ClientConfig(true,
|
|
|
ref_address, 333, ref_address, 478, 1024,
|
|
|
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
|
|
|
- true, true, true, true,
|
|
|
+ true, true, true, D2ClientConfig::RCM_WHEN_PRESENT,
|
|
|
"pre-fix", "suf-fix")));
|
|
|
ASSERT_TRUE(test_config);
|
|
|
EXPECT_FALSE(*ref_config == *test_config);
|
|
@@ -175,7 +204,7 @@ TEST(D2ClientConfigTest, equalityOperator) {
|
|
|
ASSERT_NO_THROW(test_config.reset(new D2ClientConfig(true,
|
|
|
ref_address, 477, test_address, 478, 1024,
|
|
|
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
|
|
|
- true, true, true, true,
|
|
|
+ true, true, true, D2ClientConfig::RCM_WHEN_PRESENT,
|
|
|
"pre-fix", "suf-fix")));
|
|
|
ASSERT_TRUE(test_config);
|
|
|
EXPECT_FALSE(*ref_config == *test_config);
|
|
@@ -185,7 +214,7 @@ TEST(D2ClientConfigTest, equalityOperator) {
|
|
|
ASSERT_NO_THROW(test_config.reset(new D2ClientConfig(true,
|
|
|
ref_address, 477, ref_address, 333, 1024,
|
|
|
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
|
|
|
- true, true, true, true,
|
|
|
+ true, true, true, D2ClientConfig::RCM_WHEN_PRESENT,
|
|
|
"pre-fix", "suf-fix")));
|
|
|
ASSERT_TRUE(test_config);
|
|
|
EXPECT_FALSE(*ref_config == *test_config);
|
|
@@ -195,7 +224,7 @@ TEST(D2ClientConfigTest, equalityOperator) {
|
|
|
ASSERT_NO_THROW(test_config.reset(new D2ClientConfig(true,
|
|
|
ref_address, 477, ref_address, 478, 2048,
|
|
|
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
|
|
|
- true, true, true, true,
|
|
|
+ true, true, true, D2ClientConfig::RCM_WHEN_PRESENT,
|
|
|
"pre-fix", "suf-fix")));
|
|
|
ASSERT_TRUE(test_config);
|
|
|
EXPECT_FALSE(*ref_config == *test_config);
|
|
@@ -205,7 +234,7 @@ TEST(D2ClientConfigTest, equalityOperator) {
|
|
|
ASSERT_NO_THROW(test_config.reset(new D2ClientConfig(true,
|
|
|
ref_address, 477, ref_address, 478, 1024,
|
|
|
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
|
|
|
- false, true, true, true,
|
|
|
+ false, true, true, D2ClientConfig::RCM_WHEN_PRESENT,
|
|
|
"pre-fix", "suf-fix")));
|
|
|
ASSERT_TRUE(test_config);
|
|
|
EXPECT_FALSE(*ref_config == *test_config);
|
|
@@ -215,7 +244,7 @@ TEST(D2ClientConfigTest, equalityOperator) {
|
|
|
ASSERT_NO_THROW(test_config.reset(new D2ClientConfig(true,
|
|
|
ref_address, 477, ref_address, 478, 1024,
|
|
|
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
|
|
|
- true, false, true, true,
|
|
|
+ true, false, true, D2ClientConfig::RCM_WHEN_PRESENT,
|
|
|
"pre-fix", "suf-fix")));
|
|
|
ASSERT_TRUE(test_config);
|
|
|
EXPECT_FALSE(*ref_config == *test_config);
|
|
@@ -225,7 +254,7 @@ TEST(D2ClientConfigTest, equalityOperator) {
|
|
|
ASSERT_NO_THROW(test_config.reset(new D2ClientConfig(true,
|
|
|
ref_address, 477, ref_address, 478, 1024,
|
|
|
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
|
|
|
- true, true, false, true,
|
|
|
+ true, true, false, D2ClientConfig::RCM_WHEN_PRESENT,
|
|
|
"pre-fix", "suf-fix")));
|
|
|
ASSERT_TRUE(test_config);
|
|
|
EXPECT_FALSE(*ref_config == *test_config);
|
|
@@ -235,7 +264,7 @@ TEST(D2ClientConfigTest, equalityOperator) {
|
|
|
ASSERT_NO_THROW(test_config.reset(new D2ClientConfig(true,
|
|
|
ref_address, 477, ref_address, 478, 1024,
|
|
|
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
|
|
|
- true, true, true, false,
|
|
|
+ true, true, true, D2ClientConfig::RCM_NEVER,
|
|
|
"pre-fix", "suf-fix")));
|
|
|
ASSERT_TRUE(test_config);
|
|
|
EXPECT_FALSE(*ref_config == *test_config);
|
|
@@ -245,7 +274,7 @@ TEST(D2ClientConfigTest, equalityOperator) {
|
|
|
ASSERT_NO_THROW(test_config.reset(new D2ClientConfig(true,
|
|
|
ref_address, 477, ref_address, 478, 1024,
|
|
|
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
|
|
|
- true, true, true, true,
|
|
|
+ true, true, true, D2ClientConfig::RCM_WHEN_PRESENT,
|
|
|
"bogus", "suf-fix")));
|
|
|
ASSERT_TRUE(test_config);
|
|
|
EXPECT_FALSE(*ref_config == *test_config);
|
|
@@ -255,7 +284,7 @@ TEST(D2ClientConfigTest, equalityOperator) {
|
|
|
ASSERT_NO_THROW(test_config.reset(new D2ClientConfig(true,
|
|
|
ref_address, 477, ref_address, 478, 1024,
|
|
|
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
|
|
|
- true, true, true, true,
|
|
|
+ true, true, true, D2ClientConfig::RCM_WHEN_PRESENT,
|
|
|
"pre-fix", "bogus")));
|
|
|
ASSERT_TRUE(test_config);
|
|
|
EXPECT_FALSE(*ref_config == *test_config);
|
|
@@ -300,7 +329,7 @@ TEST(D2ClientMgr, validConfig) {
|
|
|
isc::asiolink::IOAddress("127.0.0.1"), 478,
|
|
|
1024,
|
|
|
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
|
|
|
- true, true, true, true,
|
|
|
+ true, true, true, D2ClientConfig::RCM_WHEN_PRESENT,
|
|
|
"pre-fix", "suf-fix")));
|
|
|
|
|
|
// Verify that we can assign a new, non-empty configuration.
|
|
@@ -344,7 +373,7 @@ TEST(D2ClientMgr, analyzeFqdnInvalidCombination) {
|
|
|
isc::asiolink::IOAddress("127.0.0.1"), 478,
|
|
|
1024,
|
|
|
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
|
|
|
- false, false, false, false,
|
|
|
+ false, false, false, D2ClientConfig::RCM_NEVER,
|
|
|
"pre-fix", "suf-fix")));
|
|
|
ASSERT_NO_THROW(mgr.setD2ClientConfig(cfg));
|
|
|
ASSERT_TRUE(mgr.ddnsEnabled());
|
|
@@ -368,7 +397,7 @@ TEST(D2ClientMgr, analyzeFqdnEnabledNoOverrides) {
|
|
|
isc::asiolink::IOAddress("127.0.0.1"), 478,
|
|
|
1024,
|
|
|
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
|
|
|
- false, false, false, false,
|
|
|
+ false, false, false, D2ClientConfig::RCM_NEVER,
|
|
|
"pre-fix", "suf-fix")));
|
|
|
ASSERT_NO_THROW(mgr.setD2ClientConfig(cfg));
|
|
|
ASSERT_TRUE(mgr.ddnsEnabled());
|
|
@@ -412,7 +441,7 @@ TEST(D2ClientMgr, analyzeFqdnEnabledOverrideNoUpdate) {
|
|
|
isc::asiolink::IOAddress("127.0.0.1"), 478,
|
|
|
1024,
|
|
|
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
|
|
|
- false, true, false, false,
|
|
|
+ false, true, false, D2ClientConfig::RCM_NEVER,
|
|
|
"pre-fix", "suf-fix")));
|
|
|
ASSERT_NO_THROW(mgr.setD2ClientConfig(cfg));
|
|
|
ASSERT_TRUE(mgr.ddnsEnabled());
|
|
@@ -455,7 +484,7 @@ TEST(D2ClientMgr, analyzeFqdnEnabledOverrideClientUpdate) {
|
|
|
isc::asiolink::IOAddress("127.0.0.1"), 478,
|
|
|
1024,
|
|
|
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
|
|
|
- false, false, true, false,
|
|
|
+ false, false, true, D2ClientConfig::RCM_NEVER,
|
|
|
"pre-fix", "suf-fix")));
|
|
|
ASSERT_NO_THROW(mgr.setD2ClientConfig(cfg));
|
|
|
ASSERT_TRUE(mgr.ddnsEnabled());
|
|
@@ -499,7 +528,7 @@ TEST(D2ClientMgr, adjustFqdnFlagsV4) {
|
|
|
isc::asiolink::IOAddress("127.0.0.1"), 478,
|
|
|
1024,
|
|
|
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
|
|
|
- false, true, false, false,
|
|
|
+ false, true, false, D2ClientConfig::RCM_NEVER,
|
|
|
"pre-fix", "suf-fix")));
|
|
|
ASSERT_NO_THROW(mgr.setD2ClientConfig(cfg));
|
|
|
ASSERT_TRUE(mgr.ddnsEnabled());
|
|
@@ -600,7 +629,7 @@ TEST(D2ClientMgr, qualifyName) {
|
|
|
isc::asiolink::IOAddress("127.0.0.1"), 478,
|
|
|
1024,
|
|
|
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
|
|
|
- false, false, true, false,
|
|
|
+ false, false, true, D2ClientConfig::RCM_NEVER,
|
|
|
"prefix", "suffix.com")));
|
|
|
ASSERT_NO_THROW(mgr.setD2ClientConfig(cfg));
|
|
|
|
|
@@ -616,7 +645,7 @@ TEST(D2ClientMgr, qualifyName) {
|
|
|
isc::asiolink::IOAddress("127.0.0.1"), 478,
|
|
|
1024,
|
|
|
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
|
|
|
- false, false, true, false,
|
|
|
+ false, false, true, D2ClientConfig::RCM_NEVER,
|
|
|
"prefix", "suffix.com")));
|
|
|
ASSERT_NO_THROW(mgr.setD2ClientConfig(cfg));
|
|
|
partial_name = "somehost";
|
|
@@ -630,7 +659,7 @@ TEST(D2ClientMgr, qualifyName) {
|
|
|
isc::asiolink::IOAddress("127.0.0.1"), 478,
|
|
|
1024,
|
|
|
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
|
|
|
- false, false, true, false,
|
|
|
+ false, false, true, D2ClientConfig::RCM_NEVER,
|
|
|
"prefix", ""))); //empty suffix
|
|
|
ASSERT_NO_THROW(mgr.setD2ClientConfig(cfg));
|
|
|
partial_name = "somehost";
|
|
@@ -643,7 +672,7 @@ TEST(D2ClientMgr, qualifyName) {
|
|
|
isc::asiolink::IOAddress("127.0.0.1"), 478,
|
|
|
1024,
|
|
|
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
|
|
|
- false, false, true, false,
|
|
|
+ false, false, true, D2ClientConfig::RCM_NEVER,
|
|
|
"prefix", "hasdot.com.")));
|
|
|
ASSERT_NO_THROW(mgr.setD2ClientConfig(cfg));
|
|
|
|
|
@@ -662,7 +691,7 @@ TEST(D2ClientMgr, qualifyName) {
|
|
|
isc::asiolink::IOAddress("127.0.0.1"), 478,
|
|
|
1024,
|
|
|
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
|
|
|
- false, false, true, false,
|
|
|
+ false, false, true, D2ClientConfig::RCM_NEVER,
|
|
|
"prefix", "")));
|
|
|
ASSERT_NO_THROW(mgr.setD2ClientConfig(cfg));
|
|
|
|
|
@@ -700,7 +729,7 @@ TEST(D2ClientMgr, generateFqdn) {
|
|
|
isc::asiolink::IOAddress("127.0.0.1"), 478,
|
|
|
1024,
|
|
|
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
|
|
|
- false, false, true, false,
|
|
|
+ false, false, true, D2ClientConfig::RCM_NEVER,
|
|
|
"prefix", "suffix.com")));
|
|
|
ASSERT_NO_THROW(mgr.setD2ClientConfig(cfg));
|
|
|
|
|
@@ -734,10 +763,10 @@ TEST(D2ClientMgr, adjustDomainNameV4) {
|
|
|
isc::asiolink::IOAddress("127.0.0.1"), 478,
|
|
|
1024,
|
|
|
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
|
|
|
- false, false, false, false,
|
|
|
+ false, false, false, D2ClientConfig::RCM_NEVER,
|
|
|
"prefix", "suffix.com")));
|
|
|
ASSERT_NO_THROW(mgr.setD2ClientConfig(cfg));
|
|
|
- ASSERT_FALSE(cfg->getReplaceClientName());
|
|
|
+ ASSERT_EQ(D2ClientConfig::RCM_NEVER, cfg->getReplaceClientNameMode());
|
|
|
|
|
|
// replace-client-name is false, client passes in empty fqdn
|
|
|
// reponse domain should be empty/partial.
|
|
@@ -777,10 +806,10 @@ TEST(D2ClientMgr, adjustDomainNameV4) {
|
|
|
isc::asiolink::IOAddress("127.0.0.1"), 478,
|
|
|
1024,
|
|
|
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
|
|
|
- false, false, false, true,
|
|
|
+ false, false, false, D2ClientConfig::RCM_WHEN_PRESENT,
|
|
|
"prefix", "suffix.com")));
|
|
|
ASSERT_NO_THROW(mgr.setD2ClientConfig(cfg));
|
|
|
- ASSERT_TRUE(cfg->getReplaceClientName());
|
|
|
+ ASSERT_EQ(D2ClientConfig::RCM_WHEN_PRESENT, cfg->getReplaceClientNameMode());
|
|
|
|
|
|
// replace-client-name is true, client passes in empty fqdn
|
|
|
// reponse domain should be empty/partial.
|
|
@@ -827,10 +856,10 @@ TEST(D2ClientMgr, adjustDomainNameV6) {
|
|
|
isc::asiolink::IOAddress("127.0.0.1"), 478,
|
|
|
1024,
|
|
|
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
|
|
|
- false, false, false, false,
|
|
|
+ false, false, false, D2ClientConfig::RCM_NEVER,
|
|
|
"prefix", "suffix.com")));
|
|
|
ASSERT_NO_THROW(mgr.setD2ClientConfig(cfg));
|
|
|
- ASSERT_FALSE(cfg->getReplaceClientName());
|
|
|
+ ASSERT_EQ(D2ClientConfig::RCM_NEVER, cfg->getReplaceClientNameMode());
|
|
|
|
|
|
// replace-client-name is false, client passes in empty fqdn
|
|
|
// reponse domain should be empty/partial.
|
|
@@ -867,10 +896,10 @@ TEST(D2ClientMgr, adjustDomainNameV6) {
|
|
|
isc::asiolink::IOAddress("127.0.0.1"), 478,
|
|
|
1024,
|
|
|
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
|
|
|
- false, false, false, true,
|
|
|
+ false, false, false, D2ClientConfig::RCM_WHEN_PRESENT,
|
|
|
"prefix", "suffix.com")));
|
|
|
ASSERT_NO_THROW(mgr.setD2ClientConfig(cfg));
|
|
|
- ASSERT_TRUE(cfg->getReplaceClientName());
|
|
|
+ ASSERT_EQ(D2ClientConfig::RCM_WHEN_PRESENT, cfg->getReplaceClientNameMode());
|
|
|
|
|
|
// replace-client-name is true, client passes in empty fqdn
|
|
|
// reponse domain should be empty/partial.
|
|
@@ -917,7 +946,7 @@ TEST(D2ClientMgr, adjustFqdnFlagsV6) {
|
|
|
isc::asiolink::IOAddress("127.0.0.1"), 478,
|
|
|
1024,
|
|
|
dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
|
|
|
- false, true, false, false,
|
|
|
+ false, true, false, D2ClientConfig::RCM_NEVER,
|
|
|
"pre-fix", "suf-fix")));
|
|
|
ASSERT_NO_THROW(mgr.setD2ClientConfig(cfg));
|
|
|
ASSERT_TRUE(mgr.ddnsEnabled());
|