BIND 10 trac3281, updated. 29dfbd1cf13eba290dcabd4dbecbc7321b4f1294 [3281] Addressed review comments.

BIND 10 source code commits bind10-changes at lists.isc.org
Mon Mar 31 18:57:02 UTC 2014


The branch, trac3281 has been updated
       via  29dfbd1cf13eba290dcabd4dbecbc7321b4f1294 (commit)
      from  1d9abefeca557f2ab2865cd364c08969d3027b88 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 29dfbd1cf13eba290dcabd4dbecbc7321b4f1294
Author: Marcin Siodelski <marcin at isc.org>
Date:   Mon Mar 31 20:56:54 2014 +0200

    [3281] Addressed review comments.

-----------------------------------------------------------------------

Summary of changes:
 src/bin/dhcp4/tests/config_parser_unittest.cc |   17 +----------------
 src/bin/dhcp6/tests/config_parser_unittest.cc |   11 +++++------
 src/lib/dhcpsrv/cfgmgr.cc                     |    6 ++----
 src/lib/dhcpsrv/tests/subnet_unittest.cc      |    2 +-
 4 files changed, 9 insertions(+), 27 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/bin/dhcp4/tests/config_parser_unittest.cc b/src/bin/dhcp4/tests/config_parser_unittest.cc
index 7d9a3e2..e01c1dd 100644
--- a/src/bin/dhcp4/tests/config_parser_unittest.cc
+++ b/src/bin/dhcp4/tests/config_parser_unittest.cc
@@ -576,16 +576,9 @@ TEST_F(Dhcp4ParserTest, multipleSubnets) {
 
     ElementPtr json = Element::fromJSON(config);
 
-    EXPECT_NO_THROW(x = configureDhcp4Server(*srv_, json));
-    ASSERT_TRUE(x);
-    comment_ = parseAnswer(rcode_, x);
-    ASSERT_EQ(0, rcode_);
-
     int cnt = 0; // Number of reconfigurations
 
     do {
-        ElementPtr json = Element::fromJSON(config);
-
         EXPECT_NO_THROW(x = configureDhcp4Server(*srv_, json));
         ASSERT_TRUE(x);
         comment_ = parseAnswer(rcode_, x);
@@ -639,16 +632,8 @@ TEST_F(Dhcp4ParserTest, multipleSubnetsExplicitIDs) {
 
     ElementPtr json = Element::fromJSON(config);
 
-    EXPECT_NO_THROW(x = configureDhcp4Server(*srv_, json));
-    ASSERT_TRUE(x);
-    comment_ = parseAnswer(rcode_, x);
-    ASSERT_EQ(0, rcode_);
-
     int cnt = 0; // Number of reconfigurations
-
     do {
-        ElementPtr json = Element::fromJSON(config);
-
         EXPECT_NO_THROW(x = configureDhcp4Server(*srv_, json));
         ASSERT_TRUE(x);
         comment_ = parseAnswer(rcode_, x);
@@ -666,7 +651,7 @@ TEST_F(Dhcp4ParserTest, multipleSubnetsExplicitIDs) {
 
         // Repeat reconfiguration process 10 times and check that the subnet-id
         // is set to the same value.
-    } while (++cnt < 10);
+    } while (++cnt < 3);
 }
 
 // Check that the configuration with two subnets having the same id is rejected.
diff --git a/src/bin/dhcp6/tests/config_parser_unittest.cc b/src/bin/dhcp6/tests/config_parser_unittest.cc
index e1d70b1..42ba112 100644
--- a/src/bin/dhcp6/tests/config_parser_unittest.cc
+++ b/src/bin/dhcp6/tests/config_parser_unittest.cc
@@ -598,9 +598,9 @@ TEST_F(Dhcp6ParserTest, multipleSubnets) {
 
     int cnt = 0; // Number of reconfigurations
 
-    do {
-        ElementPtr json = Element::fromJSON(config);
+    ElementPtr json = Element::fromJSON(config);
 
+    do {
         EXPECT_NO_THROW(x = configureDhcp6Server(srv_, json));
         ASSERT_TRUE(x);
         comment_ = parseAnswer(rcode_, x);
@@ -655,9 +655,9 @@ TEST_F(Dhcp6ParserTest, multipleSubnetsExplicitIDs) {
 
     int cnt = 0; // Number of reconfigurations
 
-    do {
-        ElementPtr json = Element::fromJSON(config);
+    ElementPtr json = Element::fromJSON(config);
 
+    do {
         EXPECT_NO_THROW(x = configureDhcp6Server(srv_, json));
         ASSERT_TRUE(x);
         comment_ = parseAnswer(rcode_, x);
@@ -675,7 +675,7 @@ TEST_F(Dhcp6ParserTest, multipleSubnetsExplicitIDs) {
 
         // Repeat reconfiguration process 10 times and check that the subnet-id
         // is set to the same value.
-    } while (++cnt < 10);
+    } while (++cnt < 3);
 }
 
 // CHeck that the configuration with two subnets having the same id is rejected.
@@ -824,7 +824,6 @@ TEST_F(Dhcp6ParserTest, reconfigureRemoveSubnet) {
     /// CASE 2: Configure 4 subnets, then reconfigure and remove one
     /// from in between (not first, not last)
 
-    /// @todo: Uncomment subnet removal test as part of #3281.
     json = Element::fromJSON(config4);
     EXPECT_NO_THROW(x = configureDhcp6Server(srv_, json));
     ASSERT_TRUE(x);
diff --git a/src/lib/dhcpsrv/cfgmgr.cc b/src/lib/dhcpsrv/cfgmgr.cc
index 4c88828..12f1e5b 100644
--- a/src/lib/dhcpsrv/cfgmgr.cc
+++ b/src/lib/dhcpsrv/cfgmgr.cc
@@ -221,8 +221,7 @@ void CfgMgr::addSubnet6(const Subnet6Ptr& subnet) {
     /// @todo: Check that there is no subnet with the same interface-id
     if (isDuplicate(*subnet)) {
         isc_throw(isc::dhcp::DuplicateSubnetID, "ID of the new IPv6 subnet '"
-                  << subnet->getID() << "' is the same as ID of an existing"
-                  " subnet");
+                  << subnet->getID() << "' is already in use");
     }
     LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE, DHCPSRV_CFGMGR_ADD_SUBNET6)
               .arg(subnet->toText());
@@ -289,8 +288,7 @@ void CfgMgr::addSubnet4(const Subnet4Ptr& subnet) {
     /// other already defined subnet.
     if (isDuplicate(*subnet)) {
         isc_throw(isc::dhcp::DuplicateSubnetID, "ID of the new IPv4 subnet '"
-                  << subnet->getID() << "' is the same as ID of an existing"
-                  " subnet");
+                  << subnet->getID() << "' is already in use");
     }
     LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE, DHCPSRV_CFGMGR_ADD_SUBNET4)
               .arg(subnet->toText());
diff --git a/src/lib/dhcpsrv/tests/subnet_unittest.cc b/src/lib/dhcpsrv/tests/subnet_unittest.cc
index 485242e..99332e7 100644
--- a/src/lib/dhcpsrv/tests/subnet_unittest.cc
+++ b/src/lib/dhcpsrv/tests/subnet_unittest.cc
@@ -59,7 +59,7 @@ TEST(Subnet4Test, subnetID) {
     EXPECT_NE(id0, id1);
 
     // Create third subnet but this time select an arbitrary id. The id
-    // we use us the one of second subnet. That way we ensure that the
+    // we use the one of the second subnet. That way we ensure that the
     // subnet id we provide via constructor is used and it is not
     // autogenerated - if it was autogenerated we would get id other
     // than id1 because id1 has already been used.



More information about the bind10-changes mailing list