BIND 10 trac2355, updated. aedbd11c6780fb36fbaa8c6c8c4521caf24fa5b4 [2355] CfgMgr.addOptionDefs unit test was failing with duplicat definition exception under Ubuntu. Added logic to reset all of CfgMgr data between tests. Did not fail under Mac OS-X. New unit tests added for options definition tests were leaving data in CfgMgr.

BIND 10 source code commits bind10-changes at lists.isc.org
Mon May 6 20:33:56 UTC 2013


The branch, trac2355 has been updated
       via  aedbd11c6780fb36fbaa8c6c8c4521caf24fa5b4 (commit)
      from  c519aa88c8cf4edb25a53ec761364b076a6ae497 (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 aedbd11c6780fb36fbaa8c6c8c4521caf24fa5b4
Author: Thomas Markwalder <tmark at isc.org>
Date:   Mon May 6 16:29:57 2013 -0400

    [2355] CfgMgr.addOptionDefs unit test was failing with duplicat definition
    exception under Ubuntu. Added logic to reset all of CfgMgr data between tests. Did not fail under Mac OS-X. New unit tests added for options definition tests were leaving data in CfgMgr.

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

Summary of changes:
 src/lib/dhcpsrv/tests/cfgmgr_unittest.cc       |    1 +
 src/lib/dhcpsrv/tests/dhcp_parsers_unittest.cc |    9 ++++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

-----------------------------------------------------------------------
diff --git a/src/lib/dhcpsrv/tests/cfgmgr_unittest.cc b/src/lib/dhcpsrv/tests/cfgmgr_unittest.cc
index 4543c07..adb0a29 100644
--- a/src/lib/dhcpsrv/tests/cfgmgr_unittest.cc
+++ b/src/lib/dhcpsrv/tests/cfgmgr_unittest.cc
@@ -163,6 +163,7 @@ public:
         // make sure we start with a clean configuration
         CfgMgr::instance().deleteSubnets4();
         CfgMgr::instance().deleteSubnets6();
+        //CfgMgr::instance().deleteOptionDefs();
     }
 
     ~CfgMgrTest() {
diff --git a/src/lib/dhcpsrv/tests/dhcp_parsers_unittest.cc b/src/lib/dhcpsrv/tests/dhcp_parsers_unittest.cc
index 81a36af..fe30365 100644
--- a/src/lib/dhcpsrv/tests/dhcp_parsers_unittest.cc
+++ b/src/lib/dhcpsrv/tests/dhcp_parsers_unittest.cc
@@ -13,11 +13,11 @@
 // PERFORMANCE OF THIS SOFTWARE.
 
 #include <config.h>
-
 #include <config/ccsession.h>
 #include <dhcp/option.h>
 #include <dhcp/option_custom.h>
 #include <dhcp/option_int.h>
+#include <dhcpsrv/cfgmgr.h>
 #include <dhcpsrv/subnet.h>
 #include <dhcpsrv/dhcp_parsers.h>
 #include <exceptions/exceptions.h>
@@ -246,6 +246,10 @@ public:
         reset_context();
     }
 
+    ~ParseConfigTest() {
+        reset_context();
+    }
+
     /// @brief Parses a configuration.   
     ///
     /// Parse the given configuration, populating the context storage with
@@ -418,6 +422,9 @@ public:
     /// during a given test if needed.
     void reset_context(){
         // Note set context universe to V6 as it has to be something.
+        CfgMgr::instance().deleteSubnets4();
+        CfgMgr::instance().deleteSubnets6();
+        CfgMgr::instance().deleteOptionDefs();
         parser_context_.reset(new ParserContext(Option::V6));
     }
 



More information about the bind10-changes mailing list