BIND 10 master, updated. bbb0752c34f7712864b596f208cefd9746eab287 Merge branch 'master' into trac2421
BIND 10 source code commits
bind10-changes at lists.isc.org
Sun Nov 18 20:59:16 UTC 2012
The branch, master has been updated
via bbb0752c34f7712864b596f208cefd9746eab287 (commit)
via e650a0f7e51fc4158d001d04e30ffc239875d9f8 (commit)
via 744d1be57ae311af05de0ee9572feee0c8b157e7 (commit)
via b37e972c6c6a7b9eeb09addab58516a1df74c15b (commit)
via 74985768e65ba323fac4444945c2d238fdbe24c9 (commit)
via 49d6a081b5e38e6ac463e71ae4daac8c6c4829d7 (commit)
via 4bc7823ddb3d480a7e3ff259722832cee64bec22 (commit)
via 2332578b7a7c6a25e8f24eaafd08c1f0f507f382 (commit)
via bc457a13e13b10079985213922c579634e20ca11 (commit)
via 0d08fcb9a4218410fa08bbb7b70802de5af04525 (commit)
via 5ba2cab585357a99f0bfadeb8f8488150e40f923 (commit)
via 9e1942f5eab1a46932990fe9dd85a8c02ac40a11 (commit)
via 6c30834cb78baa51e6776452069ceda87d34864c (commit)
via cec4bf4314a6c8deaeadf10c5d95bc812480653a (commit)
via 80c2a36861978d77f7a1649ba32a316996376221 (commit)
via ecace4bc156ef36fdade632f5656ce8886b2433f (commit)
via 0ff35f6ed78f78cd23ddb0747d2f97e152e7b774 (commit)
from 33283af8e0f551ef3481817561ffddd0c9e5df88 (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 bbb0752c34f7712864b596f208cefd9746eab287
Merge: e650a0f 33283af
Author: Mukund Sivaraman <muks at isc.org>
Date: Mon Nov 19 01:27:13 2012 +0530
Merge branch 'master' into trac2421
-----------------------------------------------------------------------
Summary of changes:
src/lib/datasrc/Makefile.am | 1 +
src/lib/datasrc/client_list.cc | 16 +++++--
src/lib/datasrc/datasrc_messages.mes | 13 ++++--
.../exceptions.h} | 35 +++++++-------
src/lib/datasrc/memory/memory_client.h | 8 ++--
src/lib/datasrc/memory/zone_data_loader.cc | 6 ++-
src/lib/datasrc/memory/zone_data_loader.h | 5 +-
src/lib/datasrc/memory/zone_data_updater.cc | 2 +-
src/lib/datasrc/memory/zone_data_updater.h | 10 ++--
src/lib/datasrc/tests/client_list_unittest.cc | 33 ++++++++++---
.../datasrc/tests/memory/memory_client_unittest.cc | 10 ++--
src/lib/datasrc/tests/testdata/example.edu-broken | 11 +++++
src/lib/datasrc/tests/testdata/example.net-empty | 1 +
src/lib/datasrc/zone.h | 5 +-
tests/lettuce/configurations/auth/.gitignore | 1 +
.../auth_badzone.config.orig} | 5 +-
tests/lettuce/data/example.com-broken | 11 +++++
tests/lettuce/data/example.net-empty | 1 +
tests/lettuce/features/auth_badzone.feature | 49 ++++++++++++++++++++
tests/lettuce/features/terrain/terrain.py | 2 +
20 files changed, 172 insertions(+), 53 deletions(-)
copy src/lib/{python/isc/datasrc/configurableclientlist_python.h => datasrc/exceptions.h} (54%)
create mode 100644 src/lib/datasrc/tests/testdata/example.edu-broken
create mode 100644 src/lib/datasrc/tests/testdata/example.net-empty
copy tests/lettuce/configurations/{example.org.inmem.config => auth/auth_badzone.config.orig} (73%)
create mode 100644 tests/lettuce/data/example.com-broken
create mode 100644 tests/lettuce/data/example.net-empty
create mode 100644 tests/lettuce/features/auth_badzone.feature
-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/Makefile.am b/src/lib/datasrc/Makefile.am
index eccc147..f24d62c 100644
--- a/src/lib/datasrc/Makefile.am
+++ b/src/lib/datasrc/Makefile.am
@@ -26,6 +26,7 @@ lib_LTLIBRARIES = libb10-datasrc.la
libb10_datasrc_la_SOURCES = data_source.h
libb10_datasrc_la_SOURCES += rbnode_rrset.h
libb10_datasrc_la_SOURCES += rbtree.h
+libb10_datasrc_la_SOURCES += exceptions.h
libb10_datasrc_la_SOURCES += zonetable.h zonetable.cc
libb10_datasrc_la_SOURCES += zone.h zone_finder.cc zone_finder_context.cc
libb10_datasrc_la_SOURCES += result.h
diff --git a/src/lib/datasrc/client_list.cc b/src/lib/datasrc/client_list.cc
index e7fb63b..0750fb6 100644
--- a/src/lib/datasrc/client_list.cc
+++ b/src/lib/datasrc/client_list.cc
@@ -14,12 +14,14 @@
#include "client_list.h"
+#include "exceptions.h"
#include "client.h"
#include "factory.h"
#include "memory/memory_client.h"
#include "memory/zone_table_segment.h"
#include "memory/zone_writer.h"
#include "memory/zone_data_loader.h"
+#include "memory/zone_data_updater.h"
#include "logger.h"
#include <dns/masterload.h>
#include <util/memory_segment_local.h>
@@ -37,6 +39,7 @@ using boost::shared_ptr;
using boost::dynamic_pointer_cast;
using isc::datasrc::memory::InMemoryClient;
using isc::datasrc::memory::ZoneTableSegment;
+using isc::datasrc::memory::ZoneDataUpdater;
namespace isc {
namespace datasrc {
@@ -175,9 +178,9 @@ ConfigurableClientList::configure(const ConstElementPtr& config,
try {
cache->load(origin,
paramConf->get(*it)->stringValue());
- } catch (const isc::dns::MasterLoadError& mle) {
- LOG_ERROR(logger, DATASRC_MASTERLOAD_ERROR)
- .arg(mle.what());
+ } catch (const ZoneLoaderException& e) {
+ LOG_ERROR(logger, DATASRC_LOAD_FROM_FILE_ERROR)
+ .arg(origin).arg(e.what());
}
} else {
ZoneIteratorPtr iterator;
@@ -192,7 +195,12 @@ ConfigurableClientList::configure(const ConstElementPtr& config,
isc_throw(isc::Unexpected, "Got NULL iterator "
"for zone " << origin);
}
- cache->load(origin, *iterator);
+ try {
+ cache->load(origin, *iterator);
+ } catch (const ZoneLoaderException& e) {
+ LOG_ERROR(logger, DATASRC_LOAD_FROM_ITERATOR_ERROR)
+ .arg(origin).arg(e.what());
+ }
}
}
}
diff --git a/src/lib/datasrc/datasrc_messages.mes b/src/lib/datasrc/datasrc_messages.mes
index 94b4d42..3359d24 100644
--- a/src/lib/datasrc/datasrc_messages.mes
+++ b/src/lib/datasrc/datasrc_messages.mes
@@ -305,10 +305,15 @@ Therefore, the zone will not be available for this process. If this is
a problem, you should move the zone to some database backend (sqlite3, for
example) and use it from there.
-% DATASRC_MASTERLOAD_ERROR %1
-An error was found in the zone data for a MasterFiles zone. The zone
-is not loaded. The specific error is shown in the message, and should
-be addressed.
+% DATASRC_LOAD_FROM_FILE_ERROR Error loading zone %1: %2
+An error was found in the zone data when it was being loaded from a
+file. The zone was not loaded. The specific error is shown in the
+message, and should be addressed.
+
+% DATASRC_LOAD_FROM_ITERATOR_ERROR Error loading zone %1: %2
+An error was found in the zone data when it was being loaded from
+another data source. The zone was not loaded. The specific error is
+shown in the message, and should be addressed.
% DATASRC_MEM_ADD_RRSET adding RRset '%1/%2' into zone '%3'
Debug information. An RRset is being added to the in-memory data source.
diff --git a/src/lib/datasrc/exceptions.h b/src/lib/datasrc/exceptions.h
new file mode 100644
index 0000000..749b955
--- /dev/null
+++ b/src/lib/datasrc/exceptions.h
@@ -0,0 +1,47 @@
+// Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef DATASRC_EXCEPTIONS_H
+#define DATASRC_EXCEPTIONS_H 1
+
+#include <exceptions/exceptions.h>
+
+namespace isc {
+namespace datasrc {
+
+/// Base class for a number of exceptions that are thrown while working
+/// with zones.
+struct ZoneException : public Exception {
+ ZoneException(const char* file, size_t line, const char* what) :
+ Exception(file, line, what)
+ {}
+};
+
+/// Base class for a number of exceptions that are thrown when zones are
+/// being loaded. This is a recoverable exception. It should be possible
+/// to skip the bad zone and continue loading/serving other zones.
+struct ZoneLoaderException : public ZoneException {
+ ZoneLoaderException(const char* file, size_t line, const char* what) :
+ ZoneException(file, line, what)
+ {}
+};
+
+} // namespace datasrc
+} // namespace isc
+
+#endif // DATASRC_EXCEPTIONS
+
+// Local Variables:
+// mode: c++
+// End:
diff --git a/src/lib/datasrc/memory/memory_client.h b/src/lib/datasrc/memory/memory_client.h
index 3218c75..169421f 100644
--- a/src/lib/datasrc/memory/memory_client.h
+++ b/src/lib/datasrc/memory/memory_client.h
@@ -87,11 +87,11 @@ public:
/// current content. The masterfile parsing ability is kind of limited,
/// see isc::dns::masterLoad.
///
- /// This throws isc::dns::MasterLoadError if there is problem with loading
- /// (missing file, malformed, it contains different zone, etc - see
- /// isc::dns::masterLoad for details).
+ /// This throws isc::dns::MasterLoadError or AddError if there are
+ /// problems with loading (missing file, malformed data, unexpected
+ /// zone, etc. - see isc::dns::masterLoad for details).
///
- /// In case of internal problems, OutOfZone, NullRRset or AssertError could
+ /// In case of internal problems, NullRRset or AssertError could
/// be thrown, but they should not be expected. Exceptions caused by
/// allocation may be thrown as well.
///
diff --git a/src/lib/datasrc/memory/zone_data_loader.cc b/src/lib/datasrc/memory/zone_data_loader.cc
index d759901..d0a43a3 100644
--- a/src/lib/datasrc/memory/zone_data_loader.cc
+++ b/src/lib/datasrc/memory/zone_data_loader.cc
@@ -207,7 +207,11 @@ void
masterLoadWrapper(const char* const filename, const Name& origin,
const RRClass& zone_class, LoadCallback callback)
{
- masterLoad(filename, origin, zone_class, boost::bind(callback, _1));
+ try {
+ masterLoad(filename, origin, zone_class, boost::bind(callback, _1));
+ } catch (MasterLoadError& e) {
+ isc_throw(ZoneLoaderException, e.what());
+ }
}
// The installer called from the iterator version of loadZoneData().
diff --git a/src/lib/datasrc/memory/zone_data_loader.h b/src/lib/datasrc/memory/zone_data_loader.h
index 6f02fcb..6b409ec 100644
--- a/src/lib/datasrc/memory/zone_data_loader.h
+++ b/src/lib/datasrc/memory/zone_data_loader.h
@@ -15,6 +15,7 @@
#ifndef DATASRC_ZONE_DATA_LOADER_H
#define DATASRC_ZONE_DATA_LOADER_H 1
+#include <datasrc/exceptions.h>
#include <datasrc/memory/zone_data.h>
#include <datasrc/iterator.h>
#include <dns/name.h>
@@ -29,9 +30,9 @@ namespace memory {
///
/// This is thrown if an empty zone would be created during
/// \c loadZoneData().
-struct EmptyZone : public InvalidParameter {
+struct EmptyZone : public ZoneLoaderException {
EmptyZone(const char* file, size_t line, const char* what) :
- InvalidParameter(file, line, what)
+ ZoneLoaderException(file, line, what)
{}
};
diff --git a/src/lib/datasrc/memory/zone_data_updater.cc b/src/lib/datasrc/memory/zone_data_updater.cc
index 037eeb4..3df8c66 100644
--- a/src/lib/datasrc/memory/zone_data_updater.cc
+++ b/src/lib/datasrc/memory/zone_data_updater.cc
@@ -158,7 +158,7 @@ ZoneDataUpdater::validate(const isc::dns::ConstRRsetPtr rrset) const {
LOG_ERROR(logger,
DATASRC_MEMORY_MEM_OUT_OF_ZONE).arg(rrset->getName()).
arg(zone_name_);
- isc_throw(OutOfZone,
+ isc_throw(AddError,
"The name " << rrset->getName() <<
" is not contained in zone " << zone_name_);
}
diff --git a/src/lib/datasrc/memory/zone_data_updater.h b/src/lib/datasrc/memory/zone_data_updater.h
index 341d8ae..fa9a6af 100644
--- a/src/lib/datasrc/memory/zone_data_updater.h
+++ b/src/lib/datasrc/memory/zone_data_updater.h
@@ -15,6 +15,7 @@
#ifndef DATASRC_ZONE_DATA_UPDATER_H
#define DATASRC_ZONE_DATA_UPDATER_H 1
+#include <datasrc/exceptions.h>
#include <datasrc/memory/zone_data.h>
#include <datasrc/memory/rdata_serialization.h>
#include <dns/name.h>
@@ -94,14 +95,9 @@ public:
///
/// This is thrown against general error cases in adding an RRset
/// to the zone.
- ///
- /// Note: this exception would cover cases for \c OutOfZone or
- /// \c NullRRset. We'll need to clarify and unify the granularity
- /// of exceptions eventually. For now, exceptions are added as
- /// developers see the need for it.
- struct AddError : public InvalidParameter {
+ struct AddError : public ZoneLoaderException {
AddError(const char* file, size_t line, const char* what) :
- InvalidParameter(file, line, what)
+ ZoneLoaderException(file, line, what)
{}
};
diff --git a/src/lib/datasrc/tests/client_list_unittest.cc b/src/lib/datasrc/tests/client_list_unittest.cc
index d1ff852..6769e9b 100644
--- a/src/lib/datasrc/tests/client_list_unittest.cc
+++ b/src/lib/datasrc/tests/client_list_unittest.cc
@@ -827,27 +827,48 @@ TEST_F(ListTest, masterFiles) {
}
TEST_F(ListTest, BadMasterFile) {
- // Configure two zone correctly, and one with the wrong origin
- // (resulting in an out-of-zone data error)
- // Configuration should succeed, and the correct zones should
- // be loaded. Neither the 'bad' origin or the zone it used
- // should be loaded
+ // Configuration should succeed, and the good zones in the list
+ // below should be loaded. No bad zones should be loaded.
const ConstElementPtr elem(Element::fromJSON("["
"{"
" \"type\": \"MasterFiles\","
" \"cache-enable\": true,"
" \"params\": {"
+
+ // good zone
" \"example.com.\": \"" TEST_DATA_DIR "/example.com.flattened\","
+
+ // bad zone (empty file)
+ " \"example.net.\": \"" TEST_DATA_DIR "/example.net-empty\","
+
+ // bad zone (data doesn't validate: see the file for details)
+ " \"example.edu.\": \"" TEST_DATA_DIR "/example.edu-broken\","
+
+ // bad zone (file doesn't exist)
+ " \"example.info.\": \"" TEST_DATA_DIR "/example.info-nonexist\","
+
+ // bad zone (data doesn't match the zone name)
" \"foo.bar.\": \"" TEST_DATA_DIR "/example.org.nsec3-signed\","
+
+ // good zone
" \".\": \"" TEST_DATA_DIR "/root.zone\""
+
" }"
"}]"));
- list_->configure(elem, true);
+
+ EXPECT_NO_THROW({
+ // This should not throw even if there are any zone loading
+ // errors.
+ list_->configure(elem, true);
+ });
positiveResult(list_->find(Name("example.com."), true), ds_[0],
Name("example.com."), true, "example.com", true);
EXPECT_TRUE(negative_result_ == list_->find(Name("example.org."), true));
EXPECT_TRUE(negative_result_ == list_->find(Name("foo.bar"), true));
+ EXPECT_TRUE(negative_result_ == list_->find(Name("example.net."), true));
+ EXPECT_TRUE(negative_result_ == list_->find(Name("example.edu."), true));
+ EXPECT_TRUE(negative_result_ == list_->find(Name("example.info."), true));
positiveResult(list_->find(Name(".")), ds_[0], Name("."), true, "root",
true);
}
diff --git a/src/lib/datasrc/tests/memory/memory_client_unittest.cc b/src/lib/datasrc/tests/memory/memory_client_unittest.cc
index c1d2f30..38f6eff 100644
--- a/src/lib/datasrc/tests/memory/memory_client_unittest.cc
+++ b/src/lib/datasrc/tests/memory/memory_client_unittest.cc
@@ -186,7 +186,7 @@ TEST_F(MemoryClientTest, loadRRsetDoesntMatchOrigin) {
// in an exception.
EXPECT_THROW(client_->load(Name("example.com"),
TEST_DATA_DIR "/example.org-empty.zone"),
- MasterLoadError);
+ ZoneLoaderException);
}
TEST_F(MemoryClientTest, loadErrorsInParsingZoneMustNotLeak1) {
@@ -195,7 +195,7 @@ TEST_F(MemoryClientTest, loadErrorsInParsingZoneMustNotLeak1) {
// allocations.
EXPECT_THROW(client_->load(Name("example.org"),
TEST_DATA_DIR "/example.org-broken1.zone"),
- MasterLoadError);
+ ZoneLoaderException);
// Teardown checks for memory segment leaks
}
@@ -205,14 +205,14 @@ TEST_F(MemoryClientTest, loadErrorsInParsingZoneMustNotLeak2) {
// allocations.
EXPECT_THROW(client_->load(Name("example.org"),
TEST_DATA_DIR "/example.org-broken2.zone"),
- MasterLoadError);
+ ZoneLoaderException);
// Teardown checks for memory segment leaks
}
TEST_F(MemoryClientTest, loadNonExistentZoneFile) {
EXPECT_THROW(client_->load(Name("example.org"),
TEST_DATA_DIR "/somerandomfilename"),
- MasterLoadError);
+ ZoneLoaderException);
// Teardown checks for memory segment leaks
}
@@ -478,7 +478,7 @@ TEST_F(MemoryClientTest, loadOutOfZoneThrows) {
EXPECT_THROW(client_->load(Name("example.org"),
TEST_DATA_DIR
"/example.org-out-of-zone.zone"),
- MasterLoadError);
+ ZoneLoaderException);
// Teardown checks for memory segment leaks
}
diff --git a/src/lib/datasrc/tests/testdata/example.edu-broken b/src/lib/datasrc/tests/testdata/example.edu-broken
new file mode 100644
index 0000000..dde11cf
--- /dev/null
+++ b/src/lib/datasrc/tests/testdata/example.edu-broken
@@ -0,0 +1,11 @@
+example.edu. 3600 IN SOA ns1.example.edu. admin.example.edu. 1234 3600 1800 2419200 7200
+example.edu. 3600 IN NS ns1.example.edu.
+example.edu. 3600 IN NS ns2.example.edu.
+example.edu. 3600 IN MX 10 mail.example.edu.
+www.example.edu. 3600 IN A 192.0.2.1
+ns1.example.edu. 3600 IN A 192.0.2.3
+ns2.example.edu. 3600 IN A 192.0.2.4
+
+;; DNAME + NS (non-apex) throws ZoneDataUpdater::AddError
+ns1.example.edu. 3600 IN DNAME foo.example.edu.
+ns1.example.edu. 3600 IN NS bar.example.edu.
diff --git a/src/lib/datasrc/tests/testdata/example.net-empty b/src/lib/datasrc/tests/testdata/example.net-empty
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/src/lib/datasrc/tests/testdata/example.net-empty
@@ -0,0 +1 @@
+
diff --git a/src/lib/datasrc/zone.h b/src/lib/datasrc/zone.h
index 9572ed0..0d7438d 100644
--- a/src/lib/datasrc/zone.h
+++ b/src/lib/datasrc/zone.h
@@ -19,6 +19,7 @@
#include <dns/rrset.h>
#include <dns/rrtype.h>
+#include <datasrc/exceptions.h>
#include <datasrc/result.h>
#include <utility>
@@ -31,10 +32,10 @@ namespace datasrc {
///
/// This is thrown when a method is called for a name or RRset which
/// is not in or below the zone.
-class OutOfZone : public Exception {
+class OutOfZone : public ZoneException {
public:
OutOfZone(const char* file, size_t line, const char* what) :
- isc::Exception(file, line, what) {}
+ ZoneException(file, line, what) {}
};
/// \brief The base class to search a zone for RRsets
diff --git a/tests/lettuce/configurations/auth/.gitignore b/tests/lettuce/configurations/auth/.gitignore
index 07f1b7d..8165b69 100644
--- a/tests/lettuce/configurations/auth/.gitignore
+++ b/tests/lettuce/configurations/auth/.gitignore
@@ -1 +1,2 @@
+/auth_badzone.config
/auth_basic.config
diff --git a/tests/lettuce/configurations/auth/auth_badzone.config.orig b/tests/lettuce/configurations/auth/auth_badzone.config.orig
new file mode 100644
index 0000000..ab11bc9
--- /dev/null
+++ b/tests/lettuce/configurations/auth/auth_badzone.config.orig
@@ -0,0 +1,38 @@
+{
+ "version": 2,
+ "Logging": {
+ "loggers": [{
+ "severity": "DEBUG",
+ "name": "*",
+ "debuglevel": 99
+ }]
+ },
+ "Auth": {
+ "listen_on": [{
+ "port": 47806,
+ "address": "127.0.0.1"
+ }]
+ },
+ "data_sources": {
+ "classes": {
+ "IN": [
+ {
+ "type": "MasterFiles",
+ "cache-enable": true,
+ "params": {
+ "example.org": "data/example.org",
+ "example.com": "data/example.com-broken",
+ "example.net": "data/example.net-empty",
+ "example.info": "data/example.info-doesnt-exist"
+ }
+ }
+ ]
+ }
+ },
+ "Boss": {
+ "components": {
+ "b10-auth": { "kind": "needed", "special": "auth" },
+ "b10-cmdctl": { "special": "cmdctl", "kind": "needed" }
+ }
+ }
+}
diff --git a/tests/lettuce/data/example.com-broken b/tests/lettuce/data/example.com-broken
new file mode 100644
index 0000000..ceef6c3
--- /dev/null
+++ b/tests/lettuce/data/example.com-broken
@@ -0,0 +1,11 @@
+example.com. 3600 IN SOA ns1.example.com. admin.example.com. 1234 3600 1800 2419200 7200
+example.com. 3600 IN NS ns1.example.com.
+example.com. 3600 IN NS ns2.example.com.
+example.com. 3600 IN MX 10 mail.example.com.
+www.example.com. 3600 IN A 192.0.2.1
+ns1.example.com. 3600 IN A 192.0.2.3
+ns2.example.com. 3600 IN A 192.0.2.4
+
+;; DNAME + NS (non-apex) throws ZoneDataUpdater::AddError
+ns1.example.com. 3600 IN DNAME foo.example.com.
+ns1.example.com. 3600 IN NS bar.example.com.
diff --git a/tests/lettuce/data/example.net-empty b/tests/lettuce/data/example.net-empty
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/tests/lettuce/data/example.net-empty
@@ -0,0 +1 @@
+
diff --git a/tests/lettuce/features/auth_badzone.feature b/tests/lettuce/features/auth_badzone.feature
new file mode 100644
index 0000000..edc1a64
--- /dev/null
+++ b/tests/lettuce/features/auth_badzone.feature
@@ -0,0 +1,49 @@
+Feature: Authoritative DNS server with a bad zone
+ This feature set is for testing the execution of the b10-auth
+ component when one zone is broken, whereas others are fine. In this
+ case, b10-auth should not reject the data source, but reject the bad
+ zone only and serve the good zones anyway.
+
+ Scenario: Bad zone
+ Given I have bind10 running with configuration auth/auth_badzone.config
+
+ # loading example.com, example.net and example.info zones fail.
+ # Note: wait for these messages right away as otherwise they
+ # will be logged and we cannot use the 'new' keyword to wait for
+ # 3 different log messages. *There could still be a race here if
+ # auth starts very quickly.*
+ And wait for new bind10 stderr message DATASRC_LOAD_FROM_FILE_ERROR
+ And wait for new bind10 stderr message DATASRC_LOAD_FROM_FILE_ERROR
+ And wait for new bind10 stderr message DATASRC_LOAD_FROM_FILE_ERROR
+
+ And wait for bind10 stderr message BIND10_STARTED_CC
+ And wait for bind10 stderr message CMDCTL_STARTED
+ And wait for bind10 stderr message AUTH_SERVER_STARTED
+
+ bind10 module Auth should be running
+ And bind10 module Resolver should not be running
+
+ A query for www.example.org should have rcode NOERROR
+ The last query response should have flags qr aa rd
+ The last query response should have ancount 1
+ The last query response should have nscount 2
+ The last query response should have adcount 2
+
+ The answer section of the last query response should be
+ """
+ www.example.org. 3600 IN A 192.0.2.1
+ """
+ The authority section of the last query response should be
+ """
+ example.org. 3600 IN NS ns1.example.org.
+ example.org. 3600 IN NS ns2.example.org.
+ """
+ The additional section of the last query response should be
+ """
+ ns1.example.org. 3600 IN A 192.0.2.3
+ ns2.example.org. 3600 IN A 192.0.2.4
+ """
+
+ A query for www.example.com should have rcode REFUSED
+ A query for www.example.net should have rcode REFUSED
+ A query for www.example.info should have rcode REFUSED
diff --git a/tests/lettuce/features/terrain/terrain.py b/tests/lettuce/features/terrain/terrain.py
index 74cdfea..bc05341 100644
--- a/tests/lettuce/features/terrain/terrain.py
+++ b/tests/lettuce/features/terrain/terrain.py
@@ -51,6 +51,8 @@ copylist = [
"configurations/bindctl/bindctl.config"],
["configurations/auth/auth_basic.config.orig",
"configurations/auth/auth_basic.config"],
+ ["configurations/auth/auth_badzone.config.orig",
+ "configurations/auth/auth_badzone.config"],
["configurations/resolver/resolver_basic.config.orig",
"configurations/resolver/resolver_basic.config"],
["configurations/multi_instance/multi_auth.config.orig",
More information about the bind10-changes
mailing list