BIND 10 trac2993, updated. d399683b0d058126c2889d090b6067dcac0de859 [2993] Add unittest for the case where ZoneWriter encounters a bad zone and must not throw
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu Jun 27 03:29:39 UTC 2013
The branch, trac2993 has been updated
via d399683b0d058126c2889d090b6067dcac0de859 (commit)
from b178f2a38b94200e35758f6e8d7e570a0cfc41ec (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 d399683b0d058126c2889d090b6067dcac0de859
Author: Mukund Sivaraman <muks at isc.org>
Date: Thu Jun 27 08:59:00 2013 +0530
[2993] Add unittest for the case where ZoneWriter encounters a bad zone and must not throw
-----------------------------------------------------------------------
Summary of changes:
src/lib/datasrc/tests/client_list_unittest.cc | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/tests/client_list_unittest.cc b/src/lib/datasrc/tests/client_list_unittest.cc
index 04c3069..90dbf3f 100644
--- a/src/lib/datasrc/tests/client_list_unittest.cc
+++ b/src/lib/datasrc/tests/client_list_unittest.cc
@@ -1041,6 +1041,31 @@ ListTest::doReload(const Name& origin, const string& datasrc_name) {
return (result.first);
}
+// Check that ZoneWriter doesn't throw when asked not to
+TEST_P(ListTest, checkZoneWriterCatchesExceptions) {
+ const ConstElementPtr config_elem_zones_(Element::fromJSON("["
+ "{"
+ " \"type\": \"MasterFiles\","
+ " \"params\": {"
+ " \"example.edu\": \"" TEST_DATA_DIR "example.edu-broken\""
+ " },"
+ " \"cache-enable\": true"
+ "}]"));
+
+ list_->configure(config_elem_zones_, true);
+ ConfigurableClientList::ZoneWriterPair
+ result(list_->getCachedZoneWriter(Name("example.edu"), true));
+ ASSERT_EQ(ConfigurableClientList::ZONE_SUCCESS, result.first);
+ ASSERT_TRUE(result.second);
+
+ std::string error_msg;
+ // This should not throw and must return an error message in
+ // error_msg.
+ EXPECT_NO_THROW(result.second->load(&error_msg));
+ EXPECT_FALSE(error_msg.empty());
+ result.second->cleanup();
+}
+
// Test we can reload a zone
TEST_P(ListTest, reloadSuccess) {
list_->configure(config_elem_zones_, true);
More information about the bind10-changes
mailing list