BIND 10 trac2439, updated. cc9e3303451d440894ce918ae5f1e0d55b30f650 [2439] Lettuce test for rejecting a XFR transfer
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu Jan 24 18:48:28 UTC 2013
The branch, trac2439 has been updated
via cc9e3303451d440894ce918ae5f1e0d55b30f650 (commit)
via dcd93a56893257541fbe19fcd112f7fdda5cb7bb (commit)
from 1a235092e9050f116b87a1edc5b2b6095aacc9e8 (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 cc9e3303451d440894ce918ae5f1e0d55b30f650
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Thu Jan 24 19:47:37 2013 +0100
[2439] Lettuce test for rejecting a XFR transfer
Provide a zone without NS and see it rejects it.
This actually found a bug, maybe unrelated.
commit dcd93a56893257541fbe19fcd112f7fdda5cb7bb
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Thu Jan 24 19:27:12 2013 +0100
[2439] Lettuce tests for post-xfrin validation
Check the data in existing tests produce warnings, but the data is still
accepted.
-----------------------------------------------------------------------
Summary of changes:
....conf.orig => retransfer_master_nons.conf.orig} | 4 +-
...xample.org.sqlite3 => example.org-nons.sqlite3} | Bin 15360 -> 15360 bytes
tests/lettuce/features/terrain/terrain.py | 2 +
tests/lettuce/features/xfrin_bind10.feature | 49 ++++++++++++++++++++
4 files changed, 53 insertions(+), 2 deletions(-)
copy tests/lettuce/configurations/xfrin/{retransfer_master.conf.orig => retransfer_master_nons.conf.orig} (89%)
copy tests/lettuce/data/{example.org.sqlite3 => example.org-nons.sqlite3} (89%)
-----------------------------------------------------------------------
diff --git a/tests/lettuce/configurations/xfrin/retransfer_master_nons.conf.orig b/tests/lettuce/configurations/xfrin/retransfer_master_nons.conf.orig
new file mode 100644
index 0000000..80cc3db
--- /dev/null
+++ b/tests/lettuce/configurations/xfrin/retransfer_master_nons.conf.orig
@@ -0,0 +1,48 @@
+{
+ "version": 2,
+ "Logging": {
+ "loggers": [ {
+ "debuglevel": 99,
+ "severity": "DEBUG",
+ "name": "*"
+ } ]
+ },
+ "Auth": {
+ "database_file": "data/example.org-nons.sqlite3",
+ "listen_on": [ {
+ "address": "::1",
+ "port": 47807
+ } ]
+ },
+ "data_sources": {
+ "classes": {
+ "IN": [{
+ "type": "sqlite3",
+ "params": {
+ "database_file": "data/example.org-nons.sqlite3"
+ }
+ }]
+ }
+ },
+ "Xfrout": {
+ "zone_config": [ {
+ "origin": "example.org"
+ } ],
+ "also_notify": [ {
+ "address": "::1",
+ "port": 47806
+ } ]
+ },
+ "Stats": {
+ "poll-interval": 1
+ },
+ "Boss": {
+ "components": {
+ "b10-auth": { "kind": "needed", "special": "auth" },
+ "b10-xfrout": { "address": "Xfrout", "kind": "dispensable" },
+ "b10-zonemgr": { "address": "Zonemgr", "kind": "dispensable" },
+ "b10-stats": { "address": "Stats", "kind": "dispensable" },
+ "b10-cmdctl": { "special": "cmdctl", "kind": "needed" }
+ }
+ }
+}
diff --git a/tests/lettuce/data/example.org-nons.sqlite3 b/tests/lettuce/data/example.org-nons.sqlite3
new file mode 100644
index 0000000..40ddbf6
Binary files /dev/null and b/tests/lettuce/data/example.org-nons.sqlite3 differ
diff --git a/tests/lettuce/features/terrain/terrain.py b/tests/lettuce/features/terrain/terrain.py
index bc05341..18d0d1e 100644
--- a/tests/lettuce/features/terrain/terrain.py
+++ b/tests/lettuce/features/terrain/terrain.py
@@ -63,6 +63,8 @@ copylist = [
"configurations/ddns/noddns.config"],
["configurations/xfrin/retransfer_master.conf.orig",
"configurations/xfrin/retransfer_master.conf"],
+ ["configurations/xfrin/retransfer_master_nons.conf.orig",
+ "configurations/xfrin/retransfer_master_nons.conf"],
["configurations/xfrin/retransfer_slave.conf.orig",
"configurations/xfrin/retransfer_slave.conf"],
["data/inmem-xfrin.sqlite3.orig",
diff --git a/tests/lettuce/features/xfrin_bind10.feature b/tests/lettuce/features/xfrin_bind10.feature
index 34674ca..c9bd758 100644
--- a/tests/lettuce/features/xfrin_bind10.feature
+++ b/tests/lettuce/features/xfrin_bind10.feature
@@ -25,6 +25,13 @@ Feature: Xfrin
A query for www.example.org to [::1]:47806 should have rcode REFUSED
When I send bind10 the command Xfrin retransfer example.org IN ::1 47807
+ # The data we receive contain a NS RRset that refers to three names in the
+ # example.org. zone. All these three are nonexistent in the data, producing
+ # 3 separate warning messages in the log.
+ And wait for new bind10 stderr message XFRIN_ZONE_WARN
+ And wait for new bind10 stderr message XFRIN_ZONE_WARN
+ And wait for new bind10 stderr message XFRIN_ZONE_WARN
+ # But after complaining, the zone data should be accepted.
Then wait for new bind10 stderr message XFRIN_TRANSFER_SUCCESS not XFRIN_XFR_PROCESS_FAILURE
Then wait for new bind10 stderr message ZONEMGR_RECEIVE_XFRIN_SUCCESS
A query for www.example.org to [::1]:47806 should have rcode NOERROR
@@ -86,3 +93,45 @@ Feature: Xfrin
# Transwer should succeed now
When I send bind10 the command Xfrin retransfer example.org
Then wait for new bind10 stderr message XFRIN_TRANSFER_SUCCESS not XFRIN_XFR_PROCESS_FAILURE
+
+ Scenario: Validation fails
+ # In this test, the source data of the XFR is invalid (missing NS record
+ # at the origin). We check it is rejected after the transfer.
+ #
+ # We use abuse the fact that we do not check data when we read it from
+ # the sqlite3 database (unless we load into in-memory, which we don't
+ # do here).
+ The file data/test_nonexistent_db.sqlite3 should not exist
+
+ Given I have bind10 running with configuration xfrin/retransfer_master_nons.conf with cmdctl port 47804 as master
+ And wait for master stderr message BIND10_STARTED_CC
+ And wait for master stderr message CMDCTL_STARTED
+ And wait for master stderr message AUTH_SERVER_STARTED
+ And wait for master stderr message XFROUT_STARTED
+ And wait for master stderr message ZONEMGR_STARTED
+
+ And I have bind10 running with configuration xfrin/retransfer_slave.conf
+ 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
+ And wait for bind10 stderr message XFRIN_STARTED
+ And wait for bind10 stderr message ZONEMGR_STARTED
+
+ # Now we use the first step again to see if the file has been created
+ The file data/test_nonexistent_db.sqlite3 should exist
+
+ A query for www.example.org to [::1]:47806 should have rcode REFUSED
+ When I send bind10 the command Xfrin retransfer example.org IN ::1 47807
+ # It should complain once about invalid data, then again that the whole
+ # zone is invalid and then reject it.
+ And wait for new bind10 stderr message XFRIN_ZONE_INVALID
+ And wait for new bind10 stderr message XFRIN_INVALID_ZONE_DATA
+ Then wait for new bind10 stderr message ZONEMGR_RECEIVE_XFRIN_FAILED
+ # The zone still doesn't exist as it is rejected.
+ # FIXME: This step fails. Probably an empty zone is created in the data
+ # source :-|.
+ A query for www.example.org to [::1]:47806 should have rcode REFUSED
+
+ # TODO: Update scenario, load previous zone, upgrade to never one but
+ # broken. We use the fact that the SOA serial is higher in the nons
+ # version of DB.
More information about the bind10-changes
mailing list